public async void AddCheckList() { Value = true; var connection = await apiService.CheckConnection(); if (!connection.IsSuccess) { await Application.Current.MainPage.DisplayAlert( Languages.Warning, Languages.CheckConnection, Languages.Ok); return; } if (string.IsNullOrEmpty(Description) || string.IsNullOrEmpty(Code)) { Value = true; return; } var checkList = new AddCheckList { chlsCodi = Code, chlsDesc = Description, chlsTipoCodi = Branch, chlsTopoCodi = Icdo, chlsAtti = Active, chlsMnem = Mnemonic }; var cookie = Settings.Cookie; //.Split(11, 33) var res = cookie.Substring(11, 32); var response = await apiService.Save <AddCheckList>( "https://portalesp.smart-path.it", "/Portalesp", "/diagnosis/save", res, checkList); Debug.WriteLine("********responseIn ViewModel*************"); Debug.WriteLine(response); if (!response.IsSuccess) { await Application.Current.MainPage.DisplayAlert("Error", response.Message, "ok"); return; } Value = false; MessagingCenter.Send((App)Application.Current, "OnSaved"); DependencyService.Get <INotification>().CreateNotification("PortalSP", "CheckList Added"); await App.Current.MainPage.Navigation.PopPopupAsync(true); }
// 添加待检标签 private void btn_AddCheckList_Click(object sender, EventArgs e) { AddCheckList addDialog = new AddCheckList(0, this); if (addDialog.ShowDialog() == DialogResult.OK) { if (!String.IsNullOrEmpty(TempAddListValue)) { foreach (var item in list_CheckList) { if (item.Equals(TempAddListValue)) { return; } } list_CheckList.Add(TempAddListValue.ToUpper()); FlushCheckList(); } } }