/// <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(); }
public override int Save(object sender, object neuObject) { if (inpatientNo == null || inpatientNo == "") { MessageBox.Show("请选择患者"); return(0); } Neusoft.HISFC.Management.HealthRecord.Diagnose diagNose = new Neusoft.HISFC.Management.HealthRecord.Diagnose(); Neusoft.NFC.Management.Transaction trans = new Neusoft.NFC.Management.Transaction(diagNose.Connection); trans.BeginTransaction(); diagNose.SetTrans(trans.Trans); this.fpEnter1.StopCellEditing(); ArrayList list = this.GetChangeInfo(); if (list.Count == 0) { trans.RollBack(); MessageBox.Show("没有可保存的信息"); return(0); } if (ValueState(list) == -1) { trans.RollBack(); return(-1); } #region 除 if (diagNose.DeleteDiagnoseAll(this.inpatientNo, frmType) < 0) { trans.RollBack(); MessageBox.Show("保存诊断信息失败" + diagNose.Err); return(-1); } #endregion #region 更新 增加 foreach (Neusoft.HISFC.Object.HealthRecord.Diagnose obj in list) { if (diagNose.InsertDiagnose(obj) < 0) { trans.RollBack(); MessageBox.Show("保存失败 " + diagNose.Err); } } #endregion this.fpEnterSaveChanges(); trans.Commit(); ClearInfo(); LoadInfo(inpatientNo); MessageBox.Show("保存成功"); return(base.Save(sender, neuObject)); }
/// <summary> /// 删除单条摆药单 /// </summary> private void DeleteDrugControl( ) { //判断是否选中一个摆药台 if (this.lvDrugControlList.SelectedItems.Count > 0) { //获取当前摆药台信息 this.GetNewDrugControlInfo( ); } else { MessageBox.Show("请选择您要删除的摆药台!"); return; } if (this.currentDrugControlInfo.ID != "") { DialogResult result = MessageBox.Show("您确定要删除【" + this.currentDrugControlInfo.Name + "】摆药台吗?", "删除提示", System.Windows.Forms.MessageBoxButtons.OKCancel); if (result == DialogResult.Cancel) { return; } int parm; Neusoft.NFC.Management.Transaction trans = new Neusoft.NFC.Management.Transaction(Neusoft.NFC.Management.Connection.Instance); this.drugStore.SetTrans(trans.Trans); //删除旧摆药台摆药明细中的所有数据 parm = this.drugStore.DeleteDrugControl(this.currentDrugControlInfo.ID); if (parm == -1) { trans.RollBack( ); MessageBox.Show(this.drugStore.Err, "提示"); return; } else { trans.Commit( ); } } //删除Listview中的节点 this.lvDrugControlList.SelectedItems[0].Remove( ); //如果ListView仍有节点,则选中第一个 if (this.lvDrugControlList.Items.Count > 0) { this.lvDrugControlList.Items[0].Selected = true; } this.neuTabControl1.SelectedIndex = 0; }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btOk_Click(object sender, System.EventArgs e) { if (dtContinue.Value <= System.DateTime.Now) { System.TimeSpan sp = System.DateTime.Now - dtContinue.Value; if (sp.Days > 0) { MessageBox.Show("续借日期不能小于当前日期"); return; } } if (!Neusoft.NFC.Public.String.ValidMaxLengh(txReturn.Text, 100)) { MessageBox.Show("归还情况过长"); return; } ArrayList list = GetInfo(); //获取信息 if (list == null) { MessageBox.Show("获取信息失败"); return; } Neusoft.NFC.Management.Transaction trans = new Neusoft.NFC.Management.Transaction(card.Connection); trans.BeginTransaction(); card.SetTrans(trans.Trans); foreach (Neusoft.HISFC.Object.HealthRecord.Lend obj in list) { if (card.ReturnCase(lendInfo) < 1) { trans.RollBack(); MessageBox.Show("操作失败: " + card.Err); return; } if (!checkBox1.Checked) //归还 { if (card.UpdateBase(LendType.I, lendInfo.CaseBase.CaseNO) <= 0) { trans.RollBack(); MessageBox.Show("更新病案主表失败"); return; } } } trans.Commit(); MessageBox.Show("操作成功"); }
/// <summary> /// 保存摆药单信息 /// </summary> private void SaveDrugControl( ) { //判断是否选择摆药单 if (this.lvPutDrugBill1.CheckedItems.Count == 0) { MessageBox.Show("请为摆药台添加摆药单。"); return; } //判断是否选中一个摆药台 if (this.lvDrugControlList.SelectedItems.Count > 0) { //获取当前摆药台最新的编辑信息myDrugControlInfo this.GetNewDrugControlInfo( ); } else { MessageBox.Show("请选择一个摆药台。"); return; } //如果是新增加的摆药台,则取此摆药台的流水号 if (currentDrugControlInfo.ID == "") { currentDrugControlInfo.ID = this.drugStore.GetDrugControlNO( ); if (currentDrugControlInfo.ID == "-1") { MessageBox.Show("取摆药台流水号时失败:" + this.drugStore.Err); return; } } int parm; Neusoft.NFC.Management.Transaction t = new Neusoft.NFC.Management.Transaction(Neusoft.NFC.Management.Connection.Instance); t.BeginTransaction( ); drugStore.SetTrans(t.Trans); try { //先删除旧摆药台摆药明细中的所有数据,然后插入新的数据。 parm = drugStore.DeleteDrugControl(currentDrugControlInfo.ID); if (parm == -1) { t.RollBack( ); MessageBox.Show(this.drugStore.Err); return; } else { //插入摆药台数据 foreach (ListViewItem lvi in this.lvPutDrugBill1.CheckedItems) { DrugBillClass info = lvi.Tag as DrugBillClass; //为摆药台明细赋值 currentDrugControlInfo.DrugBillClass.ID = info.ID; currentDrugControlInfo.DrugBillClass.Name = info.Name; //插入摆药台明细数据 parm = this.drugStore.InsertDrugControl(currentDrugControlInfo); if (parm != 1) { t.RollBack( ); MessageBox.Show(this.drugStore.Err); return; } } } //提交数据库 t.Commit( ); this.neuTabControl1.TabPages.Remove(this.tabPage2); this.neuTabControl1.SelectedIndex = 0; MessageBox.Show("摆药台设置成功!"); } catch (Exception ex) { t.RollBack( ); MessageBox.Show("保存摆药台数据时出错:" + ex.Message); return; } //更新listView上节点 this.lvDrugControlList.SelectedItems[0].Tag = currentDrugControlInfo; this.lvDrugControlList.SelectedItems[0].Text = currentDrugControlInfo.Name; //区别新增加和已保存的图标 if (currentDrugControlInfo.ID != "") { this.lvDrugControlList.SelectedItems[0].ImageIndex = 0; } else { this.lvDrugControlList.SelectedItems[0].ImageIndex = 1; } //设置listView的子节点 this.lvDrugControlList.SelectedItems[0].SubItems[1].Text = currentDrugControlInfo.DrugAttribute.Name; this.lvDrugControlList.SelectedItems[0].SubItems[2].Text = currentDrugControlInfo.SendType == 0 ? "全部" : (currentDrugControlInfo.SendType == 1 ? "集中" : "临时"); this.lvDrugControlList.SelectedItems[0].SubItems[3].Text = this.GetShowTypeName(currentDrugControlInfo.SendType); this.lvDrugControlList.SelectedItems[0].SubItems[4].Text = this.currentDept.Name; this.lvDrugControlList.SelectedItems[0].SubItems[5].Text = currentDrugControlInfo.Memo; }
/// <summary> /// 日结 /// </summary> private void Save() { if (this.treeView1.SelectedNode == null) { return; } //先重新检索一遍,防止时间差,否则容易出错! this.treeView1_AfterSelect(new object(), new TreeViewEventArgs(this.treeView1.SelectedNode, TreeViewAction.Unknown)); if (this.objDayReport == null) { MessageBox.Show("请选择挂号员,检索数据!", "提示"); return; } if (this.objDayReport.ID != "") { MessageBox.Show("该日结信息已经保存,不能再次保存!", "提示"); return; } if (this.objDayReport.Details.Count == 0) { MessageBox.Show("无日结信息,不需保存!", "提示"); return; } if (this.objDayReport.Oper.ID != regMgr.Operator.ID) { MessageBox.Show("不允许日结不是本人的费用信息!", "提示"); return; } Neusoft.NFC.Management.Transaction SQLCA = new Neusoft.NFC.Management.Transaction(regMgr.con); SQLCA.BeginTransaction(); try { this.regMgr.SetTrans(SQLCA.Trans); this.dayReport.SetTrans(SQLCA.Trans); string seq = this.regMgr.GetSequence("Registration.DayReport.GetSequence"); this.objDayReport.ID = seq; foreach (Neusoft.HISFC.Object.Registration.DayDetail detail in this.objDayReport.Details) { detail.ID = seq; } if (this.dayReport.Insert(this.objDayReport) == -1) { SQLCA.RollBack(); MessageBox.Show(this.dayReport.Err, "提示"); return; } int rtn = this.regMgr.Update(this.objDayReport.BeginDate, this.objDayReport.EndDate, this.objDayReport.Oper.ID, seq); if (rtn == -1) { SQLCA.RollBack(); MessageBox.Show(this.regMgr.Err, "提示"); return; } if (rtn == 0) { SQLCA.RollBack(); MessageBox.Show("日结信息状态已经变更,请重新日结!", "提示"); return; } SQLCA.Commit(); } catch (Exception e) { SQLCA.RollBack(); MessageBox.Show(e.Message, "提示"); return; } MessageBox.Show("日结成功!", "提示"); //this.crystalReportViewer1.PrintReport(); this.PrintPanel(this.panel3); this.Clear(); this.SetQueryDateTime(); this.Query(this.dayReport.Operator.ID, this.dayReport.Operator.Name); }
public override int Save(object sender, object neuObject) { Neusoft.NFC.Management.Transaction trans = new Neusoft.NFC.Management.Transaction(deptShift.Connection); #region 转科信息 //删除的 ArrayList deptDel = new ArrayList(); //增加的 ArrayList deptAdd = new ArrayList(); //修改过的 ArrayList deptMod = new ArrayList(); #region 基本信息界面上的转科信息 //#region 第一次转科信息 //if (firstDept.Tag != null) //有三中情况 1。tag不为空 (firDept为空 或着病案从来没有维护过 是新增加的 2。tag不为空 firDept不为空 firDept.Dept.ID 不等于tag 是修改的 //{ //3 。firDept不为空 tag 为空 是删除的 。 // if (firDept == null || CaseBase.PatientInfo.CaseState == "1")//新增加的 // { // firDept = new Neusoft.HISFC.Object.RADT.Location(); // firDept.User02 = CaseBase.PatientInfo.ID; // firDept.Dept.Name = firstDept.Text; // firDept.Dept.ID = firstDept.Tag.ToString(); // firDept.User01 = this.dateTimePicker3.Value.ToString(); // deptAdd.Add(firDept); // } // else //修改过的 // { // firDept.User02 = CaseBase.PatientInfo.ID; // firDept.Dept.Name = firstDept.Text; // firDept.Dept.ID = firstDept.Tag.ToString(); // firDept.User01 = this.dateTimePicker3.Value.ToString(); // deptMod.Add(firDept); // } //} //else if (firDept != null && firstDept.Tag == null) //删除的 //{ // deptDel.Add(firDept); //} //#endregion //#region 第二次转科信息 //if (deptSecond.Tag != null) //{ // if (secDept == null || CaseBase.PatientInfo.CaseState == "1") //增加的 // { // secDept = new Neusoft.HISFC.Object.RADT.Location(); // secDept.User02 = CaseBase.PatientInfo.ID; // this.secDept.Dept.Name = deptSecond.Text; // this.secDept.Dept.ID = deptSecond.Tag.ToString(); // secDept.User01 = this.dateTimePicker3.Value.ToString(); // deptAdd.Add(secDept); // } // else //修改过的 // { // secDept.User02 = CaseBase.PatientInfo.ID; // this.secDept.Dept.Name = deptSecond.Text; // this.secDept.Dept.ID = deptSecond.Tag.ToString(); // secDept.User01 = this.dateTimePicker3.Value.ToString(); // deptMod.Add(secDept); // } //} //else if (secDept != null && deptSecond.Tag == null) //{ // deptDel.Add(secDept); //} //#endregion //#region 第三次转科 //if (deptThird.Tag != null) //{ // if (thirDept == null || CaseBase.PatientInfo.CaseState == "1") // { // thirDept = new Neusoft.HISFC.Object.RADT.Location(); // thirDept.User02 = CaseBase.PatientInfo.ID; // this.thirDept.Dept.Name = deptThird.Text; // this.thirDept.Dept.ID = deptThird.Tag.ToString(); // thirDept.User01 = this.dateTimePicker3.Value.ToString(); // deptAdd.Add(thirDept); // } // else // { // thirDept.User02 = CaseBase.PatientInfo.ID; // this.thirDept.Dept.Name = deptThird.Text; // this.thirDept.Dept.ID = deptThird.Tag.ToString(); // thirDept.User01 = this.dateTimePicker3.Value.ToString(); // deptMod.Add(thirDept); // } //} //else if (thirDept != null && deptThird.Tag == null) //删除的 //{ // deptDel.Add(thirDept); //} //#endregion #endregion //删除空白行 deleteRow(); GetList("D", deptDel); GetList("A", deptAdd); GetList("M", deptMod); if (ValueState(deptDel) == -1 || ValueState(deptAdd) == -1 || ValueState(deptMod) == -1) { trans.RollBack(); return(-3); } if (deptDel != null) { foreach (Neusoft.HISFC.Object.RADT.Location obj in deptDel) { if (deptShift.DeleteChangeDept(obj) < 1) { trans.RollBack(); MessageBox.Show("转科信息保存失败" + deptShift.Err); return(-1); } } } if (deptAdd != null) { foreach (Neusoft.HISFC.Object.RADT.Location obj in deptAdd) { if (deptShift.InsertChangeDept(obj) < 1) { trans.RollBack(); MessageBox.Show("转科信息保存失败" + deptShift.Err); return(-1); } } } if (deptMod != null) { foreach (Neusoft.HISFC.Object.RADT.Location obj in deptMod) { if (deptShift.UpdateChangeDept(obj) < 1) { trans.RollBack(); MessageBox.Show("转科信息保存失败" + deptShift.Err); return(-1); } } } //查询保存过的信息 ArrayList tempChangeDept = deptShift.QueryChangeDeptFromShiftApply(inPatientNO, "2"); #endregion trans.Commit(); MessageBox.Show("保存成功"); return(1); }
/// <summary> /// 保存配制处方信息 /// </summary> /// <returns>成功返回1 失败返回-1</returns> public int SavePrescription() { if (this.neuSpread1_Sheet1.Rows.Count <= 0) { return(1); } if (this.neuSpread2_Sheet1.Rows.Count <= 0) { return(1); } string drugCode = this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.ActiveRowIndex, 0].Text; DateTime sysTime = this.preparationMgr.GetDateTimeFromSysDateTime(); Neusoft.NFC.Management.Transaction t = new Neusoft.NFC.Management.Transaction(Neusoft.NFC.Management.Connection.Instance); t.BeginTransaction(); this.preparationMgr.SetTrans(t.Trans); try { if (this.preparationMgr.DelPrescription(drugCode) == -1) { t.RollBack(); MessageBox.Show("删除配制处方信息出错" + this.preparationMgr.Err); return(-1); } Neusoft.HISFC.Object.Preparation.Prescription info = new Neusoft.HISFC.Object.Preparation.Prescription(); Neusoft.HISFC.Object.Pharmacy.Item tempItem; for (int i = 0; i < this.neuSpread2_Sheet1.Rows.Count; i++) { if (this.neuSpread2_Sheet1.Cells[i, 0].Text == "") { continue; } info = new Neusoft.HISFC.Object.Preparation.Prescription(); info.Drug = this.GetItem(drugCode); tempItem = this.neuSpread2_Sheet1.Rows[i].Tag as Neusoft.HISFC.Object.Pharmacy.Item; if (tempItem == null) { t.RollBack(); MessageBox.Show("类型转换错误"); return(-1); } info.Material = tempItem; info.NormativeQty = NConvert.ToDecimal(this.neuSpread2_Sheet1.Cells[i, 2].Text); info.NormativeUnit = this.neuSpread2_Sheet1.Cells[i, 3].Text; info.OperEnv.ID = this.preparationMgr.Operator.ID; info.OperEnv.OperTime = sysTime; if (this.preparationMgr.SetPrescription(info) == -1) { t.RollBack(); if (this.preparationMgr.DBErrCode == 1) { MessageBox.Show(info.Material.Name + "不能重复添加"); } else { MessageBox.Show("保存" + info.Drug.Name + "配制处方信息失败" + this.preparationMgr.Err); } return(-1); } } } catch (Exception ex) { t.RollBack(); MessageBox.Show(ex.Message); } t.Commit(); MessageBox.Show("保存成功"); return(1); }