public override void Init() { List <VDepartment> list = new List <VDepartment>(); string url = ApiRouting.GetUrl("", "", "department", ApiFunction.GetAll).ToString(); bool status = url.Get <VDepartment>(ref list); dataGridMain.DataSource = list; MessageBox.Confirm(status, "department", dataGridMain); }
public override void Init() { List <VStaff> listStaff = new List <VStaff>(); bool confirm = ApiRouting.GetUrl("", "", "staff", ApiFunction.GetAll).ToString().Get <VStaff>(ref listStaff); if (confirm) { dataGridMain.DataSource = listStaff; MessageBox.Confirm(confirm, "staff", dataGridMain); } }
public async Task DeleteEventAsync() { if (ViewModel.SelectedEvent != null) { int result = await MessageBox.Confirm("Click \"Delete Event\" to procees, or CANCEL to abort", "Warning: You are about to DELETE the selected event!"); if (result == 0) { await ViewModel.EventCatalogSingleton.Remove(ViewModel.SelectedEvent); } } else { MessageBox.Show("", "No items selected"); } }
protected override void OnExecute(object parameter) { if (!(parameter is CodeExplorerComponentViewModel node) || node.Declaration == null || node.Declaration.QualifiedName.QualifiedModuleName.ComponentType == ComponentType.Document) { return; } var qualifiedModuleName = node.Declaration.QualifiedName.QualifiedModuleName; var message = string.Format(CodeExplorerUI.ExportBeforeRemove_Prompt, node.Name); switch (MessageBox.Confirm(message, CodeExplorerUI.ExportBeforeRemove_Caption, ConfirmationOutcome.Yes)) { case ConfirmationOutcome.Yes: if (!PromptFileNameAndExport(qualifiedModuleName)) { return; } break; case ConfirmationOutcome.No: break; case ConfirmationOutcome.Cancel: return; } // No file export or file successfully exported--now remove it var components = ProjectsProvider.ComponentsCollection(qualifiedModuleName.ProjectId); try { components?.Remove(ProjectsProvider.Component(qualifiedModuleName)); } catch (Exception ex) { MessageBox.NotifyWarn(ex.Message, string.Format(CodeExplorerUI.RemoveError_Caption, qualifiedModuleName.ComponentName)); } }
private void Save(string windowname) { if (windowname != "") { try { Java.IO.File path = new Java.IO.File(App._dir, windowname); if (!path.Exists()) { path.Mkdirs(); } else { MessageBox.Confirm(this, "警告", "该文件夹已存在,是否覆盖?", delegate { path.Mkdirs(); }, delegate { }); } SavePics(path.ToString()); SaveResult.SaveGeologicalData(path.ToString()); SaveResult.SaveGeometricalData(path.ToString()); SaveResult.SaveStatisticalResult(path.ToString()); MessageBox.Show(this, "成功", "保存成功"); } catch { MessageBox.Show(this, "失败", "保存失败"); } } else { MessageBox.Show(this, "注意", "测窗名称不能为空!"); } }
/// <summary> /// 确认消息 /// </summary> protected async Task <bool> Confirm(string message, string title = null, CancellationToken?cancelToken = null) { return(await MessageBox.Confirm(message, title, cancelToken)); }
protected void btnConfirmServer_Click(object sender, EventArgs e) { MessageBox.Confirm(this, "确认删除吗?", "alert('已删除!');"); }