Exemple #1
0
        public async void UpdateShop()
        {
            try
            {
                var saveShop = new SaveShop()
                {
                    Name          = nameEntryCell.Text,
                    StreetAddress = streeAddressEntry.Text,
                    City          = cityEntryCell.Text,
                    State         = stateEntryCell.Text,
                    ZipCode       = zipcodeEntryCell.Text,
                    Image         = imageEntryCell.Text,
                    PhoneNumber   = phoneEntryCell.Text,
                    Longitude     = double.Parse(longitudeEntryCell.Text),
                    Latitude      = double.Parse(latitudeEntryCell.Text)
                };

                var response = await services.UpdateShop(Id, saveShop);

                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                {
                    await DisplayAlert("Updated", "Youe store information has been updated", "Ok");
                }

                await Navigation.PopAsync();
            }
            catch (Exception ex)
            {
                await DisplayAlert("Error", ex.Message, "Ok");
            }
        }