private ArrayList GetInfo() { ArrayList list = new ArrayList(); for (int i = 0; i < this.fpSpread1_Sheet1.Rows.Count; i++) { if (this.fpSpread1_Sheet1.Cells[i, (int)Cols.Check].Value == null || fpSpread1_Sheet1.Cells[i, (int)Cols.Check].Value.ToString().ToUpper() != "TRUE") { continue; } Neusoft.HISFC.Object.HealthRecord.Lend obj = (Neusoft.HISFC.Object.HealthRecord.Lend)fpSpread1_Sheet1.Rows[i].Tag; if (obj == null) { MessageBox.Show("获取病案信息出错"); return(null); } if (checkBox1.Checked) //续借 { lendInfo.PrerDate = dtContinue.Value; } else if (checkBox2.Checked) //返还 { obj.ReturnDate = dtReturn.Value; //实际返还时间 obj.ReturnOperInfo.ID = card.Operator.ID; //返还操作员 obj.LendStus = "2"; //状态 obj.Memo = this.txReturn.Text; //是否完好 } list.Add(obj); } return(list); }
/// <summary> /// 借出操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tbLend_Click(object sender, System.EventArgs e) { //首先判断是否已经借出了,如果借出了没有归还则不能再外借 //借出操作 Neusoft.HISFC.Object.HealthRecord.Lend obj = GetLendInfo(); if (obj == null) { return; } if (ValidState(obj) == -1) { return; } Neusoft.NFC.Management.Transaction trans = new Neusoft.NFC.Management.Transaction(card.Connection); trans.BeginTransaction(); card.SetTrans(trans.Trans); if (card.LendCase(obj) < 1) { trans.RollBack(); MessageBox.Show("插入借阅记录失败: " + card.Err); return; } if (card.UpdateBase(LendType.O, obj.CaseBase.CaseNO) <= 0) { trans.RollBack(); MessageBox.Show("更新病案主表失败"); return; } trans.Commit(); MessageBox.Show("操作成功"); this.ClearCase(); this.ClearPerson(); this.caseNo.Focus(); }
private Neusoft.HISFC.Object.HealthRecord.Lend GetLendInfo() { if (PatientCaseInfo == null) { MessageBox.Show("请选择借阅的病案信息"); return(null); } if (Cardinfo == null) { MessageBox.Show("请选择借阅的病案信息"); return(null); } Neusoft.HISFC.Object.HealthRecord.Lend Saveinfo = new Neusoft.HISFC.Object.HealthRecord.Lend(); Saveinfo.SeqNO = this.card.GetSequence("Case.CaseCard.LendCase.Seq"); if (Saveinfo.SeqNO == null || Saveinfo.SeqNO == "") { MessageBox.Show("获取序号失败"); return(null); } Saveinfo.CaseBase.CaseNO = PatientCaseInfo.CaseNO; Saveinfo.CaseBase.PatientInfo.ID = PatientCaseInfo.PatientInfo.ID; //住院流水号 Saveinfo.CaseBase.CaseNO = PatientCaseInfo.CaseNO; //病人住院号 Saveinfo.CaseBase.PatientInfo.Name = PatientCaseInfo.PatientInfo.Name; //病人姓名 Saveinfo.CaseBase.PatientInfo.Sex.ID = PatientCaseInfo.PatientInfo.Sex.ID; //性别 Saveinfo.CaseBase.PatientInfo.Birthday = PatientCaseInfo.PatientInfo.Birthday; //出生日期 Saveinfo.CaseBase.PatientInfo.PVisit.InTime = PatientCaseInfo.PatientInfo.PVisit.InTime; //入院日期 Saveinfo.CaseBase.PatientInfo.PVisit.OutTime = PatientCaseInfo.PatientInfo.PVisit.OutTime; //出院日期 Saveinfo.CaseBase.InDept.ID = PatientCaseInfo.InDept.ID; //入院科室代码 Saveinfo.CaseBase.InDept.Name = PatientCaseInfo.InDept.Name; //入院科室名称 Saveinfo.CaseBase.OutDept.ID = PatientCaseInfo.OutDept.ID; //出院科室代码 Saveinfo.CaseBase.OutDept.Name = PatientCaseInfo.OutDept.Name; //出院科室名称 Saveinfo.EmployeeInfo.ID = Cardinfo.EmployeeInfo.ID; //借阅人代号 Saveinfo.EmployeeInfo.Name = Cardinfo.EmployeeInfo.Name; //借阅人姓名 Saveinfo.EmployeeDept.ID = Cardinfo.DeptInfo.ID; //借阅人所在科室代码 Saveinfo.EmployeeDept.Name = Cardinfo.DeptInfo.Name; //借阅人所在科室名称 Saveinfo.LendDate = Neusoft.NFC.Function.NConvert.ToDateTime(baseDml.GetSysDate()); //借阅日期 Saveinfo.PrerDate = txReturnTime.Value; //预定还期 if (this.comType.Text == "内借") { Saveinfo.LendKind = "1";; //借阅性质 } else if (this.comType.Text == "外借") { Saveinfo.LendKind = "2";; //借阅性质 } Saveinfo.LendStus = "1";; //病历状态 1借出/2返还 Saveinfo.ID = baseDml.Operator.ID; //操作员代号 Saveinfo.OperInfo.OperTime = Neusoft.NFC.Function.NConvert.ToDateTime(baseDml.GetSysDate()); //操作时间 Saveinfo.ReturnOperInfo.ID = ""; //归还操作员代号 Saveinfo.ReturnDate = Neusoft.NFC.Function.NConvert.ToDateTime("3000-1-1"); //实际归还日期 Saveinfo.CardNO = CardNO.Text; //卡号 return(Saveinfo); }
/// <summary> /// 显示信息 /// </summary> /// <param name="obj"></param> private void SetInfo(Neusoft.HISFC.Object.HealthRecord.Lend obj) { CardNO.Text = obj.CardNO; txName.Text = obj.EmployeeInfo.Name; txDept.Text = obj.EmployeeDept.Name; txLendTime.Text = obj.LendDate.ToShortDateString(); txLEndtype.Text = obj.LendKind; txcaseNo.Text = obj.CaseBase.CaseNO; txPatientName.Text = obj.CaseBase.PatientInfo.Name; txBirthday.Text = obj.CaseBase.PatientInfo.Birthday.ToShortDateString(); dtContinue.Value = Neusoft.NFC.Function.NConvert.ToDateTime(card.GetSysDate()); dtReturn.Value = Neusoft.NFC.Function.NConvert.ToDateTime(card.GetSysDate()); txReturn.Text = obj.Memo; }
private int ValidState(Neusoft.HISFC.Object.HealthRecord.Lend obj) { if (CardNO.Text == null && CardNO.Text == "") { MessageBox.Show("请输入借阅卡号"); return(-1); } if (caseNo.Text == null && caseNo.Text == "") { MessageBox.Show("请输入借阅卡号"); return(-1); } if (comType.Text == "") { MessageBox.Show("借阅方式"); return(-1); } if (this.txReturnTime.Value <= System.DateTime.Now) { MessageBox.Show("预计归还日期不能小于当前时间"); return(-1); } return(1); }