public static int GetPowerConditionerCount(string constructionCode)
        {
            if (!SpecificationProductDetail.ExistSolar(constructionCode))
            {
                return(0);
            }

            var detail = SpecificationProductDetail.Get(constructionCode, 0, 1, CLASS1_屋根, CLASS2_パワーコンディショナー);

            if (detail == null)
            {
                return(-1);
            }

            var zenkaku = detail.ProductName.Remove(1);
            var hankaku = Strings.StrConv(zenkaku, VbStrConv.Narrow, 0x0411);

            int count;

            if (int.TryParse(hankaku, out count)) //1文字目から台数を取得できるか試みる
            {
                return(count);
            }

            return(-1);
        }
Exemplo n.º 2
0
        public static List <ProductItem> Get(string constructionCode, string planNo)
        {
            var productItems = ProductItem.GetAll();

            var result = new List <ProductItem>();

            if (ConstructionSchedule.IsBeforeProcessRequest(constructionCode))
            {
                var siyoCode = tbl_siyo_boss.GetSiyoCode(constructionCode, planNo);
                var shohins  = tbl_siyo_syohin.Get(constructionCode, siyoCode);
                foreach (var shohin in shohins)
                {
                    var items = productItems.FindAll(p =>
                                                     shohin.komokuCd1 == p.Class1Code &&
                                                     shohin.komokuCd2 == p.Class2Code &&
                                                     shohin.shohinCd == p.ProductCode);

                    result.AddRange(items);
                }
            }
            else
            {
                var shohins = SpecificationProductDetail.Get(constructionCode);

                foreach (var shohin in shohins)
                {
                    var items = productItems.FindAll(p =>
                                                     shohin.Class1Code == p.Class1Code &&
                                                     shohin.Class2Code == p.Class2Code &&
                                                     shohin.ProductCode == p.ProductCode);

                    result.AddRange(items);
                }
            }

            result.Sort((p, q) =>
            {
                if (p.Class1Code != q.Class1Code)
                {
                    return(p.Class1Code.CompareTo(q.Class1Code));
                }

                if (p.Class2Code != q.Class2Code)
                {
                    return(p.Class2Code.CompareTo(q.Class2Code));
                }

                return(p.ProductCode.CompareTo(q.ProductCode));
            });

            return(result);
        }
Exemplo n.º 3
0
        public static List <ProductVa> Get(string constructionCode, string planNo)
        {
            var siyoCode   = tbl_siyo_boss.GetSiyoCode(constructionCode, planNo);
            var heyas      = SiyoHeya.Get(constructionCode, siyoCode);
            var productVas = ProductVa.GetAll();
            var result     = new List <ProductVa>();

            if (ConstructionSchedule.IsBeforeProcessRequest(constructionCode))
            {
                var shohins = tbl_siyo_syohin.Get(constructionCode, siyoCode);

                foreach (var shohin in shohins)
                {
                    var products = productVas.FindAll(p =>
                                                      shohin.komokuCd1 == p.Class1Code &&
                                                      shohin.komokuCd2 == p.Class2Code &&
                                                      shohin.shohinCd == p.ProductCode);

                    foreach (var product in products)
                    {
                        var clone = product.Clone();

                        if (shohin.floorNum.HasValue)
                        {
                            clone.Floor = shohin.floorNum.Value;
                        }

                        if (clone.Floor == 0 || clone.Floor == 9)
                        {
                            clone.Floor = 1;
                        }

                        clone.RoomCode = shohin.roomCd;

                        var heya = heyas.Find(p => p.RoomCode == clone.RoomCode);
                        if (heya != null)
                        {
                            clone.RoomName = heya.RoomName;
                        }
                        else
                        {
                            clone.RoomName = string.Empty;
                        }

                        result.Add(clone);
                    }
                }
            }
            else
            {
                var shohins = SpecificationProductDetail.Get(constructionCode);

                foreach (var shohin in shohins)
                {
                    var products = productVas.FindAll(p =>
                                                      shohin.Class1Code == p.Class1Code &&
                                                      shohin.Class2Code == p.Class2Code &&
                                                      shohin.ProductCode == p.ProductCode);

                    foreach (var product in products)
                    {
                        var clone = product.Clone();

                        clone.Floor = shohin.Floor;

                        if (clone.Floor == 0 || clone.Floor == 9)
                        {
                            clone.Floor = 1;
                        }

                        clone.RoomCode = shohin.RoomCode;

                        var heya = heyas.Find(p => p.RoomCode == clone.RoomCode);
                        if (heya != null)
                        {
                            clone.RoomName = heya.RoomName;
                        }
                        else
                        {
                            clone.RoomName = string.Empty;
                        }

                        result.Add(clone);
                    }
                }
            }

            result.Sort((p, q) =>
            {
                if (p.Class1Code != q.Class1Code)
                {
                    return(p.Class1Code.CompareTo(q.Class1Code));
                }

                if (p.Class2Code != q.Class2Code)
                {
                    return(p.Class2Code.CompareTo(q.Class2Code));
                }

                return(p.ProductCode.CompareTo(q.ProductCode));
            });

            return(result);
        }
        public static bool ExistSolar(string constructionCode)
        {
            var detail = SpecificationProductDetail.Get(constructionCode, 0, 1, CLASS1_屋根, CLASS2_太陽光発電システム);

            return(detail != null);
        }