//下一步按钮 Next Button void Handle_Next(object sender, EventArgs e) { string language = "English"; var tih = new TopicInfoHelper(); if (languagepicker.SelectedItem != null) { language = languagepicker.SelectedItem.ToString(); } if(_currentTopic==null) { int status = 0; Settings.ZipCode = "95131"; if (switchButton.IsToggled) status = 1; SetCurrentZipCode(); tih.ListMyTopic(_typeproblem.TagID, Settings.ZipCode, language, des.Text,status); _currentTopic = new TopicInfo { TagID = _typeproblem.TagID, Zipcode = "95131", Language = language, Description = des.Text, Status = status }; } else { SetCurrentZipCode(); int status = 0; if (switchButton.IsToggled) status = 1; tih.UpdateMyTopic(Settings.ZipCode, language, des.Text, _currentTopic.TopicID, status); } Navigation.PushModalAsync(new NavigationPage(new PickHelperPage(_currentTopic))); }
//下一步按钮 Next Button async void Handle_Next(object sender, EventArgs e) { IsLoading = true; await Task.Delay(500); string language = "English"; var tih = new TopicInfoHelper(); if (languagepicker.SelectedItem != null) { language = languagepicker.SelectedItem.ToString(); } if (des.Text.IsNullOrEmpty()) { IsLoading = false; await DisplayAlert("No description", AppResources.DescribeDemand, "OK"); return; } if (tih.TopicExist(TagID)) { IsLoading = false; await DisplayAlert("Existting", AppResources.DesSecondCheckAlart, "OK"); return; } if (_currentTopic == null || pageused != 0) { int status = 0; //Settings.ZipCode = "95131"; if (switchButton.IsToggled) { status = 1; } if (Settings.CurrentLongitude > 0) { await DisplayAlert("Missing info", AppResources.GoogleFailed, "OK"); return; } if (DigitalBtn.IsToggled) { //SetCurrentZipCode(); tih.ListMyTopic(_typeproblem.TagID, Settings.ZipCode, language, des.Text, status); _currentTopic = new TopicInfo { TagID = _typeproblem.TagID, Zipcode = MyLocationName.Text, Language = language, Description = des.Text, Status = status }; pageused++; await Navigation.PushAsync(new PickHelperPage(_currentTopic)); } else { tih.ListMyTopic(_typeproblem.TagID, "00000", language, des.Text, status); _currentTopic = new TopicInfo { TagID = _typeproblem.TagID, Zipcode = "00000", Language = language, Description = des.Text, Status = status }; pageused++; await Navigation.PushAsync(new PickHelperPage(_currentTopic)); } } else { if (Settings.CurrentLongitude > 0) { await DisplayAlert("Missing info", AppResources.GoogleFailed, "OK"); return; } //SetCurrentZipCode(); int status = 0; if (switchButton.IsToggled) { status = 1; } if (DigitalBtn.IsToggled) { tih.UpdateMyTopic(Settings.ZipCode, language, des.Text, _currentTopic.TopicID, status); } else { tih.UpdateMyTopic("00000", language, des.Text, _currentTopic.TopicID, status); } await Navigation.PushAsync(new PickHelperPage(_currentTopic)); } }