Beispiel #1
0
        public FrmItemList(long currentUserId, long currentDeptId, string chineseName)
        {
            InitializeComponent();
            _currentUser = new User(currentUserId);
            _currentDept = new Deptment(currentDeptId);
            _filterType  = Constant.CustomFilterType;
            _searchType  = Constant.CustomSearchType;
            this.Text    = chineseName;


            DataTable dt = BaseDataFactory.GetData(baseDataType.住院临床科室);

            this.cbDept.DataSource    = dt;
            this.cbDept.DisplayMember = "name";
            this.cbDept.ValueMember   = "code";


            this.chbDept.Checked      = true;
            this.cbDept.SelectedValue = currentDeptId.ToString();
            zy_PatList     = new ZY_PatList();
            feeBillManager = new FeeBillManager();

            this.dtpB.Value = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00");
            this.dtpE.Value = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59");

            this.cb_pattype.SelectedIndex = 0;

            this.dtpB.Enabled = false;
            this.dtpE.Enabled = false;
        }
 public FrmAllAccountController(IFrmAllAccountView _view)
 {
     view         = _view;
     zyAccount    = new AllAccountList();
     NotAccount   = new NotAllAccountList();
     view.Workers = BaseDataFactory.GetData(baseDataType.医疗机构);
 }
Beispiel #3
0
        public ZYBaseFrom()
        {
            InitializeComponent();
            DataTable dt = BaseDataFactory.GetData(baseDataType.住院临床科室);

            this.cbDept.DataSource    = dt;
            this.cbDept.DisplayMember = "name";
            zy_PatList = new ZY_PatList();
        }
