/// <summary> /// 增加树型节点 /// </summary> /// <param name="leave"></param> private void AddTreeNode(Neusoft.HISFC.Models.RADT.Leave leave) { System.Windows.Forms.TreeNode Node = new System.Windows.Forms.TreeNode(); try { Node.Text = leave.LeaveTime.ToString(); Node.Tag = leave; //根据请假状态的不同,显示不同的图片 if (leave.LeaveFlag == "0") { //存在请假记录 Node.ImageIndex = 1; //标识患者存在有效的请假记录 this.IsLeave = true; } else { //存在消假记录 Node.ImageIndex = 2; } Node.SelectedImageIndex = Node.ImageIndex; this.treeView1.Nodes[0].Nodes.Add(Node); } catch (Exception ex) { MessageBox.Show(ex.Message, "错误提示"); } }
/// <summary> /// 获取患者请假信息 /// </summary> private bool GetLeaveInfo() { bool isNew = true; if (this.myLeave == null) { this.myLeave = new Neusoft.HISFC.Models.RADT.Leave(); isNew = true; } else { isNew = false; } //如果是新增请假信息,则取本次请假信息 if (this.myLeave.ID == "") { this.myLeave.ID = this.patientInfo.ID; this.myLeave.LeaveTime = this.dtpRegisterDate.Value; } //请假天数 this.myLeave.LeaveDays = Neusoft.FrameWork.Function.NConvert.ToInt32(this.txtDays.Text); //给假医生 this.myLeave.DoctCode = this.cmbDoc.Tag.ToString(); //备注 this.myLeave.Memo = this.txtRemark.Text; return(isNew); }
/// <summary> /// 设置患者请假信息到控件 /// </summary> /// <param name="leave"></param> private void ShowLeaveInfo(Neusoft.HISFC.Models.RADT.Leave leave) { //如果没有患者信息,则清屏 if (this.myLeave == null) { this.ClearInfo(); return; } //给假医生 this.cmbDoc.Tag = leave.DoctCode; if (leave.DoctCode == "") { this.cmbDoc.Text = null; } //请假天数 this.txtDays.Text = leave.LeaveDays.ToString(); //登记人姓名 this.txtRegisterPerson.Text = manager.GetEmployeeInfo(leave.Oper.ID).Name; //消假人姓名 try { if (leave.CancelOper.ID != "") { this.txtCancelPerson.Text = manager.GetEmployeeInfo(leave.CancelOper.ID).Name; } } catch { this.txtCancelPerson.Text = ""; } //备注 this.txtRemark.Text = leave.Memo; //请假日期 this.dtpRegisterDate.Text = leave.LeaveTime.ToString(); try { //取消日期 if (this.myLeave.LeaveFlag != "0") { this.dtpCancelDate.Text = leave.CancelOper.OperTime.ToString(); } else { this.dtpCancelDate.Text = this.inpatient.GetDateTimeFromSysDateTime().ToString(); } }catch {} //显示请假记录 if (leave.LeaveFlag == "0") { this.btnCancel.Enabled = true; this.btnSave.Enabled = true; } else { //取消的请假记录显示消假信息 this.btnCancel.Enabled = false; this.btnSave.Enabled = false; } }
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) { //获取当前选中请假信息 this.myLeave = e.Node.Tag as Neusoft.HISFC.Models.RADT.Leave; //将选中的请假信息显示在控件中 this.ShowLeaveInfo(this.myLeave); }