//protected override void OnLoad() //{ // this.Init(); // base.OnLoad(); //} protected override int OnDrawTree() { if (this.tvLeft == null) { return(-1); } DateTime now = DateTime.Now; DateTime dt = new DateTime(DateTime.Now.Year, 1, 1); this.dtpBeginTime.Value = dt; System.Collections.ArrayList deptList = new Neusoft.HISFC.BizProcess.Integrate.PhysicalExamination.ExamiManager().QueryCompanyRegister (dt.ToString(), dt.AddYears(1).AddMilliseconds(-1).ToString()); if (deptList == null) { return(-1); } TreeNode parentTreeNode = new TreeNode("所有公司"); this.tvLeft.Nodes.Add(parentTreeNode); foreach (Neusoft.FrameWork.Models.NeuObject dept in deptList) { TreeNode deptNode = new TreeNode(); deptNode.Tag = dept.ID; deptNode.Text = dept.Name; parentTreeNode.Nodes.Add(deptNode); } parentTreeNode.ExpandAll(); return(base.OnDrawTree()); }
///// <summary> ///// 初始化事件 ///// </summary> ///// <param name="sender"></param> ///// <param name="neuObject"></param> ///// <param name="param"></param> ///// <returns></returns> //protected override Neusoft.FrameWork.WinForms.Forms.ToolBarService OnInit(object sender, object neuObject, object param) //{ // if (this.DesignMode) // { // return null; // } // if (this.isQueryForm) // { // this.neuButtonOK.Visible = false; // } // else // { // this.neuButtonOK.Visible = true; // } // return null; //} #endregion #region 取消终端确认 private void CancelConfirm() { if (this.neuSpreadItemDetail_SheetItemDetail.RowCount == 0) { return; } if (MessageBox.Show("是否取消该次确认", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } if (this.neuSpreadItemDetail_SheetItemDetail.Rows[this.neuSpreadItemDetail_SheetItemDetail.ActiveRowIndex].Tag == null) { MessageBox.Show("获取终端确认明细出错"); return; } Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); Neusoft.HISFC.BizLogic.Terminal.TerminalConfirm terminalConfim = new Neusoft.HISFC.BizLogic.Terminal.TerminalConfirm(); Neusoft.HISFC.BizProcess.Integrate.PhysicalExamination.ExamiManager examiMgr = new Neusoft.HISFC.BizProcess.Integrate.PhysicalExamination.ExamiManager(); Neusoft.HISFC.BizProcess.Integrate.Fee feeMgr = new Neusoft.HISFC.BizProcess.Integrate.Fee(); Neusoft.HISFC.BizProcess.Integrate.RADT serviceInpatient = new Neusoft.HISFC.BizProcess.Integrate.RADT(); //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(terminalConfim.Connection); //t.BeginTransaction(); //terminalConfim.SetTrans(t.Trans); //examiMgr.SetTrans(t.Trans); //feeMgr.SetTrans(t.Trans); //serviceInpatient.SetTrans(t.Trans); Neusoft.HISFC.Models.Terminal.TerminalConfirmDetail detail = (Neusoft.HISFC.Models.Terminal.TerminalConfirmDetail) this.neuSpreadItemDetail_SheetItemDetail.Rows[this.neuSpreadItemDetail_SheetItemDetail.ActiveRowIndex].Tag; Neusoft.HISFC.Models.Terminal.TerminalApply apply = terminalConfim.GetItemListBySequence(detail.Apply.Order.ID, detail.Apply.ID); Neusoft.HISFC.Models.Base.Employee employee = (Neusoft.HISFC.Models.Base.Employee)terminalConfim.Operator; if (detail.OperInfo.ID != terminalConfim.Operator.ID) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("只能取消自己做过的终端确认"); return; } if (detail == null) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("获取终端确认明细出错"); return; } int BackQty = Neusoft.FrameWork.Function.NConvert.ToInt32(detail.Apply.Item.ConfirmedQty); if (terminalConfim.UpdateConfirmDetail(detail.Sequence, "1") <= 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("作废终端确认明细表出错" + terminalConfim.Err); return; } if (terminalConfim.UpdateTerminalConfirmByMoOrder(detail.Apply.Order.ID, BackQty) <= 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("更新终端确认主表失败" + terminalConfim.Err); return; } string confirmFlag = "1"; if (apply.AlreadyConfirmCount - BackQty == 0) { confirmFlag = "0"; } if (apply.PatientType != "5" && (apply.PatientType == "1" || apply.PatientType == "4")) { if (terminalConfim.UpdateFeeConfirmQty(detail.Apply.Order.ID, confirmFlag, -BackQty) <= 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("更新费用表失败" + terminalConfim.Err); return; } #region 扣门诊账户 if (detail.Apply.SpecalFlag == "1") { //退费用到门诊账户 ,目前门诊账户项目不能分开多次确认 decimal totCost = decimal.Round(apply.Item.Item.Price * apply.Item.Item.Qty, 2); if (feeMgr.AccountCancelPay(apply.Patient, totCost, "终端退费", employee.Dept.ID, "") < 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("退门诊账户失败 :" + feeMgr.Err); return; } #region 更新费用表 if (feeMgr.UpdateAccountByMoOrderAndItemCode(apply.Item.Item.ID, apply.Order.ID, false) <= 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("门诊收费表扣费标志失败 :" + feeMgr.Err); return; } #endregion #region 更新执行标志到划价状态 if (terminalConfim.UpdateConfirmSendFlag(detail.Apply.Order.ID, detail.Apply.Item.Item.ID, "0") <= 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("更新终端确认表执行标志失败 :" + terminalConfim.Err); return; } #endregion } #endregion } if (apply.PatientType == "4" || apply.PatientType == "5") { //体检中心的可退数量 int NoBackQty = Neusoft.FrameWork.Function.NConvert.ToInt32(apply.Item.Item.Qty - apply.Item.ConfirmedQty + BackQty); if (examiMgr.UpdateConfirmInfo(detail.Apply.Order.ID, confirmFlag, NoBackQty) <= 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("更新体检表失败:" + examiMgr.Err); return; } } if (apply.PatientType == "2" && detail.Apply.SpecalFlag == "2") //回退住院费用 { #region 构建住院患者实体 Neusoft.HISFC.Models.RADT.PatientInfo patientInfo = serviceInpatient.QueryPatientInfoByInpatientNO(apply.Patient.PID.ID); if (patientInfo == null) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("获取住院患者信息失败:" + serviceInpatient.Err); return; } #endregion #region 构建住院费用实体 Neusoft.HISFC.Models.Fee.Inpatient.FeeItemList feeItemList = new Neusoft.HISFC.Models.Fee.Inpatient.FeeItemList(); Neusoft.HISFC.Models.Terminal.TerminalApply terminalApply = apply.Clone(); feeItemList.Item = terminalApply.Item.Item.Clone(); feeItemList.Item.PriceUnit = terminalApply.Item.Item.PriceUnit;//计价单位 if (terminalApply.Item.Order.DoctorDept.ID == null || terminalApply.Item.Order.DoctorDept.ID == "") { feeItemList.RecipeOper.Dept = employee.Dept; } else { feeItemList.RecipeOper.Dept = terminalApply.Item.Order.DoctorDept; } if (terminalApply.Item.Order.Doctor.ID == null || terminalApply.Item.Order.Doctor.ID == "") { feeItemList.RecipeOper.ID = employee.ID; feeItemList.RecipeOper.Name = employee.Name; feeItemList.ChargeOper.ID = employee.ID; feeItemList.ChargeOper.Name = employee.Name; feeItemList.ChargeOper.Dept = employee.Dept; } else { feeItemList.RecipeOper.ID = terminalApply.Item.Order.Doctor.ID; feeItemList.RecipeOper.Name = terminalApply.Item.Order.Doctor.Name; feeItemList.ChargeOper.ID = terminalApply.Item.Order.Doctor.ID; feeItemList.ChargeOper.Name = terminalApply.Item.Order.Doctor.Name; } feeItemList.ExecOper.ID = employee.ID; feeItemList.ExecOper.Name = employee.Name; feeItemList.ExecOper.Dept = employee.Dept; feeItemList.StockOper.Dept = employee.Dept;//药品的扣库存的科室 feeItemList.Item.PackQty = terminalApply.Item.Item.PackQty; feeItemList.Item.Qty = terminalApply.Item.Item.Price; feeItemList.Item.Qty = terminalApply.Item.Item.Qty; if (feeItemList.Item.PackQty == 0) { feeItemList.Item.PackQty = 1; } feeItemList.FT.TotCost = Neusoft.FrameWork.Public.String.FormatNumber((feeItemList.Item.Price * feeItemList.Item.Qty / feeItemList.Item.PackQty), 2); feeItemList.FT.OwnCost = feeItemList.FT.TotCost; feeItemList.IsBaby = patientInfo.IsBaby; feeItemList.IsEmergency = false; feeItemList.Order = new Neusoft.HISFC.Models.Order.Inpatient.Order(); feeItemList.ExecOrder.ID = terminalApply.Item.Order.ID; feeItemList.NoBackQty = 0; feeItemList.FTRate.OwnRate = 1; feeItemList.BalanceState = "0"; feeItemList.FeeOper.ID = employee.ID; feeItemList.FeeOper.Name = employee.Name; feeItemList.FeeOper.Dept = employee.Dept; feeItemList.TransType = TransTypes.Positive; #endregion if (feeMgr.QuitItem(patientInfo, feeItemList) <= 0) { MessageBox.Show("退住院费用失败" + feeMgr.Err); return; } } Neusoft.FrameWork.Management.PublicTrans.Commit(); this.neuSpreadItemDetail_SheetItemDetail.Rows.Remove(this.neuSpreadItemDetail_SheetItemDetail.ActiveRowIndex, 1); #region 修改界面上的数量 for (int i = 0; i < this.neuSpreadItem_SheetItem.RowCount; i++) { Neusoft.HISFC.Models.Terminal.TerminalApply obj = (Neusoft.HISFC.Models.Terminal.TerminalApply) this.neuSpreadItem_SheetItem.Rows[i].Tag; if (obj.Order.ID == detail.Apply.Order.ID) { int freeQty = Neusoft.FrameWork.Function.NConvert.ToInt32(detail.Apply.Item.ConfirmedQty) + Neusoft.FrameWork.Function.NConvert.ToInt32(neuSpreadItem_SheetItem.Cells[i, (int)ApplyField.FreeQty].Text); this.neuSpreadItem_SheetItem.Cells[i, (int)ApplyField.FreeQty].Text = freeQty.ToString(); break; } } #endregion MessageBox.Show("取消成功"); }