public FrmCharge() { InitializeComponent(); base.HIS_DoubleClick += new lvPatList_DoubleClickEvent(FrmCharge_HIS_DoubleClick); this.tbInpatNo.Focus(); this.lbExtFee.Text = "0"; this.lbChargeTolFee.Text = "0"; this.lbCoseTolFee.Text = "0"; this.cbType.SelectedIndex = 0; zy_ChargeList = new ZY_ChargeList(); }
public FrmCharge(ZY_PatList zypat, string titile) { InitializeComponent(); this.cbType.SelectedIndex = 0; this.tbfee.Focus(); base.HIS_DoubleClick += new lvPatList_DoubleClickEvent(FrmCharge_HIS_DoubleClick); this.Text = titile; base.zy_PatList = zypat; //实例化预交金对象 zy_ChargeList = new ZY_ChargeList(); zy_ChargeList.PatListID = base.zy_PatList.PatListID; }
//内容改变 private void dgBill_CurrentCellChanged(object sender, EventArgs e) { if (this.dgBill.CurrentCell != null) { zy_ChargeList = (ZY_ChargeList)HIS.SYSTEM.PubicBaseClasses.ApiFunction.DataTableToObject(((DataTable)this.dgBill.DataSource).Copy(), this.dgBill.CurrentCell.RowIndex, zy_ChargeList); if (zy_ChargeList.AccountID == 0 && zy_ChargeList.ChargeCode == base.currentUser.EmployeeID.ToString()) { this.toolSBDel.Enabled = true; this.toolSBBack.Enabled = false; } else { this.toolSBDel.Enabled = false; this.toolSBBack.Enabled = true; } } }
private void GetChargeData(List <ZY_ChargeList> zy_chargelist, List <ZY_CostMaster> zy_costmaster) { #region 第三步: 预交金的DataGrid数据 List <ZY_ChargeList> zyChargelistW = zy_chargelist.Count > 0 ? zy_chargelist.FindAll(x => x.Record_Flag != 2) : (new List <ZY_ChargeList>()); List <ZY_ChargeList> zyChargelistB = zy_chargelist.Count > 0 ? zy_chargelist.FindAll(x => x.Record_Flag == 2) : (new List <ZY_ChargeList>()); List <ZY_ChargeList> zyChargelistSonW = new List <ZY_ChargeList>(); List <ZY_ChargeList> zyChargelistSonB = new List <ZY_ChargeList>(); //汇总预交金账单 for (int i = 0; i < zyChargelistW.Count; i++) { ZY_ChargeList zyChargelistson = zyChargelistW[i]; zyChargelistson.ChargeUserName = BaseNameFactory.GetName(baseNameType.用户名称, zyChargelistson.ChargeCode); zyChargelistSonW.Add(zyChargelistson); } //汇总 ZY_ChargeList zyChargelist1 = new ZY_ChargeList(); zyChargelist1.BillNo = "合计"; zyChargelist1.Total_Fee = zyChargelistSonW.Sum(x => x.Total_Fee); zyChargelistSonW.Add(zyChargelist1); chargeAllData.GoodChargeList = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyChargelistSonW); for (int i = 0; i < zyChargelistB.Count; i++) { ZY_ChargeList zyChargelistson = zyChargelistB[i]; zyChargelistson.ChargeUserName = BaseNameFactory.GetName(baseNameType.用户名称, zyChargelistson.ChargeCode); zyChargelistSonB.Add(zyChargelistson); } //汇总 ZY_ChargeList zyChargelist2 = new ZY_ChargeList(); zyChargelist2.BillNo = "合计"; zyChargelist2.Total_Fee = zyChargelistSonB.Sum(x => x.Total_Fee); zyChargelistSonB.Add(zyChargelist2); chargeAllData.BadChargeList = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyChargelistSonB); //汇总结算 costAllData.CostData = null; #endregion }
//收费 private void toolsbCost_Click(object sender, EventArgs e) { if (this.tbfee.Text.Trim() == "" || Convert.ToDecimal(this.tbfee.Text.Trim()) <= 0) { MessageBox.Show("请正确输入金额!"); this.tbfee.Focus(); this.tbfee.SelectAll(); return; } if (base.zy_PatList == null || base.zy_PatList.PatType.Trim() == "3" || base.zy_PatList.PatType.Trim() == "4" || base.zy_PatList.PatType.Trim() == "5") { MessageBox.Show("请正确指定一个病人或该病人已经出区!"); this.tbInpatNo.Focus(); return; } if (base.zy_PatList != null) { if (MessageBox.Show("确定要该病人收费[" + this.tbfee.Text + "]吗?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK) { zy_ChargeList = new ZY_ChargeList(); zy_ChargeList.PatListID = base.zy_PatList.PatListID; zy_ChargeList.CureNo = base.zy_PatList.CureNo; zy_ChargeList.BillNo = zy_ChargeList.GetBillNo(XcDate.ServerDateTime); zy_ChargeList.ChargeCode = base.currentUser.EmployeeID.ToString();//? zy_ChargeList.CostDate = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime; zy_ChargeList.Delete_Flag = 0; zy_ChargeList.FeeType = this.cbType.SelectedIndex; zy_ChargeList.PatID = base.zy_PatList.PatID; zy_ChargeList.PatListID = base.zy_PatList.PatListID; zy_ChargeList.Record_Flag = 0; zy_ChargeList.Total_Fee = Convert.ToDecimal(this.tbfee.Text); zy_ChargeList.Add(); MessageBox.Show("收费成功!"); this.tbfee.Text = ""; this.BindDataGrid(); } } }
//打印 private void toolSBPrint_Click(object sender, EventArgs e) { if (((DataTable)this.dgBill.DataSource).Rows.Count == 0) { return; } if (Convert.ToInt32(((DataTable)this.dgBill.DataSource).DefaultView.ToTable().Rows[this.dgBill.CurrentCell.RowIndex]["Record_Flag"]) != 0 || Convert.ToInt32(((DataTable)this.dgBill.DataSource).DefaultView.ToTable().Rows[this.dgBill.CurrentCell.RowIndex]["Delete_Flag"]) != 0) { MessageBox.Show("此条是做废记录或已经结算,不能打印!"); return; } if (MessageBox.Show("确定要打印吗?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK) { zy_ChargeList = (ZY_ChargeList)HIS.SYSTEM.PubicBaseClasses.ApiFunction.DataTableToObject(((DataTable)this.dgBill.DataSource).Copy(), this.dgBill.CurrentCell.RowIndex, zy_ChargeList); grproLib.GridppReport Report = new grproLib.GridppReport(); string reportPath = Constant.ApplicationDirectory + "\\report\\住院收费收据.grf"; Report.LoadFromFile(reportPath); GWI_DesReport.HisReport.FillRecordToReport(Report, zy_ChargeList); Report.ParameterByName("PatName").AsString = zy_PatList.patientInfo.PatName; Report.ParameterByName("DeptName").AsString = this.tbpatDept.Text; Report.ParameterByName("BedNO").AsString = zy_PatList.BedCode; Report.ParameterByName("Total_Fee1").AsString = zy_ChargeList.Total_Fee.ToString(); Report.ParameterByName("PrintPerson").AsString = base.currentUser.Name; Report.ParameterByName("WorkName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName; Report.Printer.PrinterName = HIS_PublicManager.PublicPrintSet.GetPrinterNameByReport("住院收费收据.grf"); if (Report.Printer.PrinterName == null || Report.Printer.PrinterName == "") { MessageBox.Show("请先设置好此报表的打印机!", "询问", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); return; } if (this.printType.Checked) { Report.Print(false); } else { Report.PrintPreview(false); } } }
private void GetCostData() { #region 第四步:结算的DataGrid数据 costAllData.CostData = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyAccountSonlistCost); List <ZY_CostMaster> zyCostlistW = AccountIDCost.Count > 0 ? zyAccount.GetCostData(AccountIDCost.ToArray(), 0) : (new List <ZY_CostMaster>()); List <ZY_CostMaster> zyCostlistB = AccountIDCost.Count > 0 ? zyAccount.GetCostData(AccountIDCost.ToArray(), 1) : (new List <ZY_CostMaster>()); List <ZY_ChargeList> zyChargelistCost = AccountIDCost.Count > 0 ? zyAccount.GetChargeData(AccountIDCost.ToArray(), 2) : (new List <ZY_ChargeList>()); if (AccountIDCost.Count > 0) { DataTable TypeCostData = zyAccount.GetBIGItemData(AccountIDCost.ToArray()); DataRow dr = TypeCostData.NewRow(); dr["itemname"] = "合计"; decimal dec = 0; for (int i = 0; i < TypeCostData.Rows.Count; i++) { dec += Convert.ToDecimal(TypeCostData.Rows[i]["total_fee"]); } dr["total_fee"] = dec; TypeCostData.Rows.Add(dr);//汇总 costAllData.TypeCostData = TypeCostData; } else { costAllData.TypeCostData = null; } List <ZY_CostMaster> zyCostlistSonW = new List <ZY_CostMaster>(); List <ZY_CostMaster> zyCostlistSonB = new List <ZY_CostMaster>(); List <ZY_ChargeList> zyChargeSonCost = new List <ZY_ChargeList>(); for (int i = 0; i < zyCostlistW.Count; i++) { ZY_CostMaster zyCostlistson = zyCostlistW[i]; zyCostlistson.UserName = BaseNameFactory.GetName(baseNameType.用户名称, zyCostlistson.ChargeCode); zyCostlistSonW.Add(zyCostlistson); } //汇总 ZY_CostMaster zyCostlistSonW1 = new ZY_CostMaster(); zyCostlistSonW1.TicketNum = "合计"; zyCostlistSonW1.Total_Fee = zyCostlistSonW.Sum(x => x.Total_Fee); zyCostlistSonW1.Reality_Fee = zyCostlistSonW.Sum(x => x.Reality_Fee); zyCostlistSonW1.Village_Fee = zyCostlistSonW.Sum(x => x.Village_Fee); zyCostlistSonW1.Favor_Fee = zyCostlistSonW.Sum(x => x.Favor_Fee); zyCostlistSonW.Add(zyCostlistSonW1); costAllData.GoodCostList = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyCostlistSonW); for (int i = 0; i < zyCostlistB.Count; i++) { ZY_CostMaster zyCostlistson = zyCostlistB[i]; zyCostlistson.UserName = BaseNameFactory.GetName(baseNameType.用户名称, zyCostlistson.ChargeCode); zyCostlistSonB.Add(zyCostlistson); } //汇总 ZY_CostMaster zyCostlistSonB1 = new ZY_CostMaster(); zyCostlistSonB1.TicketNum = "合计"; zyCostlistSonB1.Total_Fee = zyCostlistSonB.Sum(x => x.Total_Fee); zyCostlistSonB1.Reality_Fee = zyCostlistSonB.Sum(x => x.Reality_Fee); zyCostlistSonB1.Village_Fee = zyCostlistSonB.Sum(x => x.Village_Fee); zyCostlistSonB1.Favor_Fee = zyCostlistSonB.Sum(x => x.Favor_Fee); zyCostlistSonB.Add(zyCostlistSonB1); costAllData.BadCostList = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyCostlistSonB); for (int i = 0; i < zyChargelistCost.Count; i++) { ZY_ChargeList zyChargelistson = zyChargelistCost[i]; zyChargelistson.ChargeUserName = BaseNameFactory.GetName(baseNameType.用户名称, zyChargelistson.ChargeCode); zyChargeSonCost.Add(zyChargelistson); } //汇总 ZY_ChargeList zyChargeSonCost1 = new ZY_ChargeList(); zyChargeSonCost1.BillNo = "合计"; zyChargeSonCost1.Total_Fee = zyChargeSonCost.Sum(x => x.Total_Fee); zyChargeSonCost.Add(zyChargeSonCost1); costAllData.ChargeList = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyChargeSonCost); costAllText.deptosit_fee = Convert.ToString(zyCostlistW.Sum(x => x.Deptosit_Fee) + zyCostlistB.Sum(x => x.Deptosit_Fee)); costAllText.lbRoundFee = Convert.ToString(Convert.ToDecimal(CostAllText.lbAllFee) - Convert.ToDecimal(CostAllText.deptosit_fee) - Convert.ToDecimal(CostAllText.AllFee)); #endregion }
private void GetChargeData() { #region 第三步: 预交金的DataGrid数据 List <ZY_ChargeList> zyChargelistW = AccountIDCharge.Count > 0 ? zyAccount.GetChargeData(AccountIDCharge.ToArray(), 0) : (new List <ZY_ChargeList>()); List <ZY_ChargeList> zyChargelistB = AccountIDCharge.Count > 0 ? zyAccount.GetChargeData(AccountIDCharge.ToArray(), 1) : (new List <ZY_ChargeList>()); List <ZY_ChargeList> zyChargelistSonW = new List <ZY_ChargeList>(); List <ZY_ChargeList> zyChargelistSonB = new List <ZY_ChargeList>(); //汇总预交金账单 ZY_Account zy_AS = new ZY_Account(); zy_AS.AccountName = "合计"; zy_AS.WTicketFee = zyAccountSonlistCharge.Sum(x => x.WTicketFee); zy_AS.WTicketNum = zyAccountSonlistCharge.Sum(x => x.WTicketNum); zy_AS.BTicketFee = zyAccountSonlistCharge.Sum(x => x.BTicketFee); zy_AS.BTicketNum = zyAccountSonlistCharge.Sum(x => x.BTicketNum); zy_AS.Total_Fee = zyAccountSonlistCharge.Sum(x => x.Total_Fee); zy_AS.Cash_Fee = zyAccountSonlistCharge.Sum(x => x.Cash_Fee); zy_AS.POS_Fee = zyAccountSonlistCharge.Sum(x => x.POS_Fee); zyAccountSonlistCharge.Add(zy_AS); chargeAllData.ChargeData = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyAccountSonlistCharge); for (int i = 0; i < zyChargelistW.Count; i++) { ZY_ChargeList zyChargelistson = zyChargelistW[i]; zyChargelistson.ChargeUserName = BaseNameFactory.GetName(baseNameType.用户名称, zyChargelistson.ChargeCode); zyChargelistSonW.Add(zyChargelistson); } //汇总 ZY_ChargeList zyChargelist1 = new ZY_ChargeList(); zyChargelist1.BillNo = "合计"; zyChargelist1.Total_Fee = zyChargelistSonW.Sum(x => x.Total_Fee); zyChargelistSonW.Add(zyChargelist1); chargeAllData.GoodChargeList = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyChargelistSonW); for (int i = 0; i < zyChargelistB.Count; i++) { ZY_ChargeList zyChargelistson = zyChargelistB[i]; zyChargelistson.ChargeUserName = BaseNameFactory.GetName(baseNameType.用户名称, zyChargelistson.ChargeCode); zyChargelistSonB.Add(zyChargelistson); } //汇总 ZY_ChargeList zyChargelist2 = new ZY_ChargeList(); zyChargelist2.BillNo = "合计"; zyChargelist2.Total_Fee = zyChargelistSonB.Sum(x => x.Total_Fee); zyChargelistSonB.Add(zyChargelist2); chargeAllData.BadChargeList = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyChargelistSonB); //汇总结算 ZY_Account zy_ASC = new ZY_Account(); zy_ASC.AccountName = "合计"; zy_ASC.WTicketFee = zyAccountSonlistCost.Sum(x => x.WTicketFee); zy_ASC.WTicketNum = zyAccountSonlistCost.Sum(x => x.WTicketNum); zy_ASC.BTicketFee = zyAccountSonlistCost.Sum(x => x.BTicketFee); zy_ASC.BTicketNum = zyAccountSonlistCost.Sum(x => x.BTicketNum); zy_ASC.Total_Fee = zyAccountSonlistCost.Sum(x => x.Total_Fee); zy_ASC.Cash_Fee = zyAccountSonlistCost.Sum(x => x.Cash_Fee); zy_ASC.POS_Fee = zyAccountSonlistCost.Sum(x => x.POS_Fee); zy_ASC.CostFee = zyAccountSonlistCost.Sum(x => x.CostFee); zy_ASC.FaoverFee = zyAccountSonlistCost.Sum(x => x.FaoverFee); zyAccountSonlistCost.Add(zy_ASC); costAllData.CostData = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyAccountSonlistCost); #endregion }