private void button1_Click(object sender, EventArgs e) { if (alert != null) { switch (alert.提醒方式) { case 提醒方式.系统提示: bool f = AlertLogic.GetInstance().SetFlag(alert.ID, 1); if (!f) { MessageBox.Show("已阅置位失败!"); } else { this.Close(); } break; case 提醒方式.执行流程: DocObject doc = DocObjectLogic.GetInstance().GetDocObject(Convert.ToInt32(alert.备注)); if (doc != null) { TaskInfo task = TaskInfoLogic.GetInstance().GetTaskInfoByEntityId(doc.ID); if (task != null) { TaskStageLogic.GetInstance().SetReceiveToExec(task.Flow.Current.ID); } DocEditForm def = new DocEditForm(this.User, this.owner, doc.Form, doc, alert.ID); if (def.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.Close(); } } break; case 提醒方式.审批流程: DocObject doc2 = DocObjectLogic.GetInstance().GetDocObject(Convert.ToInt32(alert.备注)); if (doc2 != null) { TaskInfo task = TaskInfoLogic.GetInstance().GetTaskInfoByEntityId(doc2.ID); if (task != null) { TaskStageLogic.GetInstance().SetReceiveToExec(task.Flow.Current.ID); } DocEditForm def = new DocEditForm(this.User, this.owner, doc2.Form, doc2, alert.ID); if (def.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.Close(); } } break; default: break; } } }
private void EditDoc() { DocObject doc = listBox1.SelectedItem as DocObject; if (doc != null) { DocEditForm def = new DocEditForm(this.User, this.owner, doc.Form, doc); def.ShowDialog(); LoadAllDocs(null); } else { MessageBox.Show("请先选定要修改的文档!"); } }
private DialogResult Next() { if (listBox1.SelectedIndex > -1) { FormObject form = listBox1.SelectedItem as FormObject; if (form != null) { this.owner.RefreshMsg("正在打开表单模板中,请稍候..."); DocEditForm def = new DocEditForm(this.User, this.owner, form); this.owner.RefreshMsg("Ready..."); return(def.ShowDialog()); } else { MessageBox.Show("您选择的表单模板为空!"); } } else { MessageBox.Show("请先选择一个表单模板!"); } return(System.Windows.Forms.DialogResult.Cancel); }
public static bool NewDocument(User user, MainForm owner, FormObject form) { DocEditForm def = new DocEditForm(user, owner, form); return(def.ShowDialog() == DialogResult.OK); }