コード例 #1
0
        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);
        }
コード例 #2
0
        /// <summary>
        /// 显示收费项目
        /// </summary>
        /// <param name="p_dtbChargeItem"></param>
        /// <param name="p_strRecipeNo">处方号</param>
        public void m_mthShow(DataTable p_dtbChargeItem, string p_strRecipeNo)
        {
            if (p_dtbChargeItem == null && p_dtbChargeItem.Rows.Count <= 0)
            {
                return;
            }
            if (string.IsNullOrEmpty(p_strRecipeNo))
            {
                return;
            }

            m_dtbChargeItem = p_dtbChargeItem.Copy();

            string RecID = p_strRecipeNo;

            long      ret = 0;
            DataTable dt  = null;
            //诊疗项目的状态,是否完成该诊疗
            DataTable dtbDiagnosisItemStatus = null;
            //是否发药
            DataTable dtbSendMed = null;
            //是否发了西药
            int intIsSendWM = 0;
            //是否发了中药
            int intIsSendCM = 0;
            //是否发了其他的材料
            int intIsSendOth = 0;

            decimal Totalmny = 0;
            clsDcl_DoctorWorkstation objDoct = new clsDcl_DoctorWorkstation();

            ret = objDomain.m_lngQuerySendMed(RecID, out dtbSendMed);

            if (ret > 0)
            {
                if (dtbSendMed != null && dtbSendMed.Rows.Count > 0)
                {
                    int intRowCount = dtbSendMed.Rows.Count;
                    for (int i1 = 0; i1 < intRowCount; i1++)
                    {
                        DataRow dtrTemp = dtbSendMed.Rows[i1];
                        switch (dtrTemp["medtype"].ToString().Trim())
                        {
                        case "WM":
                            int.TryParse(dtrTemp["issendmed"].ToString().Trim(), out intIsSendWM);
                            break;

                        case "CM":
                            int.TryParse(dtrTemp["issendmed"].ToString().Trim(), out intIsSendCM);
                            break;

                        case "QTH":
                            int.TryParse(dtrTemp["issendmed"].ToString().Trim(), out intIsSendOth);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }

            #region 1、西药
            //colChecked,colRepNo,colItemName,colState,colOriSpecification,colNewSpecification,
            // colQuantity,colOriPrice,colNewPrice,colSum,colFrequency,colUsage,colItemAttribute
            int intRowIndex = 0;
            //1、西药
            ret = objDoct.m_mthFindRecipeDetail1(RecID, out dt, false);
            if (ret > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    intRowIndex = this.m_objViewer.dtgItem.Rows.Add();

                    DataGridViewRow dgvrTemp = this.m_objViewer.dtgItem.Rows[intRowIndex];
                    DataRow         dr       = dt.Rows[i];

                    dgvrTemp.Cells["colChecked"].Value = "T";
                    //是否选中,也即和是否领药
                    if (intIsSendWM == 1)
                    {
                        dgvrTemp.Cells["colChecked"].ReadOnly = true;
                        dgvrTemp.Cells["colState"].Value      = "已领药";
                        dgvrTemp.DefaultCellStyle.BackColor   = Color.Red;
                    }
                    else
                    {
                        //dgvrTemp.Cells["colChecked"].Value = "F";
                        dgvrTemp.Cells["colState"].Value = "未领药";
                    }
                    //方号
                    if (dr["rowno_chr"].ToString().Trim() == "0")
                    {
                        dgvrTemp.Cells["colRepNo"].Value = "";
                    }
                    else
                    {
                        dgvrTemp.Cells["colRepNo"].Value = dr["rowno_chr"].ToString().Trim();
                    }
                    //项目名称
                    dgvrTemp.Cells["colItemName"].Value = dr["itemname_vchr"].ToString();
                    //原规格
                    dgvrTemp.Cells["colOriSpecification"].Value = dr["itemspec_vchr"].ToString();
                    //新规格
                    if (dr["rowno_chr"].ToString().Trim() == "0")
                    {
                        dgvrTemp.Cells["colNewSpecification"].Value = "";
                    }
                    else
                    {
                        dgvrTemp.Cells["colNewSpecification"].Value = dr["rowno_chr"].ToString().Trim();
                    }
                    //频率
                    dgvrTemp.Cells["colFrequency"].Value = dr["freqname_chr"].ToString();
                    //用法
                    dgvrTemp.Cells["colUsage"].Value = dr["usagename_vchr"].ToString();
                    //数量
                    dgvrTemp.Cells["colQuantity"].Value = dr["tolqty_dec"].ToString();
                    //原单价
                    dgvrTemp.Cells["colOriPrice"].Value = dr["unitprice_mny"].ToString();
                    //新单价
                    dgvrTemp.Cells["colNewPrice"].Value = "";
                    //原合计金额
                    dgvrTemp.Cells["colSum"].Value = dr["tolprice_mny"].ToString();
                    //项目属性
                    dgvrTemp.Cells["colItemAttribute"].Value = "WM";
                    //项目id
                    dgvrTemp.Cells["colItemID"].Value = dr["itemid_chr"].ToString();
                    //添加目标申请单id
                    dgvrTemp.Cells["colAttachid"].Value = "";


                    //判断大小单位
                    if (dr["opchargeflg_int"].ToString().Trim() == "0")
                    {
                        if (this.ConvertObjToDecimal(dr["unitprice_mny"]) != this.ConvertObjToDecimal(dr["itemprice_mny"]))
                        {
                            dgvrTemp.Cells["colNewPrice"].Value = dr["itemprice_mny"].ToString();
                        }
                    }
                    else
                    {
                        if (this.ConvertObjToDecimal(dr["unitprice_mny"]) != this.ConvertObjToDecimal(dr["submoney"]))
                        {
                            dgvrTemp.Cells["colNewPrice"].Value = dr["submoney"].ToString();
                        }
                    }


                    Totalmny    += ConvertObjToDecimal(dr["tolprice_mny"]);
                    dgvrTemp.Tag = dr;
                }
            }
            #endregion

            #region 2、中药
            //2、中药
            ret = objDoct.m_mthFindRecipeDetail2(RecID, out dt, false);
            if (ret > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    intRowIndex = this.m_objViewer.dtgItem.Rows.Add();

                    DataGridViewRow dgvrTemp = this.m_objViewer.dtgItem.Rows[intRowIndex];
                    DataRow         dr       = dt.Rows[i];

                    //colChecked,colRepNo,colItemName,colState,colOriSpecification,colNewSpecification,
                    // cloQuantity,colOriPrice,colNewPrice,colSum,colFrequency,colUsage,colItemAttribute

                    dgvrTemp.Cells["colChecked"].Value = "T";
                    if (intIsSendCM == 1)
                    {
                        dgvrTemp.Cells["colChecked"].ReadOnly = true;
                        dgvrTemp.Cells["colState"].Value      = "已领药";
                        dgvrTemp.DefaultCellStyle.BackColor   = Color.Red;
                    }
                    else
                    {
                        //dgvrTemp.Cells["colChecked"].Value = "F";
                        dgvrTemp.Cells["colState"].Value = "未领药";
                    }
                    dgvrTemp.Cells["colRepNo"].Value            = "";
                    dgvrTemp.Cells["colItemName"].Value         = dr["itemname"].ToString();
                    dgvrTemp.Cells["colOriSpecification"].Value = dr["dec"].ToString();
                    if (dr["dec"].ToString().Trim() != dr["spec"].ToString().Trim())
                    {
                        dgvrTemp.Cells["colNewSpecification"].Value = dr["spec"].ToString();
                    }
                    else
                    {
                        dgvrTemp.Cells["colNewSpecification"].Value = "";
                    }
                    dgvrTemp.Cells["colFrequency"].Value = "";
                    dgvrTemp.Cells["colUsage"].Value     = dr["usagename_vchr"].ToString();
                    dgvrTemp.Cells["colQuantity"].Value  = Convert.ToString(ConvertObjToDecimal(dr["times"]) * ConvertObjToDecimal(dr["min_qty_dec"]));
                    dgvrTemp.Cells["colOriPrice"].Value  = dr["price"].ToString();
                    if (this.ConvertObjToDecimal(dr["price"]) != this.ConvertObjToDecimal(dr["submoney"]))
                    {
                        dgvrTemp.Cells["colNewPrice"].Value = dr["submoney"].ToString();
                    }
                    else
                    {
                        dgvrTemp.Cells["colNewPrice"].Value = "";
                    }
                    dgvrTemp.Cells["colSum"].Value           = dr["summoney"].ToString();
                    dgvrTemp.Cells["colItemAttribute"].Value = "CM";
                    //项目id
                    dgvrTemp.Cells["colItemID"].Value = dr["itemid"].ToString();
                    //添加目标申请单id
                    dgvrTemp.Cells["colAttachid"].Value = "";

                    Totalmny += ConvertObjToDecimal(dr["summoney"]);

                    dgvrTemp.Tag = dr;
                }
            }
            #endregion

            #region 3、诊疗项目
            //诊疗项目
            //检验、检验、手术
            int intCheck = 1;
            ret = objDoct.m_mthFindRecipeDetailOrder(RecID, out dt);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                intRowIndex = this.m_objViewer.dtgItem.Rows.Add();

                DataGridViewRow dgvrTemp = this.m_objViewer.dtgItem.Rows[intRowIndex];
                DataRow         dr       = dt.Rows[i];

                //方号
                dgvrTemp.Cells["colRepNo"].Value = "";
                //项目名称
                dgvrTemp.Cells["colItemName"].Value = dr["orderdicname_vchr"].ToString();
                //原规格
                dgvrTemp.Cells["colOriSpecification"].Value = dr["spec_vchr"].ToString();
                //新规格
                dgvrTemp.Cells["colNewSpecification"].Value = "";
                //频率
                dgvrTemp.Cells["colFrequency"].Value = "";
                //用法
                dgvrTemp.Cells["colUsage"].Value = "";
                //数量
                dgvrTemp.Cells["colQuantity"].Value = dr["qty_dec"].ToString();
                //原单价
                dgvrTemp.Cells["colOriPrice"].Value = dr["pricemny_dec"].ToString();
                //新单价
                dgvrTemp.Cells["colNewPrice"].Value = "";
                // 原合计金额
                dgvrTemp.Cells["colSum"].Value = dr["totalmny_dec"].ToString();
                //诊疗项目id
                dgvrTemp.Cells["colItemID"].Value = dr["orderdicid_chr"].ToString();

                dgvrTemp.Cells["colChecked"].Value = "T";
                dgvrTemp.Cells["colState"].Value   = "未确定";
                //添加目标申请单id
                dgvrTemp.Cells["colAttachid"].Value = dr["attachid_vchr"].ToString();
                string strItemid = dr["itemid_chr"].ToString().Trim();
                string ordertype = dr["tableindex_int"].ToString();

                if (dtbDiagnosisItemStatus != null)
                {
                    dtbDiagnosisItemStatus.Dispose();
                    dtbDiagnosisItemStatus = null;
                }
                if (ordertype == "3")
                {
                    dgvrTemp.Cells["colItemAttribute"].Value = "lis";
                    ret = objDomain.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dr["orderdicid_chr"].ToString().Trim(), intCheck, out dtbDiagnosisItemStatus);
                }
                else if (ordertype == "4")
                {
                    dgvrTemp.Cells["colItemAttribute"].Value = "test";
                    ret = objDomain.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dr["orderdicid_chr"].ToString().Trim(), intCheck, out dtbDiagnosisItemStatus);
                }
                else if (ordertype == "5")
                {
                    dgvrTemp.Cells["colItemAttribute"].Value = "ops";
                    ret = objDomain.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dr["orderdicid_chr"].ToString().Trim(), intCheck, out dtbDiagnosisItemStatus);
                }
                else
                {
                    continue;
                }

                if (ret > 0)
                {
                    Totalmny += ConvertObjToDecimal(dr["totalmny_dec"]);

                    if (dtbDiagnosisItemStatus != null && dtbDiagnosisItemStatus.Rows.Count > 0)
                    {
                        DataRow dtrTemp   = dtbDiagnosisItemStatus.Rows[0];
                        int     intStatus = 0;
                        int.TryParse(dtrTemp["isfinish"].ToString(), out intStatus);

                        if (intStatus == 1)
                        {
                            dgvrTemp.Cells["colChecked"].ReadOnly = true;
                            dgvrTemp.Cells["colState"].Value      = "已确定";
                            dgvrTemp.DefaultCellStyle.BackColor   = Color.Red;
                        }
                    }

                    dgvrTemp.Tag = dr;
                }
            }
            #endregion

            #region 4、其他项目,只是显示手动添加的,不显示项目带出的

            /*
             * 可以通过查看是不是带出的项目来决定是否显示,如,它的用法带出父项目id为空
             * **/
            //6、其他
            ret = objDoct.m_mthFindRecipeDetail6(RecID, out dt, false);

            if (ret > 0)
            {
                int intRwoCount = dt.Rows.Count;
                for (int i1 = 0; i1 < intRwoCount; i1++)
                {
                    DataRow dtrTemp = dt.Rows[i1];

                    if (string.IsNullOrEmpty(dtrTemp["usageparentid_vchr"].ToString().Trim()))
                    {
                        intRowIndex = this.m_objViewer.dtgItem.Rows.Add();
                        DataGridViewRow dgvrTemp = this.m_objViewer.dtgItem.Rows[intRowIndex];

                        dgvrTemp.Cells["colChecked"].Value = "T";
                        dgvrTemp.Cells["colState"].Value   = "未确定";
                        //if (intIsSendOth == 1)
                        //{
                        //    dgvrTemp.Cells["colChecked"].ReadOnly = true;
                        //    dgvrTemp.Cells["colState"].Value = "已确定";
                        //    dgvrTemp.DefaultCellStyle.BackColor = Color.Red;
                        //}
                        //else
                        //{
                        //    //dgvrTemp.Cells["colChecked"].Value = "F";
                        //    dgvrTemp.Cells["colState"].Value = "未确定";
                        //}

                        //方号
                        dgvrTemp.Cells["colRepNo"].Value = "";
                        //项目名称
                        dgvrTemp.Cells["colItemName"].Value = dtrTemp["itemname"].ToString();
                        //原规格
                        dgvrTemp.Cells["colOriSpecification"].Value = dtrTemp["dec"].ToString();
                        //新规格
                        dgvrTemp.Cells["colNewSpecification"].Value = "";
                        //频率
                        dgvrTemp.Cells["colFrequency"].Value = "";
                        //用法
                        dgvrTemp.Cells["colUsage"].Value = "";
                        //数量
                        dgvrTemp.Cells["colQuantity"].Value = dtrTemp["quantity"].ToString();
                        //原单价
                        dgvrTemp.Cells["colOriPrice"].Value = dtrTemp["price"].ToString();
                        //新单价
                        dgvrTemp.Cells["colNewPrice"].Value = "";
                        // 原合计金额
                        dgvrTemp.Cells["colSum"].Value = dtrTemp["summoney"].ToString();
                        //项目属性
                        dgvrTemp.Cells["colItemAttribute"].Value = "oth";
                        //项目Id
                        dgvrTemp.Cells["colItemID"].Value = dtrTemp["itemid"].ToString();
                        //添加目标申请单id
                        dgvrTemp.Cells["colAttachid"].Value = "";

                        if (dtrTemp["dec"].ToString().Trim() != dtrTemp["spec"].ToString().Trim())
                        {
                            dgvrTemp.Cells["colNewSpecification"].Value = dtrTemp["spec"].ToString();
                        }

                        if (this.ConvertObjToDecimal(dtrTemp["price"]) != this.ConvertObjToDecimal(dtrTemp["itemprice_mny"]))
                        {
                            dgvrTemp.Cells["colNewPrice"].Value = dtrTemp["itemprice_mny"].ToString();
                        }

                        ret = objDomain.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dtrTemp["outpatrecipedeid_chr"].ToString().Trim(), 2, out dtbDiagnosisItemStatus);

                        if (ret > 0)
                        {
                            Totalmny += ConvertObjToDecimal(dtrTemp["summoney"]);

                            if (dtbDiagnosisItemStatus != null && dtbDiagnosisItemStatus.Rows.Count > 0)
                            {
                                DataRow dtrTempStatus = dtbDiagnosisItemStatus.Rows[0];
                                int     intStatus     = 0;
                                int.TryParse(dtrTempStatus["isfinish"].ToString(), out intStatus);

                                if (intStatus == 1)
                                {
                                    dgvrTemp.Cells["colChecked"].ReadOnly = true;
                                    dgvrTemp.Cells["colState"].Value      = "已确定";
                                    dgvrTemp.DefaultCellStyle.BackColor   = Color.Red;
                                }
                            }
                        }

                        dgvrTemp.Tag = dtrTemp;
                    }
                }
            }
            #endregion
        }
コード例 #3
0
        /// <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;
        }