Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        /// 获取Controller型号列表
        /// <summary>
        /// 获取Controller型号列表
        /// </summary>
        /// <returns></returns>
        public DataTable GetModels(string regionCode, string brandCode, string productType)
        {
            OleDbParameter[] paras =
            {
                new OleDbParameter("@RegionCode",  DbType.String),
                new OleDbParameter("@BrandCode",   DbType.String),
                new OleDbParameter("@ProductType", DbType.String)
            };
            paras[0].Value = regionCode;
            paras[1].Value = brandCode;
            //paras[2].Value = productType;
//            string sql = @"
//            SELECT DISTINCT RegionCode,BrandCode,FactoryCode,ProductType,
//                ControllerType,Description,Model_York,Model_Hitachi,Protocol,
//                CompatibleModel,MaxSameModel,MaxSameType,MaxControllerNumber,MaxUnitNumber,
//                MaxDeviceNumber,MaxSystemNumber,Max(MaxRemoteControllerNumber) as MaxRemoteControllerNumber1,
//                MaxIndoorUnitNumber,MaxWiringLength,Image
//            From JCHVRF_CentralController
//            Where RegionCode=@RegionCode AND BrandCode=@BrandCode AND ProductType = @ProductType
//            Group by RegionCode,BrandCode,FactoryCode,ProductType,
//                ControllerType,Description,Model_York,Model_Hitachi,Protocol,
//                CompatibleModel,MaxSameModel,MaxSameType,MaxControllerNumber,MaxUnitNumber,
//                MaxDeviceNumber,MaxSystemNumber,MaxIndoorUnitNumber,MaxWiringLength,Image";
            //一个Project可能存在多个不同的ProductType 20160829 by Yunxiao Lin
//            string sql = @"
//            SELECT DISTINCT RegionCode,BrandCode,FactoryCode,ProductType,
//                ControllerType,Description,Model_York,Model_Hitachi,Protocol,
//                CompatibleModel,MaxSameModel,MaxSameType,MaxControllerNumber,MaxUnitNumber,
//                MaxDeviceNumber,MaxSystemNumber,Max(MaxRemoteControllerNumber) as MaxRemoteControllerNumber,
//                MaxIndoorUnitNumber,MaxWiringLength,Image
//            From JCHVRF_CentralController
//            Where RegionCode=@RegionCode AND BrandCode=@BrandCode AND ProductType in (" + productType+")"
//            +@"Group by RegionCode,BrandCode,FactoryCode,ProductType,
//                ControllerType,Description,Model_York,Model_Hitachi,Protocol,
//                CompatibleModel,MaxSameModel,MaxSameType,MaxControllerNumber,MaxUnitNumber,
//                MaxDeviceNumber,MaxSystemNumber,MaxIndoorUnitNumber,MaxWiringLength,Image";
            string sql = @"
            SELECT DISTINCT RegionCode,BrandCode,FactoryCode,ProductType,
                ControllerType,Description,Model_York,Model_Hitachi,Protocol,
                CompatibleModel,MaxSameModel,MaxSameType,MaxControllerNumber,MaxUnitNumber,
                MaxDeviceNumber,MaxSystemNumber,Max(MaxRemoteControllerNumber) as MaxRemoteControllerNumber,
                MaxIndoorUnitNumber,MaxWiringLength,Image
            From JCHVRF_CentralController
            Where RegionCode=@RegionCode AND BrandCode=@BrandCode AND ProductType = '" + productType
                         + @"' Group by RegionCode,BrandCode,FactoryCode,ProductType,
                ControllerType,Description,Model_York,Model_Hitachi,Protocol,
                CompatibleModel,MaxSameModel,MaxSameType,MaxControllerNumber,MaxUnitNumber,
                MaxDeviceNumber,MaxSystemNumber,MaxIndoorUnitNumber,MaxWiringLength,Image";
            DataTable dt = _dao.GetDataTable(sql, paras);

            if (dt != null && dt.Rows.Count > 0)
            {
                return(dt);
            }
            return(null);
        }
