private void  除模板ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("你确实要删除此病历模板吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
     {
         EMR.Controls.Entity.EmrTemplateTree clg = treeT.SelectedNode.Tag as EMR.Controls.Entity.EmrTemplateTree;
         controller.DeleteEmrTemplateTree(clg.ID, clg.EmrDataId, clg.DeptCode, clg.LevelCode);
     }
 }
 private void treeT_DoubleClick(object sender, EventArgs e)
 {
     if (treeT.SelectedNode != null && treeT.SelectedNode.Tag is EMR.Controls.Entity.EmrTemplateTree)
     {
         EMR.Controls.Entity.EmrTemplateTree clg = treeT.SelectedNode.Tag as EMR.Controls.Entity.EmrTemplateTree;
         controller.GetEmrTemplateTree(clg);
     }
 }
        private void 修改模板ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EMR.Controls.Entity.EmrTemplateTree clg = treeT.SelectedNode.Tag as EMR.Controls.Entity.EmrTemplateTree;
            string title = clg.TemplateText;

            if (DialogTitle.Show("修改模板名称", ref title) == DialogResult.OK)
            {
                selectRecordId   = clg.ID;
                clg.TemplateText = title;
                controller.SaveEmrTemplateTree(clg);
            }
        }
        private void 新增模板ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string title = "";

            if (DialogTitle.Show("输入模板名称", ref title) == DialogResult.OK)
            {
                EmrCatalogue clg = treeT.SelectedNode.Tag as EmrCatalogue;

                EMR.Controls.Entity.EmrTemplateTree template = new EMR.Controls.Entity.EmrTemplateTree();
                template.CatalogueCode = clg.NodeCode;
                template.DeptCode      = cbDept.SelectedValue.ToString();
                template.DeptName      = cbDept.SelectedText;
                template.UserCode      = controller.emrView.CurrBindKeyData.DoctorCode;
                template.UserName      = controller.emrView.CurrBindKeyData.DoctorName;
                template.LevelCode     = ckh.Checked ? (int)ckh.Tag : (ckd.Checked ? (int)ckd.Tag : (int)ckp.Tag);
                template.TemplateText  = title;

                controller.SaveEmrTemplateTree(template);
                selectRecordId = template.ID;
            }
        }