/// <summary>
        /// 初始化显示
        /// </summary>
        /// <param name="strProjectProductId"></param>
        /// <param name="strSpec"></param>
        /// <param name="strModel"></param>
        private void IniData(string strProjectProductId, string strSpec, string strModel)
        {
            //项目产品对象
            ordProductModel = OrdProductBLL.GetInstance().Get_OrdProductModel(strProjectProductId);

            if (ordProductModel != null)
            {
                this.LblProductName.Text = ordProductModel.Product_Name;            //产品名称
                this.LblCommonName.Text  = ordProductModel.Common_Name;             //通用名称
                this.LblRegNo.Text       = ordProductModel.Reg_No;                  //注册号
                if (!string.IsNullOrEmpty(ordProductModel.Reg_Valid_Date))          //产品注册有效期
                {
                    this.LblReg_Valid_Date.Text = Convert.ToDateTime(ordProductModel.Reg_Valid_Date).ToShortDateString();
                }
                this.LblSpec.Text         = strSpec;                                                   //规格
                this.LblModel.Text        = strModel;                                                  //型号
                this.LblBrand.Text        = ordProductModel.Brand;                                     //品牌
                this.LblManu_Name.Text    = ordProductModel.ManuName;                                  //生产企业
                this.LblSalerName.Text    = ordProductModel.SalerName;                                 //经销企业
                this.LblPrice.Text        = base.SetNumFormat(ordProductModel.Price.ToString()) + "元"; //单价
                this.LblBASE_MEASURE.Text = ordProductModel.Base_Measure;                              //计量单位
                this.mePerformance.Text   = ordProductModel.Performance;                               //性能与组成
                this.Lbl_ClassName.Text   = ordProductModel.Class_Name;                                //品种分类名称
            }
        }
Example #2
0
        /// <summary>
        /// 获取项目产品信息对象
        /// </summary>
        /// <returns></returns>
        public OrdProductModel Get_OrdProductModel(string Project_Product_Id)
        {
            List <DbParameter> parameters = new List <DbParameter>();

            StringBuilder strSql = new StringBuilder();

            strSql.Append(@"Select
                            op.PRODUCT_NAME,
                            op.COMMON_NAME,
                            op.REG_NO,
                            op.REG_VALID_DATE,
                            op.SPEC,
                            op.MODEL,
                            op.BRAND,
                            op.MANU_ID,
                            org1.ORG_NAME As MANU_NAME,
                            SALER_ID,
                            org2.ORG_NAME As SALER_NAME,
                            op.PRICE,
                            op.BASE_MEASURE,
                            op.PERFORMANCE,
                            ppc.CLASS_NAME
                            From HC_ORD_PRODUCT op
                            Left join HC_ORG org1 on op.MANU_ID=org1.Id
                            Left join HC_ORG org2 on op.SALER_ID=org2.Id
                            Left join  
                            (
                            Select ppcc.PRODUCT_ID,ppc.CLASS_NAME from HC_PROJECT_PROD_CLASS_CONTENT ppcc,HC_PROJECT_PRODUCT_CLASS ppc
                            Where ppcc.CLASS_ID=ppc.ID
                            ) As ppc on op.ID=ppc.PRODUCT_ID
                            Where 1=1");

            if (!string.IsNullOrEmpty(Project_Product_Id))
            {
                strSql.AppendFormat(" And op.ID='{0}'", Project_Product_Id);
            }
            else
            {
                return(null);
            }

            OrdProductModel model = null;

            try
            {
                model = base.DbFacade.SQLExecuteObject(strSql.ToString(), new MapRow(GetOrdProductModel), parameters.ToArray()) as OrdProductModel;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(model);
        }
Example #3
0
        /// <summary>
        /// 获取项目产品对象
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="row"></param>
        /// <returns></returns>
        private object GetOrdProductModel(IDataReader reader, int row)
        {
            OrdProductModel model = new OrdProductModel();

            model.Product_Name   = Convert.ToString(reader["PRODUCT_NAME"]);
            model.Common_Name    = Convert.ToString(reader["COMMON_NAME"]);
            model.Reg_No         = Convert.ToString(reader["REG_NO"]);
            model.Reg_Valid_Date = Convert.ToString(reader["REG_VALID_DATE"]);
            model.Spec           = Convert.ToString(reader["SPEC"]);
            model.Model          = Convert.ToString(reader["MODEL"]);
            model.Brand          = Convert.ToString(reader["BRAND"]);
            model.ManuName       = Convert.ToString(reader["MANU_NAME"]);
            model.SalerName      = Convert.ToString(reader["SALER_NAME"]);
            model.Price          = System.Math.Round(Convert.ToDecimal(reader["PRICE"]), 2);
            model.Base_Measure   = Convert.ToString(reader["BASE_MEASURE"]);
            model.Performance    = Convert.ToString(reader["PERFORMANCE"]);
            model.Class_Name     = Convert.ToString(reader["CLASS_NAME"]);

            return(model);
        }