//中途结算标记

        //protected bool MidBalanceFlag;
        ///// <summary>
        ///// 中途结算标记

        ///// </summary>
        //public bool IsMidwayBalance
        //{
        //    get
        //    {
        //        return MidBalanceFlag;
        //    }
        //    set
        //    {
        //        MidBalanceFlag = value;
        //    }
        //}



        /// <summary>
        /// 打印控件赋值
        /// </summary>
        /// <param name="Pinfo"></param>
        /// <param name="Pinfo"></param>
        /// <param name="al">balancelist数据</param>
        /// <param name="IsPreview">是否打印其余可显示部分</param>
        /// <returns></returns>
        protected int SetPrintValue(
            Neusoft.HISFC.Models.RADT.PatientInfo patientInfo,
            Neusoft.HISFC.Models.Fee.Inpatient.Balance balanceHead,
            ArrayList alBalanceList,
            bool IsPreview)
        {
            this.Controls.Clear();
            //如果费用明细为空,则返回
            if (alBalanceList.Count <= 0)
            {
                return(-1);
            }

            #region 克隆一个费用明细信息列表,因为后面操作需要对列表元素有删除操作.
            ArrayList alBalanceListClone = new ArrayList();
            foreach (Neusoft.HISFC.Models.Fee.Inpatient.BalanceList det in alBalanceList)
            {
                alBalanceListClone.Add(det.Clone());
            }
            #endregion

            Control c;

            if (this.InvoiceType == "ZY01")
            {
                c = new ucDianLiZY01();

                this.Controls.Add(c);
                this.Size = c.Size;
                this.InitReceipt();
                SetZY01PrintValue(patientInfo,
                                  balanceHead,
                                  alBalanceListClone,
                                  IsPreview);
            }
            else if (this.InvoiceType == "ZY02")
            {
                c = new ucDianLiZY02();
                this.Controls.Add(c);
                this.Size = c.Size;
                this.InitReceipt();
                SetZY02PrintValue(patientInfo,
                                  balanceHead,
                                  alBalanceListClone,
                                  IsPreview);
            }
            else if (this.InvoiceType == "ZY03")
            {
                c = new ucDianLiZY01();
                this.Controls.Add(c);
                this.Size = c.Size;
                this.InitReceipt();
                SetZY03PrintValue(patientInfo,
                                  balanceHead,
                                  alBalanceListClone,
                                  IsPreview);
            }
            //控制根据打印和预览显示选项
            if (IsPreview)
            {
                SetToPreviewMode();
            }
            else
            {
                SetToPrintMode();
            }
            return(0);
        }
        /// <summary>
        /// 打印控件赋值
        /// </summary>
        /// <param name="Pinfo"></param>
        /// <param name="Pinfo"></param>
        /// <param name="al">balancelist数据</param>
        /// <param name="IsPreview">是否打印其余可显示部分</param>
        /// <returns></returns>
        protected int SetZY01PrintValue(
            Neusoft.HISFC.Models.RADT.PatientInfo patientInfo,
            Neusoft.HISFC.Models.Fee.Inpatient.Balance balanceHead,
            ArrayList alBalanceList,
            bool IsPreview)
        {
            #region 设置自费发票打印内容
            ucDianLiZY01 ucReceipt = (ucDianLiZY01)this.Controls[0];
            //#region 医疗机构
            //ucReceipt.lblYiLiaoJiGou.Text = "辽宁电力中心医院";
            //#endregion
            //基本信息
            ucReceipt.lblCaseNO.Text     = patientInfo.PID.CaseNO;                            //病案号
            ucReceipt.lblPrintYear.Text  = balanceHead.BalanceOper.OperTime.Year.ToString();  //年
            ucReceipt.lblPrintMonth.Text = balanceHead.BalanceOper.OperTime.Month.ToString(); //月
            ucReceipt.lblPrintDay.Text   = balanceHead.BalanceOper.OperTime.Day.ToString();   //日
            //ucReceipt.lblName.Text = patientInfo.Name;//姓名
            //住院日期
            ucReceipt.lblInTime.Text  = patientInfo.PVisit.InTime.ToShortDateString();
            ucReceipt.lblOutTime.Text = patientInfo.PVisit.OutTime.ToShortDateString();
            ucReceipt.lblInDay.Text   = new TimeSpan(patientInfo.PVisit.OutTime.Ticks - patientInfo.PVisit.InTime.Ticks).Days.ToString();
            //科室
            //ucReceipt.lblDeptName.Text = patientInfo.PVisit.PatientLocation.Dept.Name;

            //操作员
            ucReceipt.lblOperName.Text = balanceHead.BalanceOper.ID;

            //结算员
            //ucReceipt.lblBalanceName.Text = balanceHead.Oper.ID;

            //票面信息
            decimal[] FeeInfo =
                //---------------------1-----------2------------3------------4-------------5-----------------
                new decimal[18] {
                decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero,
                decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero,
                decimal.Zero, decimal.Zero, decimal.Zero,
                decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero
            };


            for (int i = 0; i < alBalanceList.Count; i++)
            {
                Neusoft.HISFC.Models.Fee.Inpatient.BalanceList detail = new Neusoft.HISFC.Models.Fee.Inpatient.BalanceList();
                detail = (Neusoft.HISFC.Models.Fee.Inpatient.BalanceList)alBalanceList[i];
                if (detail.FeeCodeStat.SortID <= FeeInfo.Length)
                {
                    FeeInfo[detail.FeeCodeStat.SortID - 1] += detail.BalanceBase.FT.TotCost;
                }
            }
            int FeeInfoIndex = 0;
            foreach (decimal d in FeeInfo)
            {
                Label l = Function.GetFeeNameLable("lblFeeInfo" + FeeInfoIndex.ToString(), ucReceipt);
                if (l != null)
                {
                    if (FeeInfo[FeeInfoIndex] > 0)
                    {
                        l.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(FeeInfo[FeeInfoIndex], 2);
                    }
                }
                FeeInfoIndex++;
            }
            //预收
            if (balanceHead.FT.PrepayCost > 0)
            {
                ucReceipt.lblPriPrepay.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.PrepayCost, 2);
            }
            //实收
            if (balanceHead.FT.SupplyCost > 0)
            {
                ucReceipt.lblPriSupply.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.OwnCost, 2);
            }
            //退款
            if (balanceHead.FT.ReturnCost > 0)
            {
                ucReceipt.lblPriReturn.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.ReturnCost, 2);
            }
            //小写总金额
            if (balanceHead.FT.TotCost > 0)
            {
                ucReceipt.lblTotCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
                ucReceipt.lblSum.Text     = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
            }
            #region 大写总金额
            ucReceipt.lblDaXie.Text = Function.GetUpperCashByNumber(Neusoft.FrameWork.Public.String.FormatNumber(balanceHead.FT.TotCost, 2));
            #endregion
            #endregion
            return(0);
        }