Пример #1
0
        public MyProductType GetItem(string brandCode, string regionCode, string productType)
        {
            DataTable dt  = JCBase.Utility.Util.InsertDsCachForLoad("JCHVRF_ProductType");
            DataView  dv  = dt.DefaultView;
            string    sql = " BrandCode='" + brandCode + "' and RegionCode = '" + regionCode + "' and ProductType = '" + productType + "'";//FactoryCode='" + factoryCode + "' and

            dv.RowFilter = sql;
            dt           = dv.ToTable();
            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow       dr   = dt.Rows[0];
                MyProductType item = new MyProductType();
                item.BrandCode    = brandCode;
                item.FactoryCode  = dr["FactoryCode"].ToString();
                item.RegionCode   = regionCode;
                item.ProductType  = productType;
                item.Series       = (dr["Series"] is DBNull) ? "" : dr["Series"].ToString();
                item.MinCoolingDB = (dr["MinCoolingDB"] is DBNull) ? 0 : Convert.ToInt32(dr["MinCoolingDB"].ToString());
                item.MaxCoolingDB = (dr["MaxCoolingDB"] is DBNull) ? 0 : Convert.ToInt32(dr["MaxCoolingDB"].ToString());
                item.MinHeatingWB = (dr["MinHeatingWB"] is DBNull) ? 0 : Convert.ToInt32(dr["MinHeatingWB"].ToString());
                item.MaxHeatingWB = (dr["MaxHeatingWB"] is DBNull) ? 0 : Convert.ToInt32(dr["MaxHeatingWB"].ToString());
                if (dt.Columns.Contains("L2SizeDownRule"))
                {
                    item.L2SizeDownRule = Convert.ToString(dr["L2SizeDownRule"]);
                }
                return(item);
            }
            return(null);
        }
Пример #2
0
        /// <summary>
        /// 获取新风机的productType
        /// </summary>
        /// <param name="brandCode"></param>
        /// <param name="regionCode"></param>
        /// <returns></returns>
        public DataTable GetFreshAirProductTypeData(string brandCode, string regionCode)
        {
            List <MyProductType> strList = new List <MyProductType>();
            // 此处GetStdTableName中的参数flag直接用“Indoor”,因为Indoor与FreshAir的数据放在同一张标准表中
            string    sTableName = GetStdTableName(IndoorType.Indoor, regionCode);
            DataTable dt         = new DataTable();

            if (!string.IsNullOrEmpty(sTableName))
            {
                String sql = "select DISTINCT t1.productType,t1.series from JCHVRF_ProductType t1 " +
                             "left join " + sTableName + " t2 on t1.productType = t2.productType " +
                             " where t2.selectionType = 'FreshAir' and t2.deleteflag = 1 and t1.BrandCode='" + brandCode + "' and t1.FactoryCode<>'G' and t1.RegionCode = '" + regionCode + "'";
                dt = _dao.GetDataTable(sql);

                if (dt != null && dt.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        MyProductType productType = new MyProductType();
                        productType.ProductType = dr["productType"].ToString();
                        productType.Series      = dr["series"].ToString();
                        //strList.Add(productType);
                    }
                }
                //if (strList != null && strList.Count > 0)
                //    return strList;
            }
            if (dt != null && dt.Rows.Count > 0)
            {
                return(dt);
            }
            return(null);
        }