public virtual void save()
        {
            Neusoft.FrameWork.WinForms.Forms.frmWait frmWait = new Neusoft.FrameWork.WinForms.Forms.frmWait();
            frmWait.Text = "保存中,请稍后……";
            frmWait.Show();
            if (!this.InputValid())
            {
                return;
            }
            #region 设置事物

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            this.feeIntegrate.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            #endregion

            //住院证实体
            Neusoft.HISFC.Models.RADT.InPatientProof inpatientproof = this.GetInPatientProofInfo();
            if (inpatientproof == null)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("住院证信息不能为空"));
                return;
            }

            int returnValue = 0;

            returnValue = this.radtIntegrate.InPatientProof(inpatientproof);
            if (returnValue < 0)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("更新住院证信息失败!\n" + this.regMgr.Err);
                return;
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();
            #region 住院证打印
            if (string.IsNullOrEmpty(inpatientproof.Clinic_code))
            {
                MessageBox.Show("取住院证实体信息失败!\n" + this.regMgr.Err);
                return;
            }
            else
            {
                this.inpatientproofPrint = Neusoft.FrameWork.WinForms.Classes.UtilInterface.CreateObject(this.GetType(), typeof(Neusoft.HISFC.BizProcess.Interface.FeeInterface.IInpatientProofPrint)) as Neusoft.HISFC.BizProcess.Interface.FeeInterface.IInpatientProofPrint;

                if (this.inpatientproofPrint == null)
                {
                }
                else
                {
                    this.inpatientproofPrint.Clear();
                    this.inpatientproofPrint.SetValue(this.inpatientproof);
                    this.inpatientproofPrint.Print();
                }
            }
            #endregion
            frmWait.Close();
            MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("保存数据成功!"), Neusoft.FrameWork.Management.Language.Msg("提示"), MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Clear();
        }
        /// <summary>
        /// 保存日结数据
        /// </summary>
        public void DayBalance()
        {
            if (this.alBalanceData == null)
            {
                return;
            }

            if (MessageBox.Show("是否进行日结,日结后数据将不能恢复?", "门诊收款员缴款日报", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                //
                // 变量定义
                //
                // 返回值
                int intReturn = 0;
                // 事务对象
                //Neusoft.FrameWork.Management.Transaction transaction = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
                // 等待窗口
                Neusoft.FrameWork.WinForms.Forms.frmWait waitForm = new Neusoft.FrameWork.WinForms.Forms.frmWait();
                // 门诊收费业务层
                Neusoft.HISFC.BizLogic.Fee.Outpatient outpatient = new Neusoft.HISFC.BizLogic.Fee.Outpatient();
                // 日结序号
                string sequence = "";

                //
                // 判断合法性
                //
                if (!this.enableBalance)
                {
                    MessageBox.Show("不能进行日结");
                    return;
                }
                if (this.alBalanceData == null)
                {
                    return;
                }

                // 启动等待窗口
                waitForm.Tip = "正在进行日结";
                waitForm.Show();

                //
                // 设置事务
                //
                Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

                //transaction.BeginTransaction();
                this.clinicDayBalance.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
                outpatient.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

                //
                // 保存日结数据
                //
                this.operateDate = this.clinicDayBalance.GetDateTimeFromSysDateTime().ToString();
                // 获取日结序号
                intReturn = this.clinicDayBalance.GetBalanceSequence(ref sequence);
                if (intReturn == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    waitForm.Hide();
                    MessageBox.Show("获取日结序列号失败");
                    return;
                }
                foreach (Class.ClinicDayBalance tempBalance in this.alBalanceData)
                {
                    tempBalance.BalanceSequence = sequence;
                    tempBalance.BalanceDate     = DateTime.Parse(this.operateDate);
                    intReturn = clinicDayBalance.CreateClinicDayBalance(tempBalance);
                    if (intReturn == -1)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        waitForm.Hide();
                        MessageBox.Show("日结失败" + outpatient.Err);
                        return;
                    }
                }

                //
                // 更新其他表
                //
                // 更新发票主表表FIN_OPB_INVOICEINFO
                intReturn = outpatient.UpdateInvoiceForDayBalance(DateTime.Parse(this.lastDate),
                                                                  DateTime.Parse(this.dayBalanceDate),
                                                                  "1",
                                                                  sequence,
                                                                  DateTime.Parse(this.operateDate));
                if (intReturn <= 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    waitForm.Hide();
                    MessageBox.Show("更新发票主表失败" + outpatient.Err);
                    return;
                }
                // 更新发票明细表FIN_OPB_INVOICEDETAIL
                intReturn = outpatient.UpdateInvoiceDetailForDayBalance(DateTime.Parse(this.lastDate),
                                                                        DateTime.Parse(this.dayBalanceDate),
                                                                        "1",
                                                                        sequence,
                                                                        DateTime.Parse(this.operateDate));
                if (intReturn <= 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    waitForm.Hide();
                    MessageBox.Show("更新发票明细表失败");
                    return;
                }
                // 更新支付情况表FIN_OPB_PAYMODE
                intReturn = outpatient.UpdatePayModeForDayBalance(DateTime.Parse(this.lastDate),
                                                                  DateTime.Parse(this.dayBalanceDate),
                                                                  "1",
                                                                  sequence,
                                                                  DateTime.Parse(this.operateDate));
                if (intReturn <= 0)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    waitForm.Hide();
                    MessageBox.Show("更新支付情况表失败" + outpatient.Err);
                    return;
                }

                //
                // 保存成功
                //
                Neusoft.FrameWork.Management.PublicTrans.Commit();
                waitForm.Hide();
                MessageBox.Show("日结成功完成");
                this.PrintPanel(this.panelPrint);

                alBalanceData = null;

                // 设置上次日结时间显示
                this.ucClinicDayBalanceDateControl1.tbLastDate.Text      = this.dayBalanceDate;
                this.ucClinicDayBalanceDateControl1.dtpBalanceDate.Value = this.clinicDayBalance.GetDateTimeFromSysDateTime();
            }
        }
        /// <summary>
        /// 查询本次日结的数据
        /// </summary>
        public void QueryDayBalanceData()
        {
            //
            // 变量定义
            //
            // 返回的日结数据
            System.Data.DataSet dsBalanceDate = new DataSet();
            // 返回调用的结果
            int intReturn = 0;
            // 查询返回的结果
            ArrayList alDayBalance = new ArrayList();

            // 等待窗口
            Neusoft.FrameWork.WinForms.Forms.frmWait waitForm = new Neusoft.FrameWork.WinForms.Forms.frmWait();

            //
            // 清空现有保存的日结数据
            //
            this.alBalanceData = null;

            //
            // 获取日结截止时间
            //
            intReturn = this.ucClinicDayBalanceDateControl1.GetBalanceDate(ref dayBalanceDate);
            if (intReturn == -1)
            {
                this.enableBalance = false;
                return;
            }

            // 显示等待窗口
            waitForm.Tip = "正在获取并汇总日结数据";
            waitForm.Show();

            //
            // 获取日结数据
            //
            intReturn = this.clinicDayBalance.GetDayBalanceData(this.currentOperator.ID, this.lastDate, dayBalanceDate, ref dsBalanceDate);
            if (intReturn == -1)
            {
                waitForm.Hide();
                MessageBox.Show("获取门诊收款员的日结数据失败" + this.clinicDayBalance.Err);
                this.enableBalance = false;
                return;
            }
            if (dsBalanceDate.Tables[0].Rows.Count == 0)
            {
                waitForm.Hide();
                MessageBox.Show("该时间段没有可用的日结数据");
                this.enableBalance = false;
                return;
            }

            //
            // 计算日结数据
            //
            this.Calculate(dsBalanceDate, ref alDayBalance);

            //
            // 设置FarPoint
            //
            this.SetFarPoint(alDayBalance, this.ucClinicDayBalanceReport.fpSpread1_Sheet1);

            //
            // 保存此次查询的日结数据
            //
            this.alBalanceData = alDayBalance;

            this.enableBalance = true;
            waitForm.Hide();
        }