Beispiel #4
0
        public FrmCollectDrug(long currentUserId, long currentDeptId, string chineseName, bool _IsOper)
        {
            InitializeComponent();

            dtDrugMessage = new DsMessageData().dtDrugMessage.Clone();

            RecDt = new DataTable();
            DataColumn col;

            col = new System.Data.DataColumn("patlistid");
            RecDt.Columns.Add(col);
            col = new System.Data.DataColumn("cureno");
            RecDt.Columns.Add(col);
            col = new System.Data.DataColumn("bedcode");
            RecDt.Columns.Add(col);
            col = new System.Data.DataColumn("Name");
            RecDt.Columns.Add(col);
            col = new System.Data.DataColumn("py_code");
            RecDt.Columns.Add(col);
            col = new System.Data.DataColumn("wb_code");
            RecDt.Columns.Add(col);

            _currentUser = new User(currentUserId);
            _currentDept = new Deptment(currentDeptId);
            this.Text    = chineseName;

            DataTable tb = BaseDataFactory.GetData(baseDataType.所有科室);

            tb.TableName = "Dept";

            this.cbPatDept.DataSource    = tb;
            this.cbPatDept.DisplayMember = "name";
            this.cbPatDept.ValueMember   = "code";

            this.cbPatDept.SelectedValue = _currentDept.DeptID;

            DataTable tb1 = HIS.ZY_BLL.DurgMessage.OP_DurgMessage.GetYfDept();

            this.cbYfDept.DataSource    = tb1;
            this.cbYfDept.DisplayMember = "name";
            this.cbYfDept.ValueMember   = "code";

            this.cbYfDept.Text = "住院药房";

            if (_IsOper == true)
            {
                this.ckdept.Enabled    = false;
                this.cbPatDept.Enabled = false;
            }

            this.ckdept.Enabled    = false;
            this.cbPatDept.Enabled = false;


            IsOper = _IsOper;
        }
        /// <summary>
        /// 创建住院结算个人交款表模板
        /// </summary>
        public static void CreateCostAccountBookTemplate()
        {
            try
            {
                GridppReport reportPrinter = new GridppReport();

                if (!Directory.Exists(System.Windows.Forms.Application.StartupPath + "\\report"))
                {
                    Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\report");
                }

                if (File.Exists(accountbookTemplatePath1))
                {
                    File.Delete(accountbookTemplatePath1);
                }

                if (!File.Exists(accountbookTemplatePath1))
                {
                    reportPrinter.InsertReportHeader();

                    DataTable dt = BaseDataFactory.GetData(baseDataType.住院发票项目);
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        reportPrinter.AddParameter(dt.Rows[i]["name"].ToString(), GRParameterDataType.grptString);
                    }

                    System.Reflection.PropertyInfo[] propertyinfos = typeof(AbstractCostAccountRpt).GetProperties();
                    for (int i = 0; i < propertyinfos.Length; i++)
                    {
                        if (propertyinfos[i].PropertyType == typeof(String))
                        {
                            reportPrinter.AddParameter(propertyinfos[i].Name, GRParameterDataType.grptString);
                        }
                    }

                    DataTable dt1 = BaseDataFactory.GetData(baseDataType.病人类型);
                    for (int i = 0; i < dt1.Rows.Count; i++)
                    {
                        reportPrinter.AddParameter(dt1.Rows[i]["name"] + "_记账_张数", GRParameterDataType.grptString);
                        reportPrinter.AddParameter(dt1.Rows[i]["name"] + "_记账", GRParameterDataType.grptString);
                    }
                    reportPrinter.AddParameter("单位_记账_张数", GRParameterDataType.grptString);
                    reportPrinter.AddParameter("单位_记账", GRParameterDataType.grptString);
                    reportPrinter.AddParameter("合计_记账_张数", GRParameterDataType.grptString);
                    reportPrinter.AddParameter("合计_记账", GRParameterDataType.grptString);

                    reportPrinter.SaveToFile(accountbookTemplatePath1);
                }
            }
            catch
            {
                MessageBox.Show("创建住院个人结算交款表模板发生错误!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Beispiel #6
0
        // 导入科室信息和诊断信息
        private void LoadINFO()
        {
            DataTable dt = BaseDataFactory.GetData(baseDataType.诊断);

            dt.TableName = "Disease";
            _dataSet.Tables.Add(dt);
            dt           = null;
            dt           = BaseDataFactory.GetData(baseDataType.住院临床科室);
            dt.TableName = "Dept";
            _dataSet.Tables.Add(dt);
        }
        /// <summary>
        /// 加载基本数据
        /// </summary>
        public void LoadINFO()
        {
            DataTable tb = null;

            if (view.PresType == PresType.划价)
            {
                tb = zyPresOrder.LoadDrugData(dept.DeptID.ToString());
            }
            else if (view.PresType == PresType.记账)
            {
                tb = zyPresOrder.LoadAllData(view.yfDeptID.ToString());
            }

            tb.TableName = "ITEM_DICTIONARY";
            if (_dataSet.Tables.Contains("ITEM_DICTIONARY"))
            {
                _dataSet.Tables.Remove("ITEM_DICTIONARY");
            }
            _dataSet.Tables.Add(tb);

            tb           = BaseDataFactory.GetData(baseDataType.医生);
            tb.TableName = "User";
            if (_dataSet.Tables.Contains("User"))
            {
                _dataSet.Tables.Remove("User");
            }
            _dataSet.Tables.Add(tb);

            tb           = BaseDataFactory.GetData(baseDataType.住院临床科室);
            tb.TableName = "Dept";
            if (_dataSet.Tables.Contains("Dept"))
            {
                _dataSet.Tables.Remove("Dept");
            }
            _dataSet.Tables.Add(tb);

            if (_dataSet.Tables.Contains("yfDept"))
            {
                _dataSet.Tables.Remove("yfDept");
            }

            tb           = BaseDataFactory.GetData(baseDataType.药房科室);
            tb.TableName = "yfDept";
            DataRow dr = tb.NewRow();

            dr["deptname"] = "全部药房";
            dr["deptid"]   = -1;
            tb.Rows.Add(dr);
            _dataSet.Tables.Add(tb);

            view.Initialize(_dataSet);
        }
        //[20100514.1.04]
        public FrmAddDrugMessage(int _masterid, User _currentUser, Deptment _currentDept, bool _IsOper)
        {
            InitializeComponent();
            IsNew = true;
            DataTable tb = BaseDataFactory.GetData(baseDataType.住院临床科室);

            tb.TableName = "Dept";

            this.cbDept.DataSource    = tb;
            this.cbDept.DisplayMember = "name";
            this.cbDept.ValueMember   = "code";
            this.cbDept.SelectedValue = _currentDept.DeptID;
            //[20100525.1.06]
            //禁用修改科室
            this.cbDept.Enabled = false;

            DataTable tb1 = HIS.ZY_BLL.DurgMessage.OP_DurgMessage.GetYfDept();

            this.comboBox1.DataSource    = tb1;
            this.comboBox1.DisplayMember = "name";
            this.comboBox1.ValueMember   = "code";
            try
            {
                this.comboBox1.SelectedValue = "1417";
            }
            catch { }
            //填充dtDrugMessage
            //BindMessageData(HIS.ZY_BLL.DurgMessage.OP_DurgMessage.GetMessageOrder());

            data[5] = _currentUser.EmployeeID.ToString();
            data[6] = _currentUser.Name;

            yfData    = HIS.ZY_BLL.DurgMessage.OP_DurgMessage.GetYfData();
            usageData = HIS.ZY_BLL.DurgMessage.OP_DurgMessage.GetUsageName();

            this.cbStatType.SelectedIndex = 0;

            currentUser = _currentUser;
            currentDept = _currentDept;
            //[20100514.1.04]
            IsOper = _IsOper;

            if (IsOper == true)
            {
                this.cbStatType.SelectedIndex = 2;
                this.tscbType.SelectedIndex   = 5;
            }
            else
            {
                this.tscbType.SelectedIndex = 0;
            }
        }
        public FrmInPatientRpt(long currentUserId, long currentDeptId, string chineseName)
        {
            InitializeComponent();

            DataTable dtdept = BaseDataFactory.GetData(baseDataType.住院临床科室);
            DataRow   dr     = dtdept.NewRow();

            dr["code"] = "-1";
            dr["name"] = "全部科室";
            dtdept.Rows.Add(dr);
            this.cbDept.DataSource    = dtdept;
            this.cbDept.DisplayMember = "name";
            this.cbDept.ValueMember   = "code";
            this.cbDept.SelectedValue = "-1";

            _user = new GWMHIS.BussinessLogicLayer.Classes.User(currentUserId);
        }
        /// <summary>
        /// 创建住院收费发票打印模板
        /// </summary>
        public static void CreateChargeInvoiceTemplate_GD()
        {
            try
            {
                GridppReport reportPrinter = new GridppReport();

                if (!Directory.Exists(System.Windows.Forms.Application.StartupPath + "\\report"))
                {
                    Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\report");
                }

                if (File.Exists(chargeInvoiceTemplatePath))
                {
                    File.Delete(chargeInvoiceTemplatePath);
                }

                if (!File.Exists(chargeInvoiceTemplatePath))
                {
                    reportPrinter.InsertReportHeader();

                    DataTable dt = BaseDataFactory.GetData(baseDataType.住院发票项目);
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        reportPrinter.AddParameter(dt.Rows[i]["name"].ToString(), GRParameterDataType.grptString);
                    }

                    System.Reflection.PropertyInfo[] propertyinfos = typeof(Invoice_GD).GetProperties();
                    for (int i = 0; i < propertyinfos.Length; i++)
                    {
                        if (propertyinfos[i].PropertyType == typeof(String))
                        {
                            reportPrinter.AddParameter(propertyinfos[i].Name, GRParameterDataType.grptString);
                        }
                    }
                    reportPrinter.SaveToFile(chargeInvoiceTemplatePath);
                }
            }
            catch
            {
                MessageBox.Show("创建住院发票模板发生错误!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Beispiel #11
0
        /// <summary>
        /// 加载ShowCard数据
        /// </summary>
        private void LoadINFO()
        {
            //加载病人诊断
            DataTable dt = BaseDataFactory.GetData(baseDataType.诊断);

            dt.TableName = "Disease";
            _dataSet.Tables.Add(dt);

            //加载病人类型
            dt           = BaseDataFactory.GetData(baseDataType.病人类型);
            dt.TableName = "PatientType";
            _dataSet.Tables.Add(dt);

            //加载民族信息
            dt           = BaseDataFactory.GetData(baseDataType.民族);
            dt.TableName = "Nationco";
            _dataSet.Tables.Add(dt);

            //加载全院所有用户
            dt           = BaseDataFactory.GetData(baseDataType.所有用户);
            dt.TableName = "User";
            _dataSet.Tables.Add(dt);

            //加载医生
            dt           = BaseDataFactory.GetData(baseDataType.医生);
            dt.TableName = "UserDoc";
            _dataSet.Tables.Add(dt);

            //加载住院临床科室
            dt = BaseDataFactory.GetData(baseDataType.住院临床科室);
            DataTable dtBk = dt;

            dt.TableName = "Dept";
            _dataSet.Tables.Add(dt);

            //加载全院的临床科室
            dt           = BaseDataFactory.GetData(baseDataType.全院临床科室);
            dt.TableName = "LCDept";
            _dataSet.Tables.Add(dt);
        }
        public FrmOutPatientRpt(long currentUserId, long currentDeptId, string chineseName)
        {
            InitializeComponent();

            DateTime dateNow = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;

            dateTimePicker1.Value = Convert.ToDateTime(dateNow.ToString("yyyy-MM-dd") + " 00:00:00");
            dateTimePicker2.Value = Convert.ToDateTime(dateNow.ToString("yyyy-MM-dd") + " 23:59:59");

            DataTable dtdept = BaseDataFactory.GetData(baseDataType.住院临床科室);
            DataRow   dr     = dtdept.NewRow();

            dr["code"] = "-1";
            dr["name"] = "全部科室";
            dtdept.Rows.Add(dr);
            this.cbDept.DataSource      = dtdept;
            this.cbDept.DisplayMember   = "name";
            this.cbDept.ValueMember     = "code";
            this.cbDept.SelectedValue   = "-1";
            dgvData.AutoGenerateColumns = false;
            _user = new GWMHIS.BussinessLogicLayer.Classes.User(currentUserId);
        }
        /// <summary>
        /// 根据交款ID得到结算交款表对象
        /// </summary>
        /// <param name="rpt">结算交款表对象</param>
        /// <param name="Accountid">交款ID</param>
        public void GetAccountRptInfo(AbstractCostAccountRpt rpt, int[] Accountids, int type)
        {
            AllAccount        zyAccount  = new AllAccount();
            List <ZY_Account> zyAccounts = zyAccount.GetAccounts(Accountids, type);

            CommMethod.list_AddString.Clear();
            for (int i = 0; i < zyAccounts.Count; i++)
            {
                rpt.交款人 = CommMethod.AddString(zyAccounts[i].AccountName);
            }

            rpt.医院名称 = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName + "住院每日缴款清单";
            rpt.交款时间 = zyAccounts[0].AccountDate.ToString();

            #region 发票项目
            DataTable dt       = zyAccount.GetTicketTotle(Accountids);
            decimal   AllKMFee = 0;
            //dt = null;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                AllKMFee += Convert.ToDecimal(dt.Rows[i]["Tolal_Fee"]);
            }


            #endregion
            rpt.发票项目   = dt;
            rpt.发票科目合计 = AllKMFee.ToString();
            List <ZY_CostMaster> zy_CML = zyAccount.GetCostData(Accountids);
            if (zy_CML != null && zy_CML.Count > 0)
            {
                #region 收费票据

                rpt.收费发票开始号 = zy_CML[0].TicketCode;
                rpt.收费发票结束号 = zy_CML[zy_CML.Count - 1].TicketCode;
                rpt.收费发票张数  = zy_CML.Count.ToString();
                List <ZY_CostMaster> zy_CMLx = zy_CML.FindAll(delegate(ZY_CostMaster x) { return(x.Record_Flag == 2); });
                rpt.收费退费张数 = zy_CMLx.Count.ToString();
                rpt.收费退费金额 = zy_CMLx.Sum(x => x.Total_Fee).ToString();
                rpt.废票张数   = zyAccount.GetBadTicketCount(Accountids).ToString();
                #endregion

                #region 记账部分
                DataTable             dt1  = BaseDataFactory.GetData(baseDataType.病人类型);
                List <AccountPatType> apts = new List <AccountPatType>();
                AccountPatType        apt;
                int AllNum = 0;
                for (int i = 0; i < dt1.Rows.Count; i++)
                {
                    List <ZY_CostMaster> zy_CMLy = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.PatType.Trim() == dt1.Rows[i]["code"].ToString()); });
                    apt          = new AccountPatType();
                    apt.TypeName = dt1.Rows[i]["name"].ToString();
                    apt.CostNum  = zy_CMLy.Count.ToString();
                    apt.CostFee  = zy_CMLy.Sum(x => x.NotWorkUnit_Fee).ToString();
                    apts.Add(apt);
                    AllNum += zy_CMLy.Count;
                }

                apt = new AccountPatType();
                //单位
                List <ZY_CostMaster> zy_CMLy5 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.WorkUnit_Fee != 0); });
                apt.TypeName = "单位";
                apt.CostNum  = zy_CMLy5.Count.ToString();
                apt.CostFee  = zy_CMLy5.Sum(y => y.WorkUnit_Fee).ToString();
                apts.Add(apt);
                //合计
                apt          = new AccountPatType();
                apt.TypeName = "合计";
                apt.CostNum  = (AllNum + zy_CMLy5.Count).ToString();
                apt.CostFee  = zy_CML.Sum(y => y.Village_Fee).ToString();
                apts.Add(apt);

                rpt.记账内容 = apts.ToArray();

                #endregion

                #region 收现金

                rpt.优惠金额 = zy_CML.Sum(z => z.Favor_Fee).ToString();
                rpt.应收金额 = zy_CML.Sum(z => z.Self_Fee).ToString();
                rpt.预收金额 = zy_CML.Sum(z => z.Deptosit_Fee).ToString();
                decimal decR = zy_CML.Sum(z => z.Reality_Fee);
                //补收
                List <ZY_CostMaster> zy_CML11 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Reality_Fee > 0); });
                //补退
                List <ZY_CostMaster> zy_CML22 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Reality_Fee < 0); });
                //欠费
                List <ZY_CostMaster> zy_CML33 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Ntype == 3); });

                rpt.补收金额 = zy_CML11.Sum(x => x.Reality_Fee).ToString("0.00");
                rpt.补退金额 = (0 - zy_CML22.Sum(x => x.Reality_Fee)).ToString("0.00");
                rpt.实收金额 = decR.ToString();
                rpt.小写合计 = decR.ToString();
                rpt.大写合计 = decR.ToString();

                List <ZY_ChargeList> zy_cl = zyAccount.GetChargeListData(Accountids);
                //现金
                List <ZY_ChargeList> zy_cl0 = zy_cl.FindAll(x => x.FeeType == 0);
                //POS
                List <ZY_ChargeList> zy_cl1 = zy_cl.FindAll(x => x.FeeType == 1);
                rpt.预交金现金   = zy_cl0.Sum(x => x.Total_Fee).ToString();
                rpt.预交金POS  = zy_cl1.Sum(x => x.Total_Fee).ToString();
                rpt.补收金额现金  = zy_CML11.Sum(x => x.Money_Fee).ToString();
                rpt.补收金额POS = zy_CML11.Sum(x => x.Pos_Fee).ToString();
                rpt.费金额     = zy_CML33.Sum(x => (x.Self_Fee - x.Deptosit_Fee)).ToString();
                #endregion
            }
        }
