private void m_cmdGetDescription_Click(object sender, System.EventArgs e) { Form frmMDI = clsEMRLogin.s_FrmMDI; Form[] frmRunningFormArr = frmMDI.MdiChildren; this.m_lstForms.Items.Clear(); this.m_lstControls.Items.Clear(); clsGetAllRuningFormsServ m_objServ = (clsGetAllRuningFormsServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsGetAllRuningFormsServ)); for (int i = 0; i < frmRunningFormArr.Length; i++) { if (frmRunningFormArr[i].Name != "Form_HRPExplorer" && frmRunningFormArr[i].Name != "frmGetAllRuningForms") { this.m_lstForms.Items.Add(frmRunningFormArr[i].Name + "," + frmRunningFormArr[i].AccessibleDescription); m_objServ.m_lngDel_IMR_Type_Item(frmRunningFormArr[i].Name); foreach (Control ctlChild in frmRunningFormArr[i].Controls) { if (ctlChild.Name == "m_pnlContent") { m_mthSetDescription(frmRunningFormArr[i].Name, ctlChild); } } } } }
private void m_cmdSaveType_Click(object sender, EventArgs e) { if (m_txtTypeID.Text.Trim() == "") { MessageBox.Show("请输入表单类型"); m_txtTypeID.Focus(); return; } if (m_txtFormName.Text.Trim() == "") { MessageBox.Show("描述"); m_txtFormName.Focus(); return; } clsInpatMedRec_Type objType = new clsInpatMedRec_Type(); objType.m_strTypeID = m_txtTypeID.Text.Trim(); objType.m_strTypeName = m_txtFormName.Text.Trim(); clsGetAllRuningFormsServ objServ = (clsGetAllRuningFormsServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsGetAllRuningFormsServ)); if (m_txtTypeID.Tag == null) { objServ.m_lngAddInpatMedRecType(objType); } else { objServ.m_lngModifyInpatMedRecType(((clsInpatMedRec_Type)m_txtTypeID.Tag).m_strTypeID, objType); } m_mthGetAllType(objType); }
/// <summary> /// 递归获取所有控件描述,新专科病历用 /// </summary> /// <param name="p_strTypeID">住院病历窗体名</param> /// <param name="p_ctlContent">父控件</param> private void m_mthSetDescription(string p_strTypeID, Control p_ctlContent) { if (p_ctlContent == null || p_ctlContent.HasChildren == false) { return; } long lngRef = 0; clsGetAllRuningFormsServ m_objServ = (clsGetAllRuningFormsServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsGetAllRuningFormsServ)); foreach (Control ctlChild in p_ctlContent.Controls) { switch (ctlChild.GetType().Name) { case "DateTimePicker": case "TextBox": case "RichTextBox": case "ctlRichTextBox": case "ctlComboBox": case "ComboBox": case "RadioButton": case "ctlTimePicker": case "ctlBorderTextBox": case "CheckBox": lngRef = m_objServ.m_lngSaveIMR_Type_Item(p_strTypeID, ctlChild.Name, ctlChild.AccessibleDescription, ctlChild.GetType().Name, ctlChild.TabIndex.ToString()); if (lngRef > 0) { this.m_lstControls.Items.Add(p_strTypeID + "." + ctlChild.Name + "," + ctlChild.AccessibleDescription); } else { this.m_lstControls.Items.Add("ERROR: " + p_strTypeID + "." + ctlChild.Name + "," + ctlChild.AccessibleDescription); } break; case "GroupBox": m_mthSetDescription(p_strTypeID, ctlChild); break; case "Panel": m_mthSetDescription(p_strTypeID, ctlChild); break; case "TabControl": m_mthSetDescription(p_strTypeID, ctlChild); break; case "TabPage": m_mthSetDescription(p_strTypeID, ctlChild); break; default: break; } } }
private void m_lstForm_SelectedIndexChanged(object sender, EventArgs e) { m_blnCanDo = false; m_mthSaveTypeDept(); int[] intIndex = new int[m_lstDept.CheckedIndices.Count]; m_lstDept.CheckedIndices.CopyTo(intIndex, 0); for (int index = 0; index < intIndex.Length; index++) { m_lstDept.SetItemChecked(intIndex[index], false); } clsInpatMedRec_Type objType = m_lstForm.SelectedItem as clsInpatMedRec_Type; m_txtTypeID.Tag = objType; m_objSelectType = objType; m_objSelectDepts = new clsEmrDept_VO [0]; if (objType != null) { string[] strDepts = null; string[] strAreas = null; clsGetAllRuningFormsServ objServ = (clsGetAllRuningFormsServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsGetAllRuningFormsServ)); objServ.m_lngGetInpatMedRecDept(objType.m_strTypeID, out strDepts, out strAreas); if (strDepts != null && strDepts.Length > 0 && m_lstDept.Items.Count > 0) { List <clsEmrDept_VO> arrDepts = new List <clsEmrDept_VO>(5); for (int i = 0; i < strDepts.Length; i++) { for (int j = 0; j < m_lstDept.Items.Count; j++) { clsEmrDept_VO objDept = m_lstDept.Items[j] as clsEmrDept_VO; if (strDepts[i].Trim() == objDept.m_strDEPTID_CHR.Trim()) { m_lstDept.SetItemChecked(j, true); arrDepts.Add(objDept); break; } } } m_objSelectDepts = new clsEmrDept_VO[arrDepts.Count]; m_objSelectDepts = arrDepts.ToArray(); } m_txtTypeID.Text = objType.m_strTypeID; m_txtFormName.Text = objType.m_strTypeName; m_cmdNew.Enabled = true; m_cmdSaveType.Enabled = true; m_cmdDelete.Enabled = true; } m_blnCanDo = true; }
public void m_mthSaveTypeDept() { if (m_blnIsChange && m_objSelectType != null) { string[] strDepts = new string[m_lstDept.CheckedItems.Count]; for (int index = 0; index < m_lstDept.CheckedItems.Count; index++) { strDepts[index] = ((clsEmrDept_VO)m_lstDept.CheckedItems[index]).m_strDEPTID_CHR.Trim(); } clsGetAllRuningFormsServ objServ = (clsGetAllRuningFormsServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsGetAllRuningFormsServ)); objServ.m_lngAddInpatMedRecDept(m_objSelectType.m_strTypeID, strDepts, strDepts); m_blnIsChange = false; } }
private void m_cmdDelete_Click(object sender, EventArgs e) { if (m_txtTypeID.Tag != null) { clsGetAllRuningFormsServ objServ = (clsGetAllRuningFormsServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsGetAllRuningFormsServ)); try { objServ.m_lngDeleteInpatMedRecType((clsInpatMedRec_Type)m_txtTypeID.Tag); } catch { MessageBox.Show("此病历表单已写有记录,不能删除!"); } } m_txtTypeID.Text = ""; m_txtTypeID.Tag = null; m_txtFormName.Text = ""; m_mthGetAllType(null); }
private void m_cmdGetAllForm_Click(object sender, System.EventArgs e) { Form frmMDI = clsEMRLogin.s_FrmMDI; clsGetAllRuningFormsServ m_objServ = (clsGetAllRuningFormsServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsGetAllRuningFormsServ)); Form[] frmRunningFormArr = frmMDI.MdiChildren; this.m_lstForms.Items.Clear(); this.m_lstControls.Items.Clear(); for (int i = 0; i < frmRunningFormArr.Length; i++) { this.m_lstForms.Items.Add(frmRunningFormArr[i].Name + "," + frmRunningFormArr[i].AccessibleDescription); m_objServ.m_lngDelGUI_Info_Detail(frmRunningFormArr[i].Name); m_objServ.m_lngSaveGUI_Info(frmRunningFormArr[i].Name, frmRunningFormArr[i].AccessibleDescription); foreach (Control ctlChild in frmRunningFormArr[i].Controls) { m_mthOldSetDescription(frmRunningFormArr[i].Name, ctlChild); } } }
private void m_mthOldSaveDescription(string p_strFormName, Control p_ctlContent) { string strCtlName = p_ctlContent.GetType().Name; long lngRef = 0; if (!p_ctlContent.HasChildren || strCtlName == "ctlComboBox") { clsGetAllRuningFormsServ m_objServ = (clsGetAllRuningFormsServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsGetAllRuningFormsServ)); switch (strCtlName) { case "TextBox": case "RichTextBox": case "ctlComboBox": case "ctlRichTextBox": lngRef = m_objServ.m_lngSaveGUI_Info_Detail(p_strFormName, p_ctlContent.AccessibleDescription, p_ctlContent.Name, p_ctlContent.TabIndex.ToString()); if (lngRef > 0) { this.m_lstControls.Items.Add(p_strFormName + "." + p_ctlContent.Name); } else { this.m_lstControls.Items.Add("ERROR: " + p_strFormName + "." + p_ctlContent.Name); } break; } } else { foreach (Control ctlChild in p_ctlContent.Controls) { m_mthOldSetDescription(p_strFormName, ctlChild); } } }
private void m_mthGetAllType(clsInpatMedRec_Type p_objType) { clsGetAllRuningFormsServ objServ = (clsGetAllRuningFormsServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsGetAllRuningFormsServ)); clsInpatMedRec_Type[] objTypes = null; objServ.m_lngGetAllInpatMedRec(out objTypes); if (objTypes != null && objTypes.Length > 0) { m_lstForm.Items.Clear(); m_lstForm.Items.AddRange(objTypes); } if (p_objType != null) { for (int i = 0; i < m_lstForm.Items.Count; i++) { if (((clsInpatMedRec_Type)m_lstForm.Items[i]).m_strTypeID.Trim() == p_objType.m_strTypeID.Trim()) { m_lstForm.SetSelected(i, true); break; } } } }