示例#1
0
        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());
        }
示例#2
0
        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);
        }
示例#3
0
        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);
            }
        }