Exemplo n.º 1
0
        private async Task RemoveActionAsync(object itemName)
        {
            try
            {
                DialogService.ShowLoading("Removing Item");
                mSavelaterR listitem = (from itm in MySaveList
                                        where itm.Name == itemName.ToString()
                                        select itm)
                                       .FirstOrDefault <mSavelaterR>();

                var result = await SavelaterService.Instance.DeleteItem(listitem.Id, AccountService.Instance.Current_Account.Email);

                DialogService.HideLoading();
                if (result == "true")
                {
                    GetSave();
                    return;
                }
                else
                {
                    DialogService.ShowError(result);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(Keys.TAG + ex);
                DialogService.ShowError(Strings.SomethingWrong);
                Crashes.TrackError(ex);
            }
        }
Exemplo n.º 2
0
        private async Task CartActionAsync(object itemName)
        {
            try
            {
                DialogService.ShowLoading("Adding To Cart");
                mSavelaterR listitem = (from itm in MySaveList
                                        where itm.Name == itemName.ToString()
                                        select itm)
                                       .FirstOrDefault <mSavelaterR>();

                mCartS item = new mCartS()
                {
                    Owner     = AccountService.Instance.Current_Account.Email,
                    Quantity  = "1",
                    ProductId = listitem.Id
                };
                var result = await SavelaterService.Instance.MvtoCart(item);

                DialogService.HideLoading();
                if (result == "true")
                {
                    GetSave();
                    return;
                }
                else
                {
                    DialogService.ShowError(result);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(Keys.TAG + ex);
                DialogService.ShowError(Strings.SomethingWrong);
                Crashes.TrackError(ex);
            }
        }