Beispiel #14
0
        /// <summary>
        /// 根据交款ID得到结算交款表对象
        /// </summary>
        /// <param name="rpt">结算交款表对象</param>
        /// <param name="Accountid">交款ID</param>
        public void GetAccountRptInfo(AbstractCostAccountRpt_sz rpt, int Accountid)
        {
            ZY_Account zyAccount = new ZY_Account();

            zyAccount = zyAccount.GetAccount(Accountid);
            rpt.交款单位  = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName + "住院每日缴款清单";
            rpt.交款人   = zyAccount.AccountName;
            rpt.交款时间  = zyAccount.AccountDate.ToString();

            //#region 发票项目
            //DataTable dt = zyAccount.GetTicketTotle(Accountid);
            //decimal AllKMFee = 0;
            ////dt = null;
            //for (int i = 0; i < dt.Rows.Count; i++)
            //{
            //    AllKMFee += Convert.ToDecimal(dt.Rows[i]["Tolal_Fee"]);
            //}


            //#endregion

            //rpt.发票项目 = dt;
            //rpt.发票科目合计 = AllKMFee.ToString();
            decimal[] dec = zyAccount.GetTotleType(Accountid);
            rpt.药品收入     = dec[0].ToString();
            rpt.医疗收入     = dec[1].ToString();
            rpt.其他收入     = dec[2].ToString();
            rpt.应用金额大写合计 = (dec[0] + dec[1]).ToString();
            rpt.应用金额小写合计 = (dec[0] + dec[1]).ToString();

            List <ZY_CostMaster> zy_CML = zyAccount.GetCostData(Accountid);

            if (zy_CML != null && zy_CML.Count > 0)
            {
                #region 收费票据

                rpt.收费发票开始号 = zy_CML[0].TicketCode;
                rpt.收费发票结束号 = zy_CML[zy_CML.Count - 1].TicketCode;
                rpt.收费发票张数  = zy_CML.Count.ToString();
                List <ZY_CostMaster> zy_CMLx = zy_CML.FindAll(delegate(ZY_CostMaster x) { return(x.Record_Flag == 2); });
                rpt.收费退费张数 = zy_CMLx.Count.ToString();
                rpt.收费退费金额 = zy_CMLx.Sum(x => x.Total_Fee).ToString();
                rpt.废票张数   = zyAccount.GetBadTicketCount(Accountid).ToString();
                #endregion

                #region 记账部分
                DataTable             dt1  = BaseDataFactory.GetData(baseDataType.病人类型);
                DataTable             dt2  = BaseDataFactory.GetData(baseDataType.记账单位);
                List <AccountPatType> apts = new List <AccountPatType>();
                AccountPatType        apt;
                //int AllNum = 0;
                //医保、农合(病人类型)
                for (int i = 0; i < dt1.Rows.Count; i++)
                {
                    List <ZY_CostMaster> zy_CMLy = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.PatType.Trim() == dt1.Rows[i]["code"].ToString()); });
                    apt          = new AccountPatType();
                    apt.TypeName = dt1.Rows[i]["name"].ToString();
                    apt.CostNum  = zy_CMLy.Count.ToString();
                    apt.CostFee  = zy_CMLy.Sum(x => x.NotWorkUnit_Fee).ToString();
                    apts.Add(apt);
                    //AllNum += zy_CMLy.Count;
                }

                //单位集合
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    apt = new AccountPatType();

                    List <ZY_CostMaster> zy_CMLy = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.WorkUnit_Fee != 0 && y.WorkUnit.Trim() == dt2.Rows[i]["code"].ToString()); });
                    apt.TypeName = dt2.Rows[i]["name"].ToString();
                    apt.CostNum  = zy_CMLy.Count.ToString();
                    apt.CostFee  = zy_CMLy.Sum(y => y.WorkUnit_Fee).ToString();
                    apts.Add(apt);
                }
                //刷卡(POS)
                apt = new AccountPatType();
                List <ZY_CostMaster> zy_CMLy5 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Pos_Fee != 0); });
                apt.TypeName = "银联刷卡";
                apt.CostNum  = (zy_CMLy5.Count).ToString();
                apt.CostFee  = zy_CMLy5.Sum(y => y.Pos_Fee).ToString();
                apts.Add(apt);

                //大写合计
                apt          = new AccountPatType();
                apt.TypeName = "大写合计";
                apt.CostNum  = (zy_CML.Count).ToString();
                apt.CostFee  = zy_CML.Sum(y => y.Village_Fee).ToString();
                apts.Add(apt);
                //小写合计
                apt          = new AccountPatType();
                apt.TypeName = "小写合计";
                apt.CostNum  = (zy_CML.Count).ToString();
                apt.CostFee  = zy_CML.Sum(y => y.Village_Fee).ToString();
                apts.Add(apt);
                rpt.记账内容 = apts.ToArray();

                #endregion

                #region 收现金

                rpt.折扣金额 = zy_CML.Sum(z => z.Favor_Fee).ToString();
                rpt.应收金额 = zy_CML.Sum(z => z.Self_Fee).ToString();
                rpt.预收金额 = zy_CML.Sum(z => z.Deptosit_Fee).ToString();
                decimal decR = zy_CML.Sum(z => z.Reality_Fee);
                //补收
                List <ZY_CostMaster> zy_CML11 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Reality_Fee > 0); });
                //补退
                List <ZY_CostMaster> zy_CML22 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Reality_Fee < 0); });
                //欠费
                List <ZY_CostMaster> zy_CML33 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Ntype == 3); });

                rpt.补收金额 = zy_CML11.Sum(x => x.Reality_Fee).ToString("0.00");
                rpt.补退金额 = (0 - zy_CML22.Sum(x => x.Reality_Fee)).ToString("0.00");
                rpt.实收金额 = decR.ToString();
                rpt.小写合计 = decR.ToString();
                rpt.大写合计 = decR.ToString();

                List <ZY_ChargeList> zy_cl = zyAccount.GetChargeListData(Accountid);
                //现金
                List <ZY_ChargeList> zy_cl0 = zy_cl.FindAll(x => x.FeeType == 0);
                //POS
                List <ZY_ChargeList> zy_cl1 = zy_cl.FindAll(x => x.FeeType == 1);
                rpt.预交金现金   = zy_cl0.Sum(x => x.Total_Fee).ToString();
                rpt.预交金POS  = zy_cl1.Sum(x => x.Total_Fee).ToString();
                rpt.补收金额现金  = zy_CML11.Sum(x => x.Money_Fee).ToString();
                rpt.补收金额POS = zy_CML11.Sum(x => x.Pos_Fee).ToString();
                rpt.费金额     = zy_CML33.Sum(x => (x.Self_Fee - x.Deptosit_Fee)).ToString();
                #endregion
            }
        }
        //[20100514.1.04]
        public FrmAddDrugMessage(int _masterid, User _currentUser, Deptment _currentDept, string _deptCode, string _yfCode, bool _IsDrug, int _StatType, DataTable _dt, bool _IsOper)
        {
            InitializeComponent();
            IsNew = false;
            DataTable tb = BaseDataFactory.GetData(baseDataType.住院临床科室);

            tb.TableName = "Dept";

            this.cbDept.DataSource    = tb;
            this.cbDept.DisplayMember = "name";
            this.cbDept.ValueMember   = "code";

            DataTable tb1 = HIS.ZY_BLL.DurgMessage.OP_DurgMessage.GetYfDept();

            this.comboBox1.DataSource    = tb1;
            this.comboBox1.DisplayMember = "name";
            this.comboBox1.ValueMember   = "code";

            //修改统领单

            Masterid = _masterid;

            //
            //填充dtDrugMessage
            BindMessageData(_dt);
            //绑定数据PresOrder
            this.radioButton1.Checked     = _IsDrug;
            this.cbStatType.SelectedIndex = _StatType;
            this.cbDept.SelectedValue     = _deptCode;
            this.comboBox1.SelectedValue  = _yfCode;
            this.panel9.Enabled           = false;
            data[1] = _deptCode;
            BindData(_deptCode, _IsDrug, _StatType);
            //显示

            ShowData();
            ShowStatData();



            data[5] = _currentUser.EmployeeID.ToString();
            data[6] = _currentUser.Name;

            yfData    = HIS.ZY_BLL.DurgMessage.OP_DurgMessage.GetYfData();
            usageData = HIS.ZY_BLL.DurgMessage.OP_DurgMessage.GetUsageName();

            currentUser = _currentUser;
            currentDept = _currentDept;
            //[20100514.1.04]
            IsOper = _IsOper;

            if (IsOper == true)
            {
                this.cbStatType.SelectedIndex = 2;
                this.tscbType.SelectedIndex   = 5;
            }
            else
            {
                this.tscbType.SelectedIndex = 0;
            }
        }