Пример #1
0
        private async void SaveWeightVolume(string weightVolumeType)
        {
            var requestModel = new UserWeightVolume()
            {
                WeightVolume = weightVolumeType
            };
            var response = await _settingService.UpdateUserWeightVolumeAsync(requestModel);

            if (response == HttpConstants.SUCCESS)
            {
                await App.Configuration.SetWeightVolumeAsync(requestModel.WeightVolume);

                App.GoToAccountPage(true);
            }
        }
Пример #2
0
        public async Task <string> UpdateUserWeightVolumeAsync(UserWeightVolume weightVolume)
        {
            var response = await ClientService.PostDataAsync(weightVolume, ControllerName, "postuserweightvolume");

            if (response != null)
            {
                Task <string> jsonTask = response.Content.ReadAsStringAsync();
                var           result   = JsonConvert.DeserializeObject(jsonTask.Result);
                if (jsonTask.Result.Contains(HttpConstants.SUCCESS))
                {
                    return(HttpConstants.SUCCESS);
                }
                else if (response.ToString().Contains(HttpConstants.UNAUTHORIZED))
                {
                    return(response.ToString());
                }
                return(jsonTask.Result);
            }
            else
            {
                return(TextResources.MessageSomethingWentWrong);
            }
        }