This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: 'https://dealpigs.com/svc/productline', | |
type: 'GET', | |
success: function (data) { | |
alert(JSON.stringify(data))); //show JSON of deals array | |
}, | |
error: function (jqXHR, textStatus, errorThrown) { | |
alert(errorThrown); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Checks if the defined document database and collection exists | |
/// and initializes them if they don't. | |
/// </summary> | |
public async Task InitializeDatabaseIfNotExisting(string serverPath) | |
{ | |
var database = _documentClient.CreateDatabaseQuery() | |
.Where(db => db.Id == _documentDataBaseId) | |
.AsEnumerable() | |
.FirstOrDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Fetches the photo stream data for a specified user. | |
/// </summary> | |
/// <param name="userId">The user id.</param> | |
/// <param name="continuationToken">Last captured ticks in the form of a string.</param> | |
/// <returns>List of photos up to the page size.</returns> | |
public async Task<PagedResponse<PhotoContract>> GetUserPhotoStream(string userId, string continuationToken) | |
{ | |
var feedOptions = new FeedOptions | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Store Procedure for getting the most recent photos for each category | |
// @param numberOfPhotos - The number of photos to return per category | |
// @param currentDocumentVersion - The current document version number that the service is using | |
function getRecentPhotosForCategories(numberOfPhotos, currentDocumentVersion) { | |
let catCount = 0; | |
let catIndex = 0; | |
let existingPhotos = []; | |
getAllCategories(function (allCategories) { | |
for (var i = 0; i < allCategories.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Stored Procedures | |
private const string TransferGoldStoredProcedureScriptFileName = @"Models\DocumentDB\js\transferGoldStoredProcedure.js"; | |
private const string TransferGoldStoredProcedureId = "transferGold"; | |
private const string GetRecentPhotosForCategoriesStoredProcedureScriptFileName = @"Models\DocumentDB\js\getRecentPhotosForCategoriesStoredProcedure.js"; | |
private const string GetRecentPhotosForCategoriesStoredProcedureId = "getRecentPhotosForCategories"; | |
private async Task InitializeStoredProceduresInDocumentDb() | |
{ | |
// Initialize GoldTransaction Sproc | |
var sproc = new StoredProcedure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<UserControl | |
x:Class="PhotoSharingApp.Universal.Controls.PageHeader" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:PhotoSharingApp.Universal.Controls" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:valueConverters="using:PhotoSharingApp.Universal.ValueConverters" | |
VerticalAlignment="Top" | |
VerticalContentAlignment="Top" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Color x:Key="AppAccentColor">#3498db</Color> | |
<SolidColorBrush x:Key="AppAccentColorBrush" Color="{StaticResource AppAccentColor}" /> | |
<Color x:Key="AppAccentLightColor">#2980b9</Color> | |
<SolidColorBrush x:Key="AppAccentLightColorBrush" Color="{StaticResource AppAccentLightColor}" /> | |
<Color x:Key="AppAccentForegroundColor">#333333</Color> | |
<SolidColorBrush x:Key="AppAccentForegroundColorBrush" Color="{StaticResource AppAccentForegroundColor}" /> | |
<Color x:Key="AppAccentBackgroundColor">#FFE6E6E6</Color> | |
<SolidColorBrush x:Key="AppAccentBackgroundColorBrush" Color="{StaticResource AppAccentBackgroundColor}" /> | |
<Color x:Key="BusyIndicatorBackgroundColor">#7F000000</Color> | |
<SolidColorBrush x:Key="BusyIndicatorBackgroundColorBrush" Color="{StaticResource BusyIndicatorBackgroundColor}" /> |