Ejemplo n.º 3
0
        public DataTable LoadActiveLanguage()
        {
            string sql = "select * from JCHVRF_Language where IsActive=1";

            _dao = (new GetDatabase()).GetDataAccessObject();

            DataTable dtsql = _dao.GetDataTable(sql);

            return(dtsql);
        }
Ejemplo n.º 4
0
        /// 获取产品类型列表
        /// <summary>
        /// 获取产品类型列表
        /// </summary>
        /// <returns></returns>
        public DataTable GetProductTypeList(string regionVRF)
        {
            OleDbParameter[] paras = { new OleDbParameter("@sRegion", DbType.String) };
            paras[0].Value = regionVRF;
            string    sql = "SELECT DISTINCT ProductType From dbo_Relationship_Std Where Region =@sRegion and Deleteflag=1";
            DataTable dt  = _dao.GetDataTable(sql, paras);

            if (dt != null && dt.Rows.Count > 0)
            {
                return(dt);
            }
            return(null);
        }
Ejemplo n.º 5
0
        public void CreateCachData()
        {
            DataSet ds = JCBase.Utility.Util.DsCach;

            using (OleDbConnection conn = new OleDbConnection(_dao.GetConnString()))
            {
                conn.Open();
                DataTable tb = conn.GetSchema("Tables");
                Parallel.ForEach(tb.AsEnumerable(), new ParallelOptions {
                    MaxDegreeOfParallelism = Environment.ProcessorCount
                }, row =>
                {
                    string tableName = row["table_name"].ToString();
                    if (!ds.Tables.Contains(tableName))
                    {
                        if (tableName.IndexOf("MSys") == -1 && tableName.IndexOf("~TMP") == -1)
                        {
                            DataTable t = _dao.GetDataTable("select * from " + tableName);
                            t.TableName = tableName;
                            ds.Tables.Add(t);
                        }
                    }
                });
                //foreach (DataRow row in tb.Rows)
                //{
                //    string tableName = row["table_name"].ToString();
                //    if (tableName.IndexOf("MSys") == -1 && tableName.IndexOf("~TMP") == -1)
                //    {
                //        DataTable t = _dao.GetDataTable("select * from " + tableName);
                //        t.TableName = tableName;
                //        ds.Tables.Add(t);
                //    }
                //}
            }

            if (!ds.Tables.Contains("T_PipingKitTable") || ds.Tables["T_PipingKitTable"] == null)
            {
                DataTable tb = new DataTable();
                tb.Columns.Add("Type");
                tb.Columns.Add("System");
                tb.Columns.Add("Model");
                tb.Columns.Add("Qty");
                tb.Columns.Add("Id");
                tb.TableName = "T_PipingKitTable";
                ds.Tables.Add(tb);

                //DataRow row = tb.NewRow();
                //row["Type"] = "PipingConnectionKit";
                //row["System"] = "H1";
                //row["Model"] = "H1";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);

                //row = tb.NewRow();
                //row["Type"] = "PipingConnectionKit";
                //row["System"] = "H1";
                //row["Model"] = "H1";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);

                //row = tb.NewRow();
                //row["Type"] = "BranchKit";
                //row["System"] = "H2";
                //row["Model"] = "H1";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);


                //row = tb.NewRow();
                //row["Type"] = "BranchKit";
                //row["System"] = "H2";
                //row["Model"] = "H1";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);



                //row = tb.NewRow();
                //row["Type"] = "BranchKit";
                //row["System"] = "H2";
                //row["Model"] = "H2";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);


                //row = tb.NewRow();
                //row["Type"] = "BranchKit";
                //row["System"] = "H2";
                //row["Model"] = "H2";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);


                //row = tb.NewRow();
                //row["Type"] = "CHBox";
                //row["System"] = "H2";
                //row["Model"] = "H1";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);


                //row = tb.NewRow();
                //row["Type"] = "CHBox";
                //row["System"] = "H2";
                //row["Model"] = "H1";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);



                //row = tb.NewRow();
                //row["Type"] = "CHBox";
                //row["System"] = "H2";
                //row["Model"] = "H1";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);


                //row = tb.NewRow();
                //row["Type"] = "CHBox";
                //row["System"] = "H2";
                //row["Model"] = "H1";
                //row["Qty"] = "0";
                //tb.Rows.Add(row);
            }
        }