Exemplo n.º 1
0
 private void tsmi_PasteEqu_Click(object sender, EventArgs e)
 {
     if (CopyMReporttemp != null && this.tree_Template.SelectedNode != null)
     {
         MReportTempDict        copyTem = (MReportTempDict)BReportTemp.GetModel(CopyMReporttemp.NODE_ID.ToString());
         List <MReportTempDict> AddTem  = new List <MReportTempDict>();
         if (MReporttemp.NODE_PARENT_ID != 0)
         {
             MReportTempDict temP = (MReportTempDict)BReportTemp.GetModel(MReporttemp.NODE_PARENT_ID.ToString());
             PasteNode(copyTem, temP.NODE_ID, temP.IS_PRIVATE, temP.DOCTOR_ID, tree_Template.SelectedNode, false, ref AddTem);
         }
         else
         {
             PasteNode(copyTem, 0, 0, "", null, false, ref AddTem);
         }
         BReportTemp.AddMore(AddTem.ToArray());
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 插入一条报告模板字典
        /// </summary>
        /// <param name="ireportTempDict"></param>
        /// <returns></returns>
        public override int Add(IModel ireportTempDict)
        {
            MReportTempDict reportTempDict = (MReportTempDict)ireportTempDict;
            Hashtable       ht             = new Hashtable();

            ht.Add("NODE_ID", reportTempDict.NODE_ID);
            ht.Add("NODE_PARENT_ID", reportTempDict.NODE_PARENT_ID);
            ht.Add("NODE_NAME", reportTempDict.NODE_NAME);
            ht.Add("NODE_DEPICT", reportTempDict.NODE_DEPICT);
            ht.Add("NODE_SIGN", reportTempDict.NODE_SIGN);
            ht.Add("EXAM_CLASS", reportTempDict.EXAM_CLASS);
            ht.Add("INPUT_CODE", reportTempDict.INPUT_CODE);
            ht.Add("DOCTOR_ID", reportTempDict.DOCTOR_ID);
            ht.Add("IS_PRIVATE", reportTempDict.IS_PRIVATE);
            ht.Add("SORT_FLAG", reportTempDict.SORT_FLAG);
            ht.Add("ICD10_CODE", reportTempDict.ICD10_CODE);
            return(ExecuteSql(StringConstructor.InsertSql(TableName, ht).ToString()));
        }
Exemplo n.º 3
0
        private MReportTempDict NewRptTempDict()
        {
            string          NewNodeID = ID.GetSeqValue().ToString();
            MReportTempDict temp      = new MReportTempDict();

            temp.NODE_ID = Convert.ToInt32(NewNodeID);
            if (MReporttemp.IS_PRIVATE == null)
            {
                temp.IS_PRIVATE = 0;
            }
            else
            {
                temp.IS_PRIVATE = MReporttemp.IS_PRIVATE;
            }
            temp.SORT_FLAG   = 0;
            temp.EXAM_CLASS  = GetConfig.RS_TempExamClass;
            temp.ICD10_CODE  = "";
            temp.INPUT_CODE  = "";
            temp.NODE_DEPICT = "";
            return(temp);
        }
Exemplo n.º 4
0
        private void cmb_Part_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.isInit || this.cmb_Part.SelectedItem == null)
            {
                return;
            }
            this.tree_Template.Nodes.Clear();
            NewMReporttemp  = null;
            CopyMReporttemp = null;
            GetTreeNode gettreenode = new GetTreeNode(addTreeNode);

            System.Data.DataRow cmbdr = (cmb_Part.SelectedItem as System.Data.DataRowView).Row;
            DataRow[]           dr;
            if (cmbdr["NODE_ID"].ToString() == "")
            {
                dr = rootDs.Tables[0].Select("NODE_PARENT_ID = 0 ");
            }
            else
            {
                dr = rootDs.Tables[0].Select("NODE_PARENT_ID = " + cmbdr["NODE_ID"].ToString());
            }
            DataSet dsRoot = new DataSet();

            dsRoot.Merge(dr);
            List <TreeNode> RootTree = new List <TreeNode>();

            if (dsRoot.Tables.Count > 0)
            {
                for (int i = 0; i < dsRoot.Tables[0].Rows.Count; i++)
                {
                    RootTree.Add(new TreeNode(dsRoot.Tables[0].Rows[i]["NODE_NAME"].ToString().Trim()));
                    RootTree[i].Name = dsRoot.Tables[0].Rows[i]["NODE_ID"].ToString().Trim();
                    this.searchNode(dsRoot.Tables[0].Rows[i]["NODE_ID"].ToString().Trim(), RootTree[i]);
                }
            }
            this.tree_Template.BeginInvoke(gettreenode, new object[] { RootTree.ToArray(), false });
        }
