public async void SetCartCount() { var UserId = AppSettings.GetValueOrDefault(Resources.UserId, Resources.DefaultIntValue); SearchItemsDataService SearchCartCountdata = new SearchItemsDataService(); CartItemCount = await SearchCartCountdata.GetCartServiceCount(UserId.ToString()); AppSettings.AddOrUpdateValue(Resources.CartItemCount, CartItemCount.ToString()); }
public async void GetItems() { var UserId = AppSettings.GetValueOrDefault(Resources.UserId, Resources.DefaultIntValue); SearchItemsDataService SearchCartCountdata = new SearchItemsDataService(); CartItemCount = await SearchCartCountdata.GetCartServiceCount(UserId.ToString()); AppSettings.AddOrUpdateValue(Resources.CartItemCount, CartItemCount.ToString()); ItemCatalogueDataService DataItems = new ItemCatalogueDataService(); var ItemCatalogue = await DataItems.GetServiceItems(ItemCategoryId); ItemCatalogueList = new ObservableCollection <ItemCatalogueModel>(ItemCatalogue); }
private async void AddToCartClicked(object obj) { SearchItemsDataService AddCartItemdata = new SearchItemsDataService(); HttpResponseMessage response = await AddCartItemdata.AddItemToCartService(obj); var status = response.StatusCode; if (status == HttpStatusCode.OK) { CartItemCount += 1; AppSettings.AddOrUpdateValue(Resources.CartItemCount, CartItemCount.ToString()); DependencyService.Get <IMessage>().LongAlert(Resources.CartAddMsg); } else if (status == HttpStatusCode.Found) { DependencyService.Get <IMessage>().LongAlert(Resources.CartUpdateMsg); } else if (status == HttpStatusCode.NotModified) { DependencyService.Get <IMessage>().LongAlert(Resources.CartErrorMsg); } }