Ejemplo n.º 1
0
        public void m_frmLoad()
        {
            decimal totalACCTSUM = 0;
            decimal totalSBSUM   = 0;
            decimal totalSUM     = 0;
            string  strDateStart = this.m_objViewer.m_datFirstdate.Value.ToShortDateString();
            string  strDateEnd   = this.m_objViewer.m_datLastdate.Value.ToShortDateString();

            if (this.m_objViewer.Scope == "0")
            {
                Domain.m_lngGetChargeByDate(strDateStart, strDateEnd, out dtChargeCheck, this.m_objViewer.blnOnlySelectVip, this.m_objViewer.chkWechatRePrt.Checked);
            }
            else if (this.m_objViewer.Scope == "1")
            {
                Domain.m_lngGetChargeByempid(strDateStart, strDateEnd, this.m_objViewer.LoginInfo.m_strEmpID, out dtChargeCheck, this.m_objViewer.blnOnlySelectVip, this.m_objViewer.chkWechatRePrt.Checked);
            }
            intDiffPriceOn = clsPublic.m_intGetSysParm("9002"); // 让利启用开关
            #region 改变表的列名
            int n = -1;
            dtChargeCheck.Columns[++n].ColumnName = "诊疗卡号";
            dtChargeCheck.Columns[++n].ColumnName = "发票编号";
            dtChargeCheck.Columns[++n].ColumnName = "重打发票号";
            dtChargeCheck.Columns[++n].ColumnName = "流水号";
            dtChargeCheck.Columns[++n].ColumnName = "病人身份";
            dtChargeCheck.Columns[++n].ColumnName = "病人名称";
            dtChargeCheck.Columns[++n].ColumnName = "性别";
            dtChargeCheck.Columns[++n].ColumnName = "支付类型";
            dtChargeCheck.Columns[++n].ColumnName = "发票日期";
            dtChargeCheck.Columns[++n].ColumnName = "发票状态";
            dtChargeCheck.Columns[++n].ColumnName = "科室名称";
            dtChargeCheck.Columns[++n].ColumnName = "医生名称";
            dtChargeCheck.Columns[++n].ColumnName = "缴费状态";
            dtChargeCheck.Columns[++n].ColumnName = "记录时间";
            dtChargeCheck.Columns[++n].ColumnName = "收费员";
            dtChargeCheck.Columns[++n].ColumnName = "结帐员";
            dtChargeCheck.Columns[++n].ColumnName = "记帐金额";
            dtChargeCheck.Columns[++n].ColumnName = "自付金额";
            dtChargeCheck.Columns[++n].ColumnName = "合计金额";
            dtChargeCheck.Columns[++n].ColumnName = "处方号";
            ++n;
            dtChargeCheck.Columns[++n].ColumnName = "工作单位";
            // 总让利金额,实付金额
            if (intDiffPriceOn == 1)
            {
                dtChargeCheck.Columns[++n].ColumnName = "药品已让利";
                dtChargeCheck.Columns[++n].ColumnName = "实付金额";
            }

            #endregion
            if (dtChargeCheck.Rows.Count > 0)
            {
                for (int i1 = 0; i1 < dtChargeCheck.Rows.Count; i1++)
                {
                    totalACCTSUM += Convert.ToDecimal(dtChargeCheck.Rows[i1]["记帐金额"].ToString());
                    totalSBSUM   += Convert.ToDecimal(dtChargeCheck.Rows[i1]["自付金额"].ToString());
                    if (dtChargeCheck.Rows[i1]["合计金额"].ToString() != string.Empty)
                    {
                        totalSUM += Convert.ToDecimal(dtChargeCheck.Rows[i1]["合计金额"].ToString());
                    }
                    else
                    {
                        totalSUM += 0;
                    }
                }
                DataRow newRow = dtChargeCheck.NewRow();
                newRow["诊疗卡号"] = "总发票数";
                newRow["发票编号"] = dtChargeCheck.Rows.Count.ToString();
                newRow["结帐员"]  = "总金额";
                newRow["记帐金额"] = totalACCTSUM;
                newRow["自付金额"] = totalSBSUM;
                newRow["合计金额"] = totalSUM;
                dtChargeCheck.Rows.Add(newRow);
            }
            this.m_dvRegister = dtChargeCheck.DefaultView;
            this.m_objViewer.DgChargeCheck.SetDataBinding(m_dvRegister, null);
            this.m_objViewer.DgChargeCheck.Tag            = "dtChargeCheck";
            this.m_objViewer.DgChargeCheck.RowHeaderWidth = 10;
            this.m_objViewer.DgChargeCheck.m_SetDgrStyle();
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["发票日期"].Width += 6;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["诊疗卡号"].Width  = 80;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["流水号"].Width   = 100;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["记录时间"].Width  = 120;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["性别"].Width    = 40;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["科室名称"].Width  = 120;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["收费员"].Width   = 60;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["结帐员"].Width   = 60;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["发票编号"].Width  = 80;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["工作单位"].Width  = 0;
            this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["重打发票号"].Width = 80;
            if (intDiffPriceOn == 1)
            {
                this.m_objViewer.DgChargeCheck.TableStyles[0].GridColumnStyles["药品已让利"].Width = 90;
            }
            #region 填充Combox
            if (this.m_objViewer.m_cboFildName.Items.Count == 0)
            {
                int j6 = 0;
                m_objViewer.m_cboSub1.Items.Add("");
                m_objViewer.m_cboSub2.Items.Add("");
                foreach (DataColumn dc in dtChargeCheck.Columns)
                {
                    j6++;
                    if (dc.ColumnName.IndexOf("ID") >= 0)
                    {
                        continue;
                    }
                    if (dc.ColumnName == "流水号" || dc.ColumnName == "性别" || dc.ColumnName == "记帐金额" || dc.ColumnName == "自付金额" || dc.ColumnName == "合计金额")
                    {
                        continue;
                    }
                    else if (j6 <= 20)
                    {
                        this.m_objViewer.m_cboFildName.Items.Add(dc.ColumnName);
                        this.m_objViewer.m_cboSub1.Items.Add(dc.ColumnName);
                        this.m_objViewer.m_cboSub2.Items.Add(dc.ColumnName);
                    }
                    if (this.m_objViewer.m_cboFildName.Items.Count > 0)
                    {
                        this.m_objViewer.m_cboFildName.SelectedIndex = 0;
                        this.m_objViewer.m_cboSub1.SelectedIndex     = 0;
                        this.m_objViewer.m_cboSub2.SelectedIndex     = 0;
                    }
                }
            }
            #endregion
        }