Exemplo n.º 5
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            if (Now_Modify_NodeID == "")
            {
                return;
            }

            if (ChgNull())
            {
                return;
            }

            MReportTempDict MRptTemp = new MReportTempDict();

            MRptTemp.NODE_ID = Convert.ToInt32(Now_Modify_NodeID);

            if (txt_SORT_FLAG.Text.Trim() != "")
            {
                if (!ExpressionValidat.IsNumeric(txt_SORT_FLAG.Text.Trim()))
                {
                    MessageBoxEx.Show("请输入数字!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                MRptTemp.SORT_FLAG = Convert.ToInt32(txt_SORT_FLAG.Text.Trim());
            }

            TreeNode[] tn = trv_ReportTempDict.Nodes.Find(Now_Modify_NodeID, true);
            if (tn[0].Level == 0)
            {
                MRptTemp.NODE_PARENT_ID = 0;
            }
            else
            {
                MRptTemp.NODE_PARENT_ID = Convert.ToInt32(tn[0].Parent.Name);
            }

            MRptTemp.NODE_NAME   = txt_NODE_NAME.Text.Trim();
            MRptTemp.NODE_DEPICT = txt_NODE_DEPICT.Text.Trim();
            MRptTemp.NODE_SIGN   = cmb_NODE_SIGN.SelectedValue.ToString();
            MRptTemp.INPUT_CODE  = txt_INPUT_CODE.Text.ToString().Trim();
            MUser user = (MUser)frmMainForm.iUser;

            MRptTemp.DOCTOR_ID  = user.DOCTOR_ID;
            MRptTemp.EXAM_CLASS = GetConfig.RS_TempExamClass;
            MRptTemp.ICD10_CODE = txt_Icdcode.Text.Trim();

            if (cmb_IS_PRIVATE.Text.Trim() == "公共")
            {
                MRptTemp.IS_PRIVATE = 0;
            }
            else if (cmb_IS_PRIVATE.Text.Trim() == "私有")
            {
                MRptTemp.IS_PRIVATE = 1;
            }

            bool bl = BReportTpDct.Exists(MRptTemp);

            if (bl)
            {
                int i = BReportTpDct.Update(MRptTemp, " where  NODE_ID=" + MRptTemp.NODE_ID);
                if (i >= 0)
                {
                    tn[0].Text = txt_NODE_NAME.Text;
                    MessageBoxEx.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    btn_Clean_Click(null, null);
                    Now_Add_NodeID    = "";
                    Now_Modify_NodeID = "";
                }
                else
                {
                    MessageBoxEx.Show("修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                int i = BReportTpDct.Add(MRptTemp);

                if (i > 0)
                {
                    tn[0].Text = txt_NODE_NAME.Text;
                    MessageBoxEx.Show("添加成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    btn_Clean_Click(null, null);
                    Now_Add_NodeID    = "";
                    Now_Modify_NodeID = "";
                }
                else
                {
                    MessageBoxEx.Show("添加失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 保存报告模板
        /// </summary>
        private void btn_Save_Click(object sender, EventArgs e)
        {
            bool isNeedUpdate = false;

            if (txt_NodeName.Text.Contains("新增") && NodeSignExist(MReporttemp.NODE_SIGN))
            {
                MReporttemp.NODE_NAME = txt_NodeName.Text.Replace("新增", "");
            }
            else
            {
                MReporttemp.NODE_NAME = txt_NodeName.Text.Trim();
            }
            if (MReporttemp.IS_PRIVATE == 0 && cmb_IsPrivate.SelectedIndex == 1 || MReporttemp.IS_PRIVATE == 1 && cmb_IsPrivate.SelectedIndex == 0)
            {
                isNeedUpdate = true;
            }
            MReporttemp.IS_PRIVATE = cmb_IsPrivate.SelectedIndex;
            if (cmb_IsPrivate.SelectedIndex == 1)
            {
                MReporttemp.DOCTOR_ID = ((MUser)frmMainForm.iUser).DOCTOR_ID;
            }
            else
            {
                MReporttemp.DOCTOR_ID = "";
            }
            MReporttemp.ICD10_CODE = txt_Icdcode.Text.Trim();
            MReporttemp.INPUT_CODE = txt_InputCode.Text.Trim();
            if (txt_SortFlag.Text.Trim() != "")
            {
                MReporttemp.SORT_FLAG = Convert.ToInt32(txt_SortFlag.Text);
            }
            int i = 0;

            if (eRTBoxs != null)
            {
                MReporttemp.NODE_DEPICT = "";
                for (i = 0; i < eRTBoxs.Length; i++)
                {
                    if (this.eRTBoxs[i].richTextBox.Text.Trim() != "")
                    {
                        MReporttemp.NODE_DEPICT += eRTBoxs[i].richTextBox.Text.Trim() + "&";
                    }
                }
                MReporttemp.NODE_DEPICT = MReporttemp.NODE_DEPICT.TrimEnd('&');
            }
            i = -1;
            if (BReportTemp.Exists(MReporttemp))
            {
                i = BReportTemp.Update(MReporttemp, " where NODE_ID =" + MReporttemp.NODE_ID);
            }
            else
            {
                i = BReportTemp.Add(MReporttemp);
            }
            if (i < 0)
            {
                MessageBoxEx.Show("保存失败!", "警告");
            }
            else
            {
                if (isNeedUpdate)
                {
                    UpdateNode(MReporttemp, MReporttemp.IS_PRIVATE, MReporttemp.DOCTOR_ID);
                }
                this.tree_Template.SelectedNode.Text = MReporttemp.NODE_NAME;
                if (NewMReporttemp != null && this.tree_Template.SelectedNode.Name == NewMReporttemp.NODE_ID.ToString())
                {
                    NewMReporttemp = null;
                }
            }
        }