コード例 #1
0
ファイル: clsControlChargeCheck.cs プロジェクト: iamwsx05/HIS
        public void m_mthBegionPrint(System.Drawing.Printing.PrintEventArgs e)
        {
            if (dtChargeCheck.Rows.Count == 0 && this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber < 0)
            {
                e.Cancel = true;
                return;
            }
            string    strSEQID   = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 3].ToString();
            DataTable dtChargeDe = new DataTable();
            DataView  dv;

            if ((string)this.m_objViewer.DgChargeCheck.Tag == "dtChargeCheck")
            {
                dv = m_dvRegister;
                //strSEQID=m_dvRegister[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["流水号"].ToString();
            }
            else
            {
                dv = m_dvRegisterfind;
                //strSEQID=m_dvRegisterfind[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["流水号"].ToString();
            }
            if (strSEQID == "")
            {
                e.Cancel = true;
                return;
            }
            Domain.m_lngGetRecipeDate(strSEQID, out dtChargeDe); //获取明细数据

            obj_VO.m_strHospitalName = this.m_objComInfo.m_strGetHospitalTitle();
            obj_VO.m_strPrintDate    = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 13].ToString(); //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["记录时间"].ToString();//打印时间
            obj_VO.m_strCardID       = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 0].ToString();  //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["诊疗卡号"].ToString();//打印时间
            obj_VO.strInvoiceNO      = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 1].ToString();  //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["发票编号"].ToString();//打印时间
            obj_VO.m_strPatientName  = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 5].ToString();  //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["病人名称"].ToString();//打印时间
            obj_VO.m_strPatientType  = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 4].ToString();  //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["病人身份"].ToString();//打印时间
            //			obj_VO.m_strPrintDate =dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["记录时间"].ToString();//打印时间
            //			obj_VO.m_strPrintDate =dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["记录时间"].ToString();//打印时间
            obj_VO.m_strChargeUp   = "";
            obj_VO.m_strSelfPay    = "";
            obj_VO.m_strEmployer   = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 20].ToString(); // dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["工作单位"].ToString();
            obj_VO.m_strDiagDrName = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 11].ToString(); //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["医生名称"].ToString();
            ArrayList objItemArr = new ArrayList();
            decimal   MoneyAll   = 0;

            if (dtChargeDe.Rows.Count > 0)
            {
                for (int i1 = 0; i1 < dtChargeDe.Rows.Count; i1++)
                {
                    clsOutpatientPrintRecipeDetail_VO objDetail = new clsOutpatientPrintRecipeDetail_VO();
                    decimal totalMoney = 0;
                    objDetail.m_strChargeName = dtChargeDe.Rows[i1]["NAME"].ToString().Trim();
                    objDetail.m_strSpec       = dtChargeDe.Rows[i1]["DEC"].ToString().Trim();
                    objDetail.m_strFrequency  = dtChargeDe.Rows[i1]["PDCAREA_VCHR"].ToString().Trim();//这里用了频率存放了生产地
                    objDetail.m_strUnit       = dtChargeDe.Rows[i1]["UINT"].ToString().Trim();
                    objDetail.m_strPrice      = dtChargeDe.Rows[i1]["PRICE"].ToString().Trim();
                    objDetail.m_strCount      = dtChargeDe.Rows[i1]["COUNT"].ToString().Trim();
                    if (dtChargeDe.Rows[i1]["NAME"].ToString().IndexOf("挂号费") != -1)
                    {
                        obj_VO.m_strRegisterFee = ((decimal)(clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["COUNT"]) * clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["PRICE"]))).ToString("0.00");
                    }
                    if (dtChargeDe.Rows[i1]["NAME"].ToString().IndexOf("诊金") != -1)
                    {
                        obj_VO.m_strTreatFee = ((decimal)(clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["COUNT"]) * clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["PRICE"]))).ToString("0.00");
                    }
                    totalMoney = clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["COUNT"]) * clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["PRICE"]);
                    totalMoney = Convert.ToDecimal(totalMoney.ToString("0.00"));
                    objDetail.m_strSumPrice = totalMoney.ToString("0.00");
                    MoneyAll += totalMoney;
                    objDetail.m_decTolDiffPrice = clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["toldiffprice_mny"]);// 总让利金额
                    objItemArr.Add(objDetail);
                }
                if (dtChargeDe.Rows[0]["ACCTSUM_MNY"] != null && dtChargeDe.Rows[0]["ACCTSUM_MNY"].ToString().Trim() != string.Empty)
                {
                    obj_VO.m_strChargeUp = double.Parse(dtChargeDe.Rows[0]["ACCTSUM_MNY"].ToString()).ToString("0.00");
                }
                if (dtChargeDe.Rows[0]["sbsum_mny"] != null && dtChargeDe.Rows[0]["sbsum_mny"].ToString().Trim() != string.Empty)
                {
                    obj_VO.m_strSelfPay = double.Parse(dtChargeDe.Rows[0]["sbsum_mny"].ToString()).ToString("0.00");
                }
                obj_VO.strCheckOutName = dtChargeDe.Rows[0]["LASTNAME_VCHR"].ToString();
            }
            obj_VO.objPRDArr        = objItemArr;
            obj_VO.m_strRecipePrice = MoneyAll.ToString("0.00");
            obj_VO.m_strINSURANCEID = Domain.m_strGetpatientidentityno(obj_VO.strInvoiceNO);
            isOtherPage             = false;
            currRows = 0;
        }