private clsOutpatientPrintRecipe_VO m_mthGetPrintVo(string strID) { clsOutpatientPrintRecipe_VO obj_VO = new clsOutpatientPrintRecipe_VO(); objSvc = new clsDcl_ShowReports(); DataTable dt; long ret = objSvc.m_mthGetRecipeInfo(strID, out dt); if (ret > 0 && dt.Rows.Count > 0) { obj_VO.m_strDiagDeptID = dt.Rows[0]["DEPTNAME_CHR"].ToString().Trim(); obj_VO.m_strDiagDrName = dt.Rows[0]["DOCTORNAME_CHR"].ToString().Trim(); obj_VO.m_strRegisterID = ""; obj_VO.m_strSelfPay = dt.Rows[0]["SBSUM_MNY"].ToString().Trim(); obj_VO.m_strChargeUp = dt.Rows[0]["ACCTSUM_MNY"].ToString().Trim(); obj_VO.m_strRecipePrice = dt.Rows[0]["TOTALSUM_MNY"].ToString().Trim(); obj_VO.m_strPrintDate = dt.Rows[0]["INVDATE_DAT"].ToString().Trim().Substring(0, 10); obj_VO.m_strAddress = dt.Rows[0]["HOMEADDRESS_VCHR"].ToString().Trim(); obj_VO.m_strGOVCARD = dt.Rows[0]["GOVCARD_CHR"].ToString().Trim(); obj_VO.m_strINSURANCEID = dt.Rows[0]["INSURANCEID_VCHR"].ToString().Trim(); DateTime dteBirth = Convert.ToDateTime(dt.Rows[0]["BIRTH_DAT"].ToString()); obj_VO.m_strAge = clsCreatFile.s_strCalAge(dteBirth); obj_VO.m_strCardID = dt.Rows[0]["PATIENTCARDID_CHR"].ToString().Trim(); obj_VO.m_strHospitalName = strHospitalName; obj_VO.m_strPatientName = dt.Rows[0]["LASTNAME_VCHR"].ToString().Trim(); obj_VO.m_strSex = dt.Rows[0]["SEX_CHR"].ToString().Trim(); obj_VO.m_strRecipeType = dt.Rows[0]["RECIPEFLAG_INT"].ToString().Trim(); obj_VO.m_strHerbalmedicineUsage = ""; obj_VO.strInvoiceNO = dt.Rows[0]["INVOICENO_VCHR"].ToString().Trim(); obj_VO.m_strRecordEmpID = dt.Rows[0]["TYPENAME_VCHR"].ToString().Trim(); obj_VO.m_strPatientType = dt.Rows[0]["PAYTYPENAME_VCHR"].ToString().Trim(); obj_VO.m_strdiagnose = dt.Rows[0]["DIAG_VCHR"].ToString().Trim(); } obj_VO.m_strTimes = "1"; obj_VO.m_strRecipeID = strID; clsDcl_DoctorWorkstation objDKSvc = new clsDcl_DoctorWorkstation(); dt = null; decimal decWMedicineCost = 0; decimal decZCMedicineCost = 0; decimal decCureCost = 0; System.Collections.ArrayList objPRDArr = new System.Collections.ArrayList(); string[] IDarr = null; objSvc.m_mthGetRecipeGroup(strID, out IDarr); foreach (string TempID in IDarr) { ret = objDKSvc.m_mthFindRecipeDetail1(TempID, out dt, true); //西药 if (ret > 0 && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO(); objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME_VCHR"].ToString().Trim(); objtemp.m_strCount = dt.Rows[i]["TOLQTY_DEC"].ToString().Trim() + dt.Rows[i]["UNITID_CHR"].ToString(); objtemp.m_strPrice = clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["UNITPRICE_MNY"]).ToString("0.00"); objtemp.m_strSumPrice = dt.Rows[i]["TOLPRICE_MNY"].ToString().Trim(); objtemp.m_strUnit = dt.Rows[i]["DOSAGEUNIT_CHR"].ToString().Trim(); objtemp.m_strFrequency = dt.Rows[i]["FREQNAME_CHR"].ToString().Trim(); objtemp.m_strDosage = dt.Rows[i]["QTY_DEC"].ToString().Trim() + dt.Rows[i]["DOSAGEUNIT_CHR"].ToString().Trim(); objtemp.m_strDays = dt.Rows[i]["DAYS_INT"].ToString().Trim(); objtemp.m_strSpec = dt.Rows[i]["ITEMSPEC_VCHR"].ToString().Trim(); objtemp.m_strUsage = dt.Rows[i]["USAGENAME_VCHR"].ToString().Trim(); objtemp.m_strRowNo = dt.Rows[i]["ROWNO_CHR"].ToString().Trim(); objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim(); decWMedicineCost += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["TOLPRICE_MNY"]); objPRDArr.Add(objtemp); } } } System.Collections.ArrayList objPRDArr2 = new System.Collections.ArrayList(); foreach (string TempID in IDarr) { ret = objDKSvc.m_mthFindRecipeDetail2(TempID, out dt, true); //中药 if (ret > 0 && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO(); objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString().Trim(); objtemp.m_strDosage = dt.Rows[i]["MIN_QTY_DEC"].ToString().Trim() + dt.Rows[i]["UNIT"].ToString(); objtemp.m_strPrice = dt.Rows[i]["price"].ToString().Trim(); objtemp.m_strSumPrice = dt.Rows[i]["SUMMONEY"].ToString().Trim(); objtemp.m_strUsage = dt.Rows[i]["USAGENAME_VCHR"].ToString(); objtemp.m_strRowNo = dt.Rows[i]["ROWNO_CHR"].ToString(); objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim(); decZCMedicineCost += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]); objPRDArr2.Add(objtemp); } } } obj_VO.objinjectArr = new System.Collections.ArrayList(); foreach (string TempID in IDarr) { ret = objDKSvc.m_mthFindRecipeDetail3(TempID, out dt, true); if (ret > 0 && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO(); objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString();; objtemp.m_strCount = dt.Rows[i]["quantity"].ToString().Trim(); objtemp.m_strPrice = dt.Rows[i]["PRICE"].ToString(); objtemp.m_strSumPrice = dt.Rows[i]["SUMMONEY"].ToString().Trim(); objtemp.m_strUnit = dt.Rows[i]["UNIT"].ToString().Trim(); objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim(); objtemp.m_strFrequency = ""; objtemp.m_strDosage = ""; objtemp.m_strDays = ""; objtemp.m_strUsage = ""; objtemp.m_strRowNo = ""; decCureCost += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]); obj_VO.objinjectArr.Add(objtemp); } } ret = objDKSvc.m_mthFindRecipeDetail4(TempID, out dt, true); if (ret > 0 && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO(); objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString();; objtemp.m_strCount = dt.Rows[i]["quantity"].ToString().Trim(); objtemp.m_strPrice = dt.Rows[i]["PRICE"].ToString(); objtemp.m_strSumPrice = dt.Rows[i]["SUMMONEY"].ToString().Trim(); objtemp.m_strUnit = dt.Rows[i]["UNIT"].ToString().Trim(); objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim(); objtemp.m_strFrequency = ""; objtemp.m_strDosage = ""; objtemp.m_strDays = ""; objtemp.m_strUsage = ""; objtemp.m_strRowNo = ""; decCureCost += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]); obj_VO.objinjectArr.Add(objtemp); } } ret = objDKSvc.m_mthFindRecipeDetail5(TempID, out dt, true); if (ret > 0 && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO(); objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString();; objtemp.m_strCount = dt.Rows[i]["quantity"].ToString().Trim(); objtemp.m_strPrice = dt.Rows[i]["PRICE"].ToString(); objtemp.m_strSumPrice = dt.Rows[i]["SUMMONEY"].ToString().Trim(); objtemp.m_strUnit = dt.Rows[i]["UNIT"].ToString().Trim(); objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim(); objtemp.m_strFrequency = ""; objtemp.m_strDosage = ""; objtemp.m_strDays = ""; objtemp.m_strUsage = ""; objtemp.m_strRowNo = ""; decCureCost += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]); obj_VO.objinjectArr.Add(objtemp); } } ret = objDKSvc.m_mthFindRecipeDetail6(TempID, out dt, true); if (ret > 0 && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO(); objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString();; objtemp.m_strCount = dt.Rows[i]["quantity"].ToString().Trim(); objtemp.m_strPrice = dt.Rows[i]["PRICE"].ToString(); objtemp.m_strSumPrice = dt.Rows[i]["SUMMONEY"].ToString().Trim(); objtemp.m_strUnit = dt.Rows[i]["UNIT"].ToString().Trim(); objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim(); objtemp.m_strFrequency = ""; objtemp.m_strDosage = ""; objtemp.m_strDays = ""; objtemp.m_strUsage = ""; objtemp.m_strRowNo = ""; decCureCost += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]); obj_VO.objinjectArr.Add(objtemp); } } } obj_VO.m_strWMedicineCost = decWMedicineCost.ToString("0.00"); //最后在这里添加数据 obj_VO.m_strZCMedicineCost = decZCMedicineCost.ToString("0.00"); obj_VO.m_strCureCost = decCureCost.ToString("0.00"); objPRDArr.Sort(0, objPRDArr.Count, null); objPRDArr2.Sort(0, objPRDArr2.Count, null); obj_VO.objPRDArr = objPRDArr; obj_VO.objPRDArr2 = objPRDArr2; return(obj_VO); }
/// <summary> /// 显示历史处方 /// </summary> public void m_mthShow() { string RecID = this.RecipeInfo_VO.m_strOUTPATRECIPEID_CHR; int row = 0; long ret = 0; string ItemID = ""; DataTable dt; DataTable EntryDt = new DataTable(); decimal Totalmny = 0; clsDcl_DoctorWorkstation objDoct = new clsDcl_DoctorWorkstation(); //1、西药 ret = objDoct.m_mthFindRecipeDetail1(RecID, out dt, false); if (ret > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; //0 状态 1 方号 2 项目名称 3 原规格 4 新规格 5 频率 6 用法 7 数量 8 原单价 9 新单价 10 原合计金额 11 项目属性 12 让利总金额 13 批发单价 14 批发单位单价 string[] s = new string[15]; string NewUnit = ""; string NewDosageUnit = ""; ItemID = dr["itemid_chr"].ToString(); s[0] = "T"; if (dr["rowno_chr"].ToString().Trim() == "0") { s[1] = ""; } else { s[1] = dr["rowno_chr"].ToString().Trim(); } s[2] = dr["itemname_vchr"].ToString(); s[3] = dr["itemspec_vchr"].ToString(); if (dr["itemspec_vchr"].ToString().Trim() != dr["spec"].ToString().Trim()) { s[4] = dr["spec"].ToString().Trim(); } else { s[4] = ""; } s[5] = dr["freqname_chr"].ToString(); s[6] = dr["usagename_vchr"].ToString(); s[7] = dr["tolqty_dec"].ToString(); s[8] = dr["unitprice_mny"].ToString(); s[9] = ""; s[10] = dr["tolprice_mny"].ToString(); s[11] = "1"; s[12] = dr["toldiffprice_mny"].ToString(); s[13] = dr["tradeprice_mny"].ToString(); s[14] = dr["subtrademoney"].ToString(); //判断大小单位 if (dr["opchargeflg_int"].ToString().Trim() == "0") { if (this.ConvertObjToDecimal(dr["unitprice_mny"]) != this.ConvertObjToDecimal(dr["itemprice_mny"])) { s[9] = dr["itemprice_mny"].ToString(); } NewUnit = dr["itemopunit_chr"].ToString(); } else { if (this.ConvertObjToDecimal(dr["unitprice_mny"]) != this.ConvertObjToDecimal(dr["submoney"])) { s[9] = dr["submoney"].ToString(); } NewUnit = dr["itemipunit_chr"].ToString(); } NewDosageUnit = dr["dosageunit"].ToString().Trim(); Totalmny += ConvertObjToDecimal(dr["tolprice_mny"]); row = this.dtgItem.Rows.Add(s); //if (dr["noqtyflag_int"].ToString() == "1") //{ // this.dtgItem.Rows[row].Cells[0].Value = "F"; // this.dtgItem.Rows[row].DefaultCellStyle.ForeColor = Color.Red; // if (!LackMedicine) // { // this.dtgItem.Rows[row].Cells[0].ReadOnly = true; // } //} if ((dr["dosageunit_chr"].ToString().Trim() != NewDosageUnit) || (dr["unitid_chr"].ToString().Trim() != NewUnit) || (s[4].ToString().Trim() != "")) { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.ForeColor = Color.Green; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } if (dr["ifstop_int"].ToString() == "1") { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.ForeColor = Color.DimGray; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } this.dtgItem.Rows[row].Tag = dr; } } //2、中药 ret = objDoct.m_mthFindRecipeDetail2(RecID, out dt, false); if (ret > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; //0 状态 1 方号 2 项目名称 3 原规格 4 新规格 5 频率 6 用法 7 数量 8 原单价 9 新单价 10 原合计金额 11 项目属性 12 让利总金额 13 批发单价 14 批发单位单价 string[] s = new string[15]; string NewUnit = ""; ItemID = dr["itemid"].ToString(); s[0] = "T"; s[1] = ""; s[2] = dr["itemname"].ToString(); s[3] = dr["dec"].ToString(); s[4] = ""; s[5] = ""; s[6] = dr["usagename_vchr"].ToString(); s[7] = Convert.ToString(ConvertObjToDecimal(dr["times"]) * ConvertObjToDecimal(dr["min_qty_dec"])); s[8] = dr["price"].ToString(); s[9] = ""; s[10] = dr["summoney"].ToString(); s[11] = "2"; s[12] = dr["toldiffprice_mny"].ToString(); s[13] = dr["tradeprice_mny"].ToString(); s[14] = dr["subtrademoney"].ToString(); if (dr["dec"].ToString().Trim() != dr["spec"].ToString().Trim()) { s[4] = dr["spec"].ToString(); } if (this.ConvertObjToDecimal(dr["price"]) != this.ConvertObjToDecimal(dr["submoney"])) { s[9] = dr["submoney"].ToString(); } NewUnit = dr["dosageunit"].ToString().Trim(); Totalmny += ConvertObjToDecimal(dr["summoney"]); row = this.dtgItem.Rows.Add(s); //if (dr["noqtyflag_int"].ToString() == "1") //{ // this.dtgItem.Rows[row].Cells[0].Value = "F"; // this.dtgItem.Rows[row].DefaultCellStyle.BackColor = Color.Red; // if (!LackMedicine) // { // this.dtgItem.Rows[row].Cells[0].ReadOnly = true; // } //} if ((dr["unit"].ToString().Trim() != NewUnit) || (s[4].ToString().Trim() != "")) { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.ForeColor = Color.Green; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } if (dr["ifstop_int"].ToString() == "1") { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.BackColor = Color.DarkGray; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } this.dtgItem.Rows[row].Tag = dr; } } if (ItemInputMode == 0) { //3、检验 ret = objDoct.m_mthFindRecipeDetail3(RecID, out dt, false); if (ret > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; //0 状态 1 方号 2 项目名称 3 原规格 4 新规格 5 频率 6 用法 7 数量 8 原单价 9 新单价 10 原合计金额 11 项目属性 string[] s = new string[12]; string NewUnit = ""; ItemID = dr["itemid"].ToString(); s[0] = "T"; s[1] = ""; s[2] = dr["itemname"].ToString(); s[3] = dr["dec"].ToString(); s[4] = ""; s[5] = ""; s[6] = ""; s[7] = dr["quantity"].ToString(); s[8] = dr["price"].ToString(); s[9] = ""; s[10] = dr["summoney"].ToString(); s[11] = "3"; if (dr["dec"].ToString().Trim() != dr["spec"].ToString().Trim()) { s[4] = dr["spec"].ToString(); } if (this.ConvertObjToDecimal(dr["price"]) != this.ConvertObjToDecimal(dr["itemprice_mny"])) { s[9] = dr["itemprice_mny"].ToString(); } NewUnit = dr["itemunit_chr"].ToString().Trim(); Totalmny += ConvertObjToDecimal(dr["summoney"]); row = this.dtgItem.Rows.Add(s); if ((dr["unit"].ToString().Trim() != NewUnit) || (s[4].ToString().Trim() != "")) { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.ForeColor = Color.Green; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } if (dr["ifstop_int"].ToString() == "1") { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.BackColor = Color.DarkGray; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } this.dtgItem.Rows[row].Tag = dr; } } //4、检查 ret = objDoct.m_mthFindRecipeDetail4(RecID, out dt, false); if (ret > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; //0 状态 1 方号 2 项目名称 3 原规格 4 新规格 5 频率 6 用法 7 数量 8 原单价 9 新单价 10 原合计金额 11 项目属性 string[] s = new string[12]; string NewUnit = ""; ItemID = dr["itemid"].ToString(); s[0] = "T"; s[1] = ""; s[2] = dr["itemname"].ToString(); s[3] = dr["dec"].ToString(); s[4] = ""; s[5] = ""; s[6] = ""; s[7] = dr["quantity"].ToString(); s[8] = dr["price"].ToString(); s[9] = ""; s[10] = dr["summoney"].ToString(); s[11] = "4"; if (dr["dec"].ToString().Trim() != dr["spec"].ToString().Trim()) { s[4] = dr["spec"].ToString(); } if (this.ConvertObjToDecimal(dr["price"]) != this.ConvertObjToDecimal(dr["itemprice_mny"])) { s[9] = dr["itemprice_mny"].ToString(); } NewUnit = dr["itemunit_chr"].ToString().Trim(); Totalmny += ConvertObjToDecimal(dr["summoney"]); row = this.dtgItem.Rows.Add(s); if ((dr["unit"].ToString().Trim() != NewUnit) || (s[4].ToString().Trim() != "")) { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.ForeColor = Color.Green; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } if (dr["ifstop_int"].ToString() == "1") { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.BackColor = Color.DarkGray; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } this.dtgItem.Rows[row].Tag = dr; } } //5、手术治疗 ret = objDoct.m_mthFindRecipeDetail5(RecID, out dt, false); if (ret > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; //0 状态 1 方号 2 项目名称 3 原规格 4 新规格 5 频率 6 用法 7 数量 8 原单价 9 新单价 10 原合计金额 11 项目属性 string[] s = new string[12]; string NewUnit = ""; ItemID = dr["itemid"].ToString(); s[0] = "T"; s[1] = ""; s[2] = dr["itemname"].ToString(); s[3] = dr["dec"].ToString(); s[4] = ""; s[5] = ""; s[6] = ""; s[7] = dr["quantity"].ToString(); s[8] = dr["price"].ToString(); s[9] = ""; s[10] = dr["summoney"].ToString(); s[11] = "5"; if (dr["dec"].ToString().Trim() != dr["spec"].ToString().Trim()) { s[4] = dr["spec"].ToString(); } if (this.ConvertObjToDecimal(dr["price"]) != this.ConvertObjToDecimal(dr["itemprice_mny"])) { s[9] = dr["itemprice_mny"].ToString(); } NewUnit = dr["itemunit_chr"].ToString().Trim(); Totalmny += ConvertObjToDecimal(dr["summoney"]); row = this.dtgItem.Rows.Add(s); if ((dr["unit"].ToString().Trim() != NewUnit) || (s[4].ToString().Trim() != "")) { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.ForeColor = Color.Green; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } if (dr["ifstop_int"].ToString() == "1") { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.BackColor = Color.DarkGray; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } this.dtgItem.Rows[row].Tag = dr; } } } else if (ItemInputMode == 1) //诊疗模式 { //诊疗项目 ret = objDoct.m_mthFindRecipeDetailOrder(RecID, out dt); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; //0 状态 1 方号 2 项目名称 3 原规格 4 新规格 5 频率 6 用法 7 数量 8 原单价 9 新单价 10 原合计金额 11 项目属性 string[] s = new string[12]; s[0] = "T"; s[1] = ""; s[2] = dr["ORDERDICNAME_VCHR"].ToString(); s[3] = dr["spec_vchr"].ToString(); s[4] = ""; s[5] = ""; s[6] = ""; s[7] = dr["qty_dec"].ToString(); s[8] = dr["pricemny_dec"].ToString(); s[9] = ""; s[10] = dr["totalmny_dec"].ToString(); string ordertype = dr["tableindex_int"].ToString(); if (ordertype == "3") { s[11] = "lis"; ret = objDoct.m_mthFindRecipeDetail3ByOrder(dr["outpatrecipeid_chr"].ToString(), dr["attachorderid_vchr"].ToString(), out EntryDt, false); } else if (ordertype == "4") { s[11] = "test"; ret = objDoct.m_mthFindRecipeDetail4ByOrder(dr["outpatrecipeid_chr"].ToString(), dr["attachorderid_vchr"].ToString(), out EntryDt, false); } else if (ordertype == "5") { s[11] = "ops"; ret = objDoct.m_mthFindRecipeDetail5ByOrder(dr["outpatrecipeid_chr"].ToString(), dr["attachorderid_vchr"].ToString(), out EntryDt, false); } else { continue; } if (ret > 0) { Totalmny += ConvertObjToDecimal(dr["totalmny_dec"]); row = this.dtgItem.Rows.Add(s); this.dtgItem.Rows[row].Tag = dr; this.dtgItem.Rows[row].Cells[0].Tag = EntryDt; if (dr["status_int"].ToString() == "0") { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.BackColor = Color.Red; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; break; } else { for (int j = 0; j < EntryDt.Rows.Count; j++) { if ((EntryDt.Rows[j]["dec"].ToString().Trim() != EntryDt.Rows[j]["spec"].ToString().Trim()) || (EntryDt.Rows[j]["unit"].ToString().Trim() != EntryDt.Rows[j]["itemunit_chr"].ToString().Trim())) { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.ForeColor = Color.Green; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; break; } if (EntryDt.Rows[j]["ifstop_int"].ToString() == "1") { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.BackColor = Color.DarkGray; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; break; } } } } } } //6、其他 ret = objDoct.m_mthFindRecipeDetail6(RecID, out dt, false); if (ret > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; //0 状态 1 方号 2 项目名称 3 原规格 4 新规格 5 频率 6 用法 7 数量 8 原单价 9 新单价 10 原合计金额 11 项目属性 string[] s = new string[12]; string NewUnit = ""; ItemID = dr["itemid"].ToString(); s[0] = "T"; s[1] = ""; s[2] = dr["itemname"].ToString(); s[3] = dr["dec"].ToString(); s[4] = ""; s[5] = ""; s[6] = ""; s[7] = dr["quantity"].ToString(); s[8] = dr["price"].ToString(); s[9] = ""; s[10] = dr["summoney"].ToString(); s[11] = "6"; if (dr["dec"].ToString().Trim() != dr["spec"].ToString().Trim()) { s[4] = dr["spec"].ToString(); } //if (this.ConvertObjToDecimal(dr["price"]) != this.ConvertObjToDecimal(dr["itemprice_mny"])) //{ // s[9] = dr["itemprice_mny"].ToString(); //} //NewUnit = dr["itemunit_chr"].ToString().Trim(); //判断大小单位 if (dr["opchargeflg_int"].ToString().Trim() == "0") { if (this.ConvertObjToDecimal(dr["price"]) != this.ConvertObjToDecimal(dr["itemprice_mny"])) { s[9] = dr["itemprice_mny"].ToString(); } else { s[9] = dr["price"].ToString(); } NewUnit = dr["itemopunit_chr"].ToString(); } else { if (this.ConvertObjToDecimal(dr["price"]) != this.ConvertObjToDecimal(dr["submoney"])) { s[9] = dr["submoney"].ToString(); } else { s[9] = dr["price"].ToString(); } NewUnit = dr["itemipunit_chr"].ToString(); } Totalmny += ConvertObjToDecimal(dr["summoney"]); row = this.dtgItem.Rows.Add(s); if ((dr["unit"].ToString().Trim() != NewUnit) || (s[4].ToString().Trim() != "")) { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.ForeColor = Color.Green; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } if (dr["ifstop_int"].ToString() == "1") { this.dtgItem.Rows[row].Cells[0].Value = "F"; this.dtgItem.Rows[row].DefaultCellStyle.BackColor = Color.DarkGray; this.dtgItem.Rows[row].Cells[0].ReadOnly = true; } this.dtgItem.Rows[row].Tag = dr; } } this.lblTotal.Text = Totalmny.ToString("0.00"); this.Text = "处方号 - " + RecID; }