Exemplo n.º 1
0
        void controller_AfterBalanceEndEvent(object sender, AfterBalanceEndArgs e)
        {
            if (e.Success)
            {
                try
                {
                    PrintController.PrintChargeInvoice(e.Invoices);
                    frmPreviousInfo.PatientName    = plPatient.OutPatient.PatientName;
                    frmPreviousInfo.InvoicePics    = e.Invoices.Length.ToString( );
                    frmPreviousInfo.TotalMoney     = e.BalanceInfo.TotalFee.ToString(decimalFormat);
                    frmPreviousInfo.FavorMoney     = e.BalanceInfo.FavorFee.ToString(decimalFormat);
                    frmPreviousInfo.InsurMoney     = e.BalanceInfo.VillageFee.ToString(decimalFormat);
                    frmPreviousInfo.SelfPayMoney   = e.BalanceInfo.SelfFee.ToString(decimalFormat);
                    frmPreviousInfo.SelfTollyMoney = e.BalanceInfo.SelfTally.ToString(decimalFormat);
                    frmPreviousInfo.PosMoney       = e.BalanceInfo.PosFee.ToString(decimalFormat);


                    frmPreviousInfo.Show( );
                    controller.ReadPatientNotBalancePrescription(true);
                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        /// <summary>
        /// 结算
        /// </summary>
        /// <param name="e">预算的消息参数</param>
        public void Balance(AfterBudgetEndArgs e)
        {
            Invoice[]           invoicies;
            ChargeInfo[]        chargeInfos = e.BudgetInfos;
            AfterBalanceEndArgs even        = new AfterBalanceEndArgs( );

            try
            {
                bool ret = e.ChargeController.Charge(chargeInfos, e.Prescriptions, out invoicies);
                even.Success     = ret;
                even.Invoices    = invoicies;
                even.BalanceInfo = e.TotalBugetInfo;
            }
            catch (Exception err)
            {
                even.Success = false;
                even.Cancel  = true;
                even.Message = err.Message;
            }


            if (AfterBalanceEndEvent != null)
            {
                AfterBalanceEndEvent(this, even);
            }

            try
            {
                string perfChar         = "";
                string currentInvoiceNo = HIS.MZ_BLL.InvoiceManager.GetBillNumber(OPDBillKind.门诊收费发票, formView.CurrentEmployeeId, true, out perfChar);
                formView.InvoicePerfChar  = perfChar;
                formView.CurrentInvoiceNo = currentInvoiceNo;
            }
            catch (Exception err)
            {
                throw err;
            }
        }