コード例 #1
0
        public static HouseTypeGroupDetail Get(string constructionCode, string planNo)
        {
            var houseTypeCode = string.Empty;

            if (ConstructionSchedule.IsBeforeProcessRequest(constructionCode))
            {
                var kanri = tbl_siyo_kanri.Get(constructionCode, planNo);
                if (kanri == null || kanri.typeCd == null)
                {
                    throw new ApplicationException(HOSUE_TYPE_ERROR);
                }
                houseTypeCode = kanri.typeCd;
            }
            else
            {
                var house = House.Get(constructionCode);
                if (house == null || house.ConstructionTypeCode == null)
                {
                    throw new ApplicationException(HOSUE_TYPE_ERROR);
                }
                houseTypeCode = house.ConstructionTypeCode;
            }

            var detail = HouseTypeGroupDetail.Get(houseTypeCode);

            if (detail == null)
            {
                throw new ApplicationException(SIYO_CODE_GROUP_ERROR);
            }

            return(detail);
        }
コード例 #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);
        }
コード例 #3
0
        //とりあえずこれ使え

        /// <summary>
        /// <para>加工依頼前はSiyoDataBrokerを参照する</para>
        /// <para>加工依頼後はBasicSpecificationDetailsを参照する</para>
        /// </summary>
        private static string Get(string constructionCode, int siyoCode, string specCode)
        {
            if (ConstructionSchedule.IsBeforeProcessRequest(constructionCode))
            {
                var kihon = tbl_siyo_kihon.Get(constructionCode, siyoCode, specCode);
                if (kihon == null)
                {
                    return(null);
                }

                return(kihon.siyoDetailCd);
            }
            else
            {
                var detail = BasicSpecificationDetail.Get(constructionCode, specCode);
                if (detail == null)
                {
                    return(null);
                }

                return(detail.SpecificationDetailCode);
            }
        }
コード例 #4
0
        public static string GetConstructionTypeCode(string constructionCode, string planNo)
        {
            if (ConstructionSchedule.IsBeforeProcessRequest(constructionCode))
            {
                var kanri = tbl_siyo_kanri.Get(constructionCode, planNo);
                if (kanri == null)
                {
                    return(null);
                }

                return(kanri.typeCd);
            }
            else
            {
                var house = House.Get(constructionCode);
                if (house == null)
                {
                    return(null);
                }

                return(house.ConstructionTypeCode);
            }
        }
コード例 #5
0
ファイル: SiyoHeya.cs プロジェクト: nguyendinhthi/SocketPlan
        public static List <SiyoHeya> Get(string constructionCode, int siyoCode)
        {
            var rooms = new List <SiyoHeya>();

            if (ConstructionSchedule.IsBeforeProcessRequest(constructionCode))
            {
                var heyas = tbl_siyo_heya.Get(constructionCode, siyoCode);

                foreach (var heya in heyas)
                {
                    var siyoheya = new SiyoHeya();
                    siyoheya.ConstructionCode = heya.customerCode;
                    siyoheya.Floor            = heya.floorNum;
                    siyoheya.RoomCode         = heya.roomCd;
                    siyoheya.RoomName         = heya.roomName;

                    rooms.Add(siyoheya);
                }
            }
            else
            {
                var heyas = RoomLayout.Get(constructionCode);

                foreach (var heya in heyas)
                {
                    var siyoheya = new SiyoHeya();
                    siyoheya.ConstructionCode = heya.ConstructionCode;
                    siyoheya.Floor            = heya.Floor;
                    siyoheya.RoomCode         = heya.RoomCode;
                    siyoheya.RoomName         = heya.RoomName;

                    rooms.Add(siyoheya);
                }
            }

            return(rooms);
        }
コード例 #6
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);
        }