private void GetInfo() { try { neusoft.neuFC.Object.neuObject obj = null; try { if (lst.Visible) { obj = (neusoft.neuFC.Object.neuObject) this.alItems[lst.SelectedIndex]; } } catch {} try { if (poplst.Visible) { obj = (neusoft.neuFC.Object.neuObject) this.alItems[poplst.SelectedIndex]; } } catch {} this.Tag = obj.ID; this.CloseForm(); } catch {} }
/// <summary> /// 按出勤日期、科室查询排班信息 /// </summary> /// <param name="workDate"></param> /// <param name="dept"></param> /// <returns></returns> public ArrayList Query(DateTime workDate, neusoft.neuFC.Object.neuObject dept) { string sql = ""; if (this.Sql.GetSql("Registration.Tabulation.Query.2", ref sql) == -1) { return(null); } try { sql = string.Format(sql, workDate.ToString(), dept.ID); if (QueryTabular(sql) == -1) { return(null); } } catch (Exception e) { this.Err = "获取科室排班信息出错![Registration.Tabulation.Query.2]" + e.Message; this.ErrCode = e.Message; if (Reader != null && Reader.IsClosed == false) { Reader.Close(); } return(null); } return(al); }
/// <summary> /// 向数组中添加包含两项的Item /// </summary> /// <param name="excSql">执行的SQL语句</param> /// <returns></returns> private ArrayList addItem2(string excSql) { ArrayList al = new ArrayList(); if (this.ExecQuery(excSql) == -1) { return(null); } try { while (this.Reader.Read()) { neusoft.neuFC.Object.neuObject obj = new neusoft.neuFC.Object.neuObject(); obj.ID = this.Reader[0].ToString(); //ID obj.Name = this.Reader[1].ToString(); //Name al.Add(obj); obj = null; } this.Reader.Close(); return(al); } catch (Exception ex) { this.Err = "添加项目出错" + ex.Message; this.ErrCode = "-1"; this.WriteErr(); if (this.Reader.IsClosed == false) { this.Reader.Close(); } al = null; return(al); } }
/// <summary> /// 根据传入参数,修改指定的节点信息 /// </summary> /// <param name="branch">父级节点索引</param> /// <param name="nodeIndex">被修改节点索引</param> /// <param name="neuObj">节点Text信息</param> /// <param name="obj">节点Tag属性</param> public void ModifiyNode(int branch, int nodeIndex, neusoft.neuFC.Object.neuObject nodeTextInfo, object nodeTag) { try { System.Windows.Forms.TreeNode node = this.Nodes[branch].Nodes[nodeIndex]; //生成节点信息 this.CreateNodeInfo(nodeTextInfo, nodeTag, ref node); } catch {} }
private int obj_SelectItem(Keys key) { neusoft.neuFC.Object.neuObject obj = this.GetItemFormList(); if (obj != null) { if (this.SelectItem != null) { this.SelectItem(obj, System.EventArgs.Empty); } } return(0); }
private void ComboBox_Leave(object sender, EventArgs e) { if (base.Text == "") { return; } try { for (int i = 0; i < alItems.Count; i++) { neusoft.neuFC.Object.neuObject o = (neusoft.neuFC.Object.neuObject)alItems[i]; try { if (o.Name.ToUpper().Trim() == base.Text.ToUpper().Trim()) { base.Text = o.Name; return; } } catch {} try { if (o.ID.ToUpper().Trim() == base.Text.ToUpper().Trim()) { base.Text = o.Name; return; } } catch {} try { if (o.Memo.ToUpper().Trim() == base.Text.ToUpper().Trim()) { base.Text = o.Name; return; } } catch {} } if (this.isItemOnly) { base.Text = ""; } } catch { if (this.isItemOnly) { base.Text = ""; } } }
public PowerUser() { // // TODO: 在此处添加构造函数逻辑 // Department = new neusoft.neuFC.Object.neuObject(); GrantDepartment = new neusoft.neuFC.Object.neuObject(); Department.ID = ""; Department.Name = ""; }
/// <summary> /// 根据传入的信息,增加一个新节点 /// </summary> /// <param name="branch">要增加节点的父级节点</param> /// <param name="neuObj">节点的Text信息</param> /// <param name="obj">节点的Tag属性</param> public void AddTreeNode(int branch, neusoft.neuFC.Object.neuObject nodeTextInfo, object nodeTag) { System.Windows.Forms.TreeNode node = new System.Windows.Forms.TreeNode(); //生产要添加的节点 this.CreateNodeInfo(nodeTextInfo, nodeTag, ref node); //指定当前选中的节点 try { this.SelectedNode = this.Nodes[branch]; } catch { this.Nodes.Add(new System.Windows.Forms.TreeNode("患者")); this.SelectedNode = this.Nodes[0]; } //在选中的节点上增加新节点 this.SelectedNode.Nodes.Add(node); }
/// <summary> /// 查询某日科室医生出诊情况 /// </summary> /// <param name="seatDate"></param> /// <param name="dept"></param> /// <param name="noonID"></param> /// <returns></returns> public ArrayList Query(DateTime seatDate, neusoft.neuFC.Object.neuObject dept, string noonID) { string sql = "", where = ""; if (this.Sql.GetSql("Registration.DoctSchema.Query.2", ref sql) == -1) { return(null); } if (this.Sql.GetSql("Registration.DoctSchema.Query.5", ref where) == -1) { return(null); } where = string.Format(where, seatDate.ToString(), dept.ID, noonID); sql = sql + " " + where; return(QuerySchema(sql)); }
//obj.id ,name,memo=bed,user01=dept,user02=status user03=sex private void AddInfo(int Branch, neusoft.neuFC.Object.neuObject neuObj, object obj) { string strText = neuObj.Name; string strMemo = ""; switch (this.myShowType.GetHashCode()) { case 1: //类型 strMemo = "【" + neuObj.Memo + "】"; break; case 3: //属性 if (neuObj.User01 != "" || neuObj.User01 != null) { strMemo = "【" + neuObj.User01 + "】"; } break; case 4: //类型+属性 strMemo = "【" + neuObj.User01 + "】" + "【" + neuObj.Memo + "】"; break; default: break; } try { if (strMemo.Trim() != "") { if (this.myDirection == enuShowDirection.Behind) { strText = strText + strMemo; } else { strText = strMemo + strText; } } } catch {} int ImageIndex = DeptImageIndex; this.AddTreeNode(Branch, strText, obj, ImageIndex); }
public int AddItems(ArrayList Items) { base.Items.Clear(); alItems = new ArrayList(); alItems = Items; neusoft.neuFC.Object.neuObject objItem; int i; try { for (i = 0; i < alItems.Count; i++) { objItem = new neusoft.neuFC.Object.neuObject(); objItem = (neusoft.neuFC.Object.neuObject)alItems[i]; if (this.bShowID) { base.Items.Add(objItem.ID); } else { base.Items.Add(objItem.Name); } } } catch { return(-1); } if (this.bShowCustomerList) { this.DrawMode = DrawMode.OwnerDrawFixed; this.MouseDown += new MouseEventHandler(ComboBox_MouseDown); } else { this.DrawMode = DrawMode.Normal; } return(0); }
/// <summary> /// 从下拉列表获取所选择项目 /// </summary> private neusoft.neuFC.Object.neuObject GetItemFormList() { neusoft.neuFC.Object.neuObject obj = new neusoft.neuFC.Object.neuObject(); string str = this.ActiveSheet.SheetName + this.ActiveSheet.ActiveColumnIndex.ToString(); int iIndex = this.GetListIndex(str); if (iIndex == -1 || iIndex >= this.Lists.Count) { return(null); } neusoft.neuFC.Interface.Controls.ListBox current = null; current = this.Lists[iIndex] as neusoft.neuFC.Interface.Controls.ListBox; if (current != null && current.Visible) { if (current.GetSelectedItem(out obj) == -1) { return(null); } current.Visible = false; return(obj); } return(null); }
protected void ComboBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == System.Windows.Forms.Keys.Enter) { if (base.Text == "") { return; } if (base.Text == " " || base.Text == " " || base.Text == " ") { ShowSelectDialog(); return; } try { for (int i = 0; i < alItems.Count; i++) { neusoft.neuFC.Object.neuObject o = (neusoft.neuFC.Object.neuObject)alItems[i]; try { if (o.Name.ToUpper().Trim() == base.Text.ToUpper().Trim()) { base.Text = o.Name; return; } } catch {} try { if (o.ID.ToUpper().Trim() == base.Text.ToUpper().Trim()) { base.Text = o.Name; return; } } catch {} try { if (o.Memo.ToUpper().Trim() == base.Text.ToUpper().Trim()) { base.Text = o.Name; return; } } catch {} try { neusoft.HISFC.Object.Base.ISpellCode Spell = o as neusoft.HISFC.Object.Base.ISpellCode; switch (iSpellCode) { case 0: if (Spell.Spell_Code.ToUpper().Trim() == base.Text.ToUpper().Trim()) { base.Text = o.Name; return; } break; case 1: if (Spell.WB_Code.ToUpper().Trim() == base.Text.ToUpper().Trim()) { base.Text = o.Name; return; } break; case 2: if (Spell.User_Code.ToUpper().Trim() == base.Text.ToUpper().Trim()) { base.Text = o.Name; return; } break; } } catch {} } if (this.isItemOnly) { base.Text = ""; } } catch { if (this.isItemOnly) { base.Text = ""; } } } else if (e.KeyCode == Keys.F2) { iSpellCode++; if (iSpellCode >= 3) { iSpellCode = 0; } QueryType = "拼音码"; switch (iSpellCode) { case 0: QueryType = "拼音码"; this.BackColor = Color.FromArgb(255, 255, 255); break; case 1: this.BackColor = Color.FromArgb(255, 200, 200); QueryType = "五笔码"; break; case 2: this.BackColor = Color.FromArgb(255, 150, 150); QueryType = "自定义码"; break; default: this.BackColor = Color.FromArgb(255, 255, 255); break; } } }
/// <summary> /// 根据传入参数,创建节点信息 /// </summary> /// <param name="neuObj">节点Text信息:obj.id ,name,memo=bed,user01=dept,user02=status user03=sex </param> /// <param name="obj">节点的Tag属性</param> /// <param name="node">返回参数:节点</param> private void CreateNodeInfo(neusoft.neuFC.Object.neuObject neuObj, object obj, ref System.Windows.Forms.TreeNode node) { //如果传入节点为空,则新建一个节点 if (node == null) { node = new System.Windows.Forms.TreeNode(); } #region 生成节点的Text string strText = neuObj.Name; //患者姓名 string strMemo = ""; switch (this.myShowType.GetHashCode()) { case 1: //住院号 strMemo = "【" + neuObj.ID + "】"; break; case 3: //科室 if (neuObj.User01 != "" || neuObj.User01 != null) { strMemo = "【" + neuObj.User01 + "】"; } break; case 5: //病床 if (neuObj.Memo != "" || neuObj.Memo != null) { strMemo = neuObj.Memo; if (strMemo.Length > 4) { strMemo = strMemo.Substring(4); } #region // int tempBedNo = 0; // try // { // tempBedNo = Convert.ToInt32(strMemo); // // strMemo = tempBedNo.ToString(); // } // catch(Exception e) // { // strMemo = "【"+neuObj.Memo+"】"; // break; // } #endregion strMemo = "【" + strMemo + "】"; } break; case 7: //状态 strMemo = "【" + neuObj.User02 + "】"; break; case 4: //科室+住院号 strMemo = "【" + neuObj.User01 + "】" + "【" + neuObj.ID + "】"; break; case 6: //病床+住院号 if (neuObj.Memo != "" || neuObj.Memo != null) { strMemo = "【" + neuObj.Memo.Substring(4) + "】" + "【" + neuObj.ID + "】"; } else { strMemo = "【" + neuObj.ID + "】"; } break; case 8: //住院号+状态 strMemo = "【" + neuObj.ID + "】" + "【" + neuObj.User02 + "】"; break; case 10: //科室+状态 strMemo = "【" + neuObj.User01 + "】" + "【" + neuObj.User02 + "】"; break; case 12: //病床+状态 if (neuObj.Memo != "" || neuObj.Memo != null) { strMemo = "【" + neuObj.Memo.Substring(4) + "】" + "【" + neuObj.User02 + "】"; } else { strMemo = "【" + neuObj.User02 + "】"; } break; default: strMemo = ""; break; } //根据显示位置,确定最终的名称 if (this.myDirection == enuShowDirection.Behind) { strText = strText + strMemo; } else { strText = strMemo + strText; } node.Text = strText; #endregion //生产节点的ImageIndex switch (neuObj.User03) { case "F": node.ImageIndex = this.FemaleImageIndex; break; case "M": node.ImageIndex = this.MaleImageIndex; break; default: node.ImageIndex = this.MaleImageIndex; break; } //生产节点的SelectedImageIndex node.SelectedImageIndex = node.ImageIndex + 1; //生产节点的Tag属性 node.Tag = obj; }
/// <summary> /// 刷新列表 /// </summary> private void RefreshList() { this.Nodes.Clear(); int Branch = 0; if (this.myPatients.Count == 0) { this.AddRootNode(); } for (int i = 0; i < this.myPatients.Count; i++) { System.Windows.Forms.TreeNode newNode = new System.Windows.Forms.TreeNode(); neusoft.neuFC.Object.neuObject obj = new neusoft.neuFC.Object.neuObject(); //类型为叶 if (this.myPatients[i].GetType().ToString() == "neusoft.HISFC.Object.RADT.PatientInfo") { try { neusoft.HISFC.Object.RADT.PatientInfo PatientInfo = (neusoft.HISFC.Object.RADT.PatientInfo) this.myPatients[i]; obj.ID = PatientInfo.Patient.PID.PatientNo; obj.Name = PatientInfo.Name; try { obj.Memo = PatientInfo.PVisit.PatientLocation.Bed.ID; } catch { //无病床信息 } obj.User01 = PatientInfo.PVisit.PatientLocation.Dept.Name; obj.User02 = PatientInfo.PVisit.In_State.Name; obj.User03 = PatientInfo.Patient.Sex.ID.ToString(); if (this.bIsShowNewPatient) { if (dtToday.Date == PatientInfo.PVisit.Date_In.Date) { obj.Name = obj.Name + "(新)"; } } this.AddTreeNode(Branch, obj, PatientInfo); } catch {} } else if (this.myPatients[i].GetType().ToString() == "neusoft.HISFC.Object.RADT.Patient") { neusoft.HISFC.Object.RADT.Patient PatientInfo = (neusoft.HISFC.Object.RADT.Patient) this.myPatients[i]; obj.ID = PatientInfo.PID.PatientNo; obj.Name = PatientInfo.Name; obj.Memo = ""; obj.User01 = ""; obj.User02 = ""; obj.User03 = PatientInfo.Sex.ID.ToString(); this.AddTreeNode(Branch, obj, PatientInfo); } else if (this.myPatients[i].GetType().ToString() == "neusoft.neuFC.Object.neuObject") { obj = (neusoft.neuFC.Object.neuObject) this.myPatients[i]; this.AddTreeNode(Branch, obj, obj); } else //为干 //分割字符串 text|tag 标识结点 { string all = this.myPatients[i].ToString(); string[] s = all.Split('|'); newNode.Text = s[0]; try { newNode.Tag = s[1]; } catch { newNode.Tag = ""; } try { newNode.ImageIndex = this.BranchImageIndex; newNode.SelectedImageIndex = this.BranchSelectedImageIndex; } catch {} Branch = this.Nodes.Add(newNode); } } if (this.bIsShowCount) { foreach (System.Windows.Forms.TreeNode node in this.Nodes) { if (node.Tag == null || node.Tag.GetType().ToString() == "System.String") //结点 { int count = 0; count = node.GetNodeCount(false); node.Text = node.Text + "(" + count.ToString() + ")"; } } } this.ExpandAll(); }
private void RefreshList() { this.Nodes.Clear(); int Branch = 0; for (int i = 0; i < this.myDepts.Count; i++) { System.Windows.Forms.TreeNode newNode = new System.Windows.Forms.TreeNode(); neusoft.neuFC.Object.neuObject obj = new neusoft.neuFC.Object.neuObject(); //类型为叶 if (this.myDepts[i].GetType() == typeof(neusoft.HISFC.Object.Base.Department)) //科室 { try { neusoft.HISFC.Object.Base.Department Info = (neusoft.HISFC.Object.Base.Department) this.myDepts[i]; obj.ID = Info.ID; obj.Name = Info.Name; try { obj.Memo = Info.DeptType.Name; } catch { //无科室信息 } obj.User01 = Info.DeptPro; obj.User02 = Info.EnglishName; this.AddInfo(Branch, obj, Info); } catch {} } else if (this.myDepts[i].GetType().ToString() == "neusoft.neuFC.Object.neuObject") { obj = (neusoft.neuFC.Object.neuObject) this.myDepts[i]; this.AddInfo(Branch, obj, obj); } else //为干 { //分割字符串 text|tag 标识结点 string all = this.myDepts[i].ToString(); string[] s = all.Split('|'); newNode.Text = s[0]; try { newNode.Tag = s[1]; } catch { newNode.Tag = ""; } try { newNode.ImageIndex = BranchImageIndex; newNode.SelectedImageIndex = BranchSelectedImageIndex; } catch {} Branch = this.Nodes.Add(newNode); } } if (this.bIsShowCount) { foreach (System.Windows.Forms.TreeNode node in this.Nodes) { if (node.Tag.GetType().ToString() == "System.String") //结点 { int count = 0; count = node.GetNodeCount(false); node.Text = node.Text + "(" + count.ToString() + ")"; } } } this.ExpandAll(); }