Ejemplo n.º 1
0
        /// <summary>
        /// 选择的病人
        /// </summary>
//		private clsPatient m_objCurrentPatient;

        public frmTextTemplate()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            m_objTextTemplate = new clsTextTemplate();

            m_cmdChange.Enabled   = false;
            m_cmdHaltTemp.Enabled = false;
            //m_objServ = new CustomFromService.clsMinElementColServ();
        }
Ejemplo n.º 2
0
        private void btChange_Click(object sender, System.EventArgs e)
        {
            if (this.m_cmdChange.Tag == null)
            {
                return;
            }
            clsTemplateInfo     obj    = (clsTemplateInfo)this.m_cmdChange.Tag;
            frmCustomFormDesign objfrm = new frmCustomFormDesign();

            objfrm.m_mthConfigXmlToGUI(obj.m_strTEMPLATE_XML);
            if (objfrm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            try
            {
                CustomFromService.clsMinElementColServ m_objServ =
                    (CustomFromService.clsMinElementColServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(CustomFromService.clsMinElementColServ));

                obj.m_strTEMPLATE_XML = objfrm.m_StrGUIXml;
                //			objfrm.Close();
                if (MessageBox.Show("是否要更改模板名称?", "iCare", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    using (frmInputName frminput = new frmInputName())
                    {
                        if (frminput.ShowDialog() == DialogResult.OK)
                        {
                            obj.m_strTEMPLATE_NAME = frminput.strName;
                        }
                    }
                }
                long lngRes = m_objServ.m_lngUpdateTemplate(obj);
                if (lngRes <= 0)
                {
                    return;
                }
                clsTextTemplate objTextTemplate = new clsTextTemplate();
                objTextTemplate.m_strGUI_ID = obj.m_strTEMPLATE_ID;
                //保存模板控件描述
                if (objfrm.m_ObjTmpCtlDescArr != null)
                {
                    objTextTemplate.m_objTmpCtlValueArr = objfrm.m_ObjTmpCtlDescArr;
                    m_objServ.m_lngSaveTemplateDesc(objTextTemplate);
                }
                this.m_cmdChange.Tag = obj;
                treeView1.BeginUpdate();
                //修改树结点名称,重新load出模板
                foreach (TreeNode node in treeView1.Nodes[0].Nodes)
                {
                    if (((clsTemplateInfo)node.Tag).m_strTEMPLATE_ID == obj.m_strTEMPLATE_ID)
                    {
                        node.Text = obj.m_strTEMPLATE_NAME;
                        treeView1.SelectedNode = node;
                        break;
                    }
                }
                this.m_pnlControl.Tag = "";
                treeView1_DoubleClick(null, null);
                treeView1.EndUpdate();
            }
            catch
            {}
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 3
0
        private void btNew_Click(object sender, System.EventArgs e)
        {
            frmCustomFormDesign objfrm = new frmCustomFormDesign();

            if (objfrm.ShowDialog() != DialogResult.OK)         //设计模板
            {
                return;
            }
            frmInputName frminput = new frmInputName();

            frminput.TopMost       = true;
            frminput.StartPosition = FormStartPosition.CenterScreen;
            if (frminput.ShowDialog() != DialogResult.OK)         //名称
            {
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            clsTextTemplate objTextTemplate = new clsTextTemplate();

            try
            {
                CustomFromService.clsMinElementColServ m_objServ =
                    (CustomFromService.clsMinElementColServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(CustomFromService.clsMinElementColServ));

                clsTemplateInfo obj = new clsTemplateInfo();
                obj.m_strTEMPLATE_NAME = frminput.strName;
                obj.m_strTEMPLATE_XML  = objfrm.m_StrGUIXml;
                frminput.Close();
                //			objfrm.Close();
                string strID;
                //保存模板
                long lngRes = m_objServ.m_lngSaveTemplate(obj, out strID);
                if (lngRes <= 0 || strID == "")
                {
                    return;
                }

                objTextTemplate.m_strGUI_ID    = strID;
                objTextTemplate.m_strDoctor_ID = MDIParent.strOperatorID;
                //保存主表‘min_element_apply’
                if (m_strFormID != null && m_strControlID != null)
                {
                    objTextTemplate.m_strFORM_ID    = m_strFormID;
                    objTextTemplate.m_strCONTROL_ID = m_strControlID;
                    m_objServ.m_lngSaveApplyInfo(objTextTemplate);
                }
                //保存模板控件描述
                if (objfrm.m_ObjTmpCtlDescArr != null)
                {
                    objTextTemplate.m_objTmpCtlValueArr = objfrm.m_ObjTmpCtlDescArr;
                    m_objServ.m_lngSaveTemplateDesc(objTextTemplate);
                }
                obj.m_strTEMPLATE_ID = strID;
                obj.m_strDoctor_ID   = MDIParent.strOperatorID;
                TreeNode tn = new TreeNode(obj.m_strTEMPLATE_NAME);
                tn.ImageIndex         = 2;
                tn.SelectedImageIndex = 1;
                tn.Tag       = obj;
                tn.ForeColor = Color.Green;
                treeView1.Nodes[0].Nodes.Add(tn);
            }
            catch
            {}
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }