Beispiel #1
0
        private void BindBrandCode()
        {
            MyProductTypeBLL bll       = new MyProductTypeBLL();
            List <string>    brandList = bll.GetBrandCodeList(CurrentProject.SubRegionCode.ToString());

            brandList.ForEach((item) =>
            {
                if (item.Equals("Y", StringComparison.OrdinalIgnoreCase))
                {
                    if (IsHitachiRdbVisible != "Visible")
                    {
                        IsYork = true;
                    }

                    IsYorkImgVisible = "Visible";
                    IsYorkRdbVisible = "Visible";
                }
                else if (item.Equals("H", StringComparison.OrdinalIgnoreCase))
                {
                    IsHitachiRdbVisible = "Visible";
                    IsHitachiImgVisible = "Visible";
                    IsYork    = false;
                    IsHitachi = true;
                }
            });
        }
Beispiel #2
0
        /// 根据品牌限制获取过滤区域
        /// <summary>
        /// 根据品牌限制获取过滤区域   --add on 20170522 by Lingjia Qiu
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        private List <string> getRegionListByBrandLimit(DataTable dt)
        {
            List <string> regionList = new List <string>();

            foreach (DataRow dr in dt.Rows)
            {
                MyProductTypeBLL bll        = new MyProductTypeBLL();
                string           regionCode = dr["Code"].ToString();
                List <string>    brandList  = bll.GetBrandCodeList(regionCode);
                if (brandList.Count == 1)
                {
                    if (!string.IsNullOrEmpty(brandCode) && !brandCode.Equals("ALL"))
                    {
                        if (!brandCode.Equals(brandList[0].ToString()))
                        {
                            regionList.Add(regionCode);
                        }
                    }
                    else
                    {
                        return(null);
                    }
                }
            }

            return(regionList);
        }
Beispiel #3
0
        private void BindFactoryList(string brandCode)
        {
            this.pnlSource.Controls.Clear();
            MyProductTypeBLL bll    = new MyProductTypeBLL();
            MyDictionaryBLL  dicBll = new MyDictionaryBLL();
            List <string>    list   = bll.GetFactoryCodeList(brandCode, this.jccmbSubRegion.SelectedValue.ToString());

            if (list != null && list.Count > 0)
            {
                //this.gbSource.Enabled = true;

                int x = 157;
                int y = 26;

                if (!list.Contains("G"))
                {
                    RadioButton rbtn = new RadioButton();
                    this.pnlSource.Controls.Add(rbtn);
                    rbtn.AutoSize        = true;
                    rbtn.Font            = new System.Drawing.Font("Arial", 12, GraphicsUnit.Pixel);
                    rbtn.Text            = "Johnson Controls - Hitachi";
                    rbtn.Name            = "rbtnSource_H";
                    rbtn.CheckedChanged += new EventHandler(Factory_Click);
                    rbtn.Location        = new Point(x, y);
                    rbtn.Checked         = true;
                }
                else
                {
                    if (list.Count > 1)
                    {
                        RadioButton rbtn = new RadioButton();
                        this.pnlSource.Controls.Add(rbtn);
                        rbtn.AutoSize        = true;
                        rbtn.Font            = new System.Drawing.Font("Arial", 12, GraphicsUnit.Pixel);
                        rbtn.Text            = "Johnson Controls - Hitachi";
                        rbtn.Name            = "rbtnSource_H";
                        rbtn.CheckedChanged += new EventHandler(Factory_Click);
                        rbtn.Location        = new Point(x, y);

                        y           += 38;
                        rbtn.Checked = true;
                    }
                    RadioButton rbtn1 = new RadioButton();
                    rbtn1.AutoSize = true;
                    this.pnlSource.Controls.Add(rbtn1);
                    rbtn1.Font            = new System.Drawing.Font("Arial", 12, GraphicsUnit.Pixel);
                    rbtn1.Text            = "YORK Guangzhou Factory";
                    rbtn1.Name            = "rbtnSource_G";
                    rbtn1.CheckedChanged += new EventHandler(Factory_Click);
                    rbtn1.Location        = new Point(x, y);

                    if (list.Count == 1)
                    {
                        rbtn1.Checked = true;
                    }
                }
            }
        }
Beispiel #4
0
        private void BindBrandList()
        {
            this.pnlBrand.Controls.Clear();
            this.pnlSource.Controls.Clear();

            MyProductTypeBLL bll    = new MyProductTypeBLL();
            MyDictionaryBLL  dicBll = new MyDictionaryBLL();
            List <string>    list   = bll.GetBrandCodeList(this.jccmbSubRegion.SelectedValue.ToString());

            if (list != null && list.Count > 0)
            {
                //this.gbBrand.Enabled = true;
                int x = 174;
                int y = 15;
                foreach (string s in list)
                {
                    if (!string.IsNullOrEmpty(brandCode) && !brandCode.Equals("ALL"))
                    {
                        if (!s.Equals(brandCode))  //根据品牌限制显示品牌信息
                        {
                            continue;
                        }
                    }

                    MyDictionary dic = dicBll.GetItem(MyDictionary.DictionaryType.Brand, s);

                    RadioButton rbtn = new RadioButton();
                    rbtn.AutoSize = false;
                    rbtn.Size     = new Size(136, 32);
                    rbtn.Location = new Point(x, y);
                    y            += 38;

                    rbtn.Text = "";
                    rbtn.Name = "rbtnBrand_" + s;
                    if (s == "Y")
                    {
                        rbtn.Image = Properties.Resources.YORK_logo;
                    }
                    else if (s == "H")
                    {
                        rbtn.Image = Properties.Resources.Hitachi_logo;
                    }
                    rbtn.CheckedChanged += new EventHandler(Brand_Click);
                    this.pnlBrand.Controls.Add(rbtn);

                    if (s == list[0] || s.Equals(brandCode))
                    {
                        rbtn.Checked = true;
                    }
                }
            }
        }
Beispiel #5
0
        public static bool IsIndoorIsValidForODUSeries(JCHVRF.Model.NextGen.SystemVRF CurrentSys)
        {
            var listRISelected = JCHVRF.Model.Project.GetProjectInstance.RoomIndoorList.Where(ri => ri.SystemID == (((JCHVRF.Model.SystemBase)CurrentSys).Id)).ToList();

            if (ProjectBLL.IsSupportedUniversalSelection(JCHVRF.Model.Project.GetProjectInstance))
            {
                MyProductTypeBLL productTypeBll = new MyProductTypeBLL();
                DataTable        typeDt         = productTypeBll.GetIduTypeBySeries(JCHVRF.Model.Project.GetProjectInstance.BrandCode, JCHVRF.Model.Project.GetProjectInstance.SubRegionCode, CurrentSys.Series);
                if (typeDt != null && typeDt.Rows.Count > 0)
                {
                    foreach (var idu in listRISelected)
                    {
                        if (idu.IndoorItem != null)
                        {
                            if (!typeDt.AsEnumerable().Any(row => row["IDU_UnitType"].ToString() == idu.IndoorItem.Type))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }
            else
            {
                IndoorBLL bll     = new IndoorBLL(JCHVRF.Model.Project.GetProjectInstance.SubRegionCode, JCHVRF.Model.Project.GetProjectInstance.BrandCode);
                string    colName = "UnitType";
                DataTable typeDt  = bll.GetIndoorFacCodeList(CurrentSys.ProductType);
                foreach (DataRow dr in typeDt.Rows)
                {
                    if (System.Convert.ToInt32(dr["FactoryCount"].ToString()) > 1)
                    {
                        dr[colName] = AlterUnitTypeBasedOnFactoryCode(dr["FactoryCode"].ToString(), Convert.ToString(dr[colName]));
                    }
                }
                var dv = new DataView(typeDt);
                if (CurrentSys.ProductType == "Comm. Tier 2, HP")
                {
                    if (CurrentSys.Series == "Commercial VRF HP, FSN6Q" || CurrentSys.Series == "Commercial VRF HP, JVOH-Q")
                    {
                        dv.RowFilter = "UnitType not in ('High Static Ducted-HAPE','Medium Static Ducted-HAPE','Low Static Ducted-HAPE','High Static Ducted-SMZ','Medium Static Ducted-SMZ','Four Way Cassette-SMZ')";
                    }
                    else
                    {
                        dv.RowFilter = "UnitType <>'Four Way Cassette-HAPQ'";
                    }
                }
                typeDt = dv.Table;
                if (typeDt != null && typeDt.Rows.Count > 0)
                {
                    foreach (var idu in listRISelected)
                    {
                        if (idu.IndoorItem != null)
                        {
                            var factoryCode = idu.IndoorItem.GetFactoryCode();
                            var type        = AlterUnitTypeBasedOnFactoryCode(factoryCode, idu.IndoorItem.Type);


                            if (!typeDt.AsEnumerable().Any(row => (row["UnitType"].ToString() == idu.IndoorItem.Type ||
                                                                   (System.Convert.ToInt32(row["FactoryCount"].ToString()) > 1 && row["UnitType"].ToString() == type))))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }