/// <summary>
        /// 根据交款ID得到预交金交款表对象
        /// </summary>
        /// <param name="rpt">预交金交款表对象</param>
        /// <param name="Accountid">交款ID</param>
        public void GetAccountRptInfo(AbstractChargeAccountRpt rpt, int[] Accountids, int type)
        {
            AllAccount Account    = new AllAccount();
            decimal    total_fee  = 0;
            decimal    cash_fee   = 0;
            decimal    pos_fee    = 0;
            decimal    wticketfee = 0;
            decimal    wticketnum = 0;
            decimal    bticketfee = 0;
            decimal    bticketnum = 0;

            CommMethod.list_AddString.Clear();
            List <ZY_Account> zyAccounts = Account.GetAccounts(Accountids, type);
            ZY_Account        zyAccount  = null;

            for (int i = 0; i < zyAccounts.Count; i++)
            {
                zyAccount = zyAccounts[i];

                rpt.交款人     = CommMethod.AddString(zyAccount.AccountName);
                total_fee  += zyAccount.Total_Fee;
                cash_fee   += zyAccount.Cash_Fee;
                pos_fee    += zyAccount.POS_Fee;
                wticketfee += zyAccount.WTicketFee;
                wticketnum += zyAccount.WTicketNum;
                bticketfee += zyAccount.BTicketFee;
                bticketnum += zyAccount.BTicketNum;
            }

            rpt.交款时间  = zyAccount.AccountDate.ToString();
            rpt.总金额   = total_fee.ToString();
            rpt.总金额大写 = total_fee.ToString();

            rpt.现金金额  = cash_fee.ToString();
            rpt.POS金额 = pos_fee.ToString();

            rpt.收费金额 = wticketfee.ToString();
            rpt.收费张数 = wticketnum.ToString();
            rpt.退费金额 = bticketfee.ToString();
            rpt.退费张数 = bticketnum.ToString();

            rpt.次交款时间 = zyAccount.LastDate.ToString();
            rpt.医院名称  = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;

            string[] AccountIDs = new string[Accountids.Length];
            for (int i = 0; i < AccountIDs.Length; i++)
            {
                AccountIDs[i] = Accountids[i].ToString();
            }
            List <ZY_ChargeList> zy_Chargelist = zyAccount.GetChargeData(AccountIDs, -1);

            for (int i = 0; i < zy_Chargelist.Count; i++)
            {
                zy_Chargelist[i].ChargeType = zy_Chargelist[i].FeeType == 0 ? "现金" : "POS";
                zy_Chargelist[i].PatName    = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.GetPatName(zy_Chargelist[i].PatID);
            }
            rpt.预交金记录 = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zy_Chargelist);
        }
        /// <summary>
        /// 根据交款ID得到预交金交款表对象
        /// </summary>
        /// <param name="rpt">预交金交款表对象</param>
        /// <param name="Accountid">交款ID</param>
        public void GetAccountRptInfo(AbstractChargeAccountRpt rpt, int Accountid)
        {
            ZY_Account zyAccount = new ZY_Account();

            zyAccount = zyAccount.GetAccount(Accountid);

            rpt.交款人  = zyAccount.AccountName;
            rpt.交款时间 = zyAccount.AccountDate.ToString();

            rpt.总金额   = zyAccount.Total_Fee.ToString();
            rpt.总金额大写 = zyAccount.Total_Fee.ToString();

            rpt.现金金额  = zyAccount.Cash_Fee.ToString();
            rpt.POS金额 = zyAccount.POS_Fee.ToString();

            rpt.收费金额 = zyAccount.WTicketFee.ToString();
            rpt.收费张数 = zyAccount.WTicketNum.ToString();
            rpt.退费金额 = zyAccount.BTicketFee.ToString();
            rpt.退费张数 = zyAccount.BTicketNum.ToString();



            rpt.次交款时间 = zyAccount.LastDate.ToString();
            rpt.医院名称  = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;

            string[] AccountIDs = new string[1];
            AccountIDs[0] = Accountid.ToString();
            List <ZY_ChargeList> zy_Chargelist = zyAccount.GetChargeData(AccountIDs, -1);

            for (int i = 0; i < zy_Chargelist.Count; i++)
            {
                zy_Chargelist[i].ChargeType = zy_Chargelist[i].FeeType == 0 ? "现金" : "POS";
                zy_Chargelist[i].PatName    = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.GetPatName(zy_Chargelist[i].PatID);
            }
            rpt.预交金记录 = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zy_Chargelist);
        }
Пример #3
0
        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
        }