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); }
public static List <SpecificationProductDetail> Get(string constructionCode) { var db = SpecificationProductDetail.GetDatabase(); string sql = @" SELECT * FROM SpecificationProductDetails WHERE ConstructionCode = '" + constructionCode + @"'"; return(db.ExecuteQuery <SpecificationProductDetail>(sql)); }
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); }
public static List <SpecificationProductDetail> Get(string constructionCode, int specificationType, string class1Code, string class2Code) { var db = SpecificationProductDetail.GetDatabase(); string sql = @" SELECT * FROM SpecificationProductDetails WHERE ConstructionCode = '" + constructionCode + @"' AND SpecificationType = " + specificationType + @" AND Class1Code = '" + class1Code + @"' AND Class2Code = '" + class2Code + @"'"; return(db.ExecuteQuery <SpecificationProductDetail>(sql)); }
public static List <SpecificationProductDetail> GetRimokonNicheSA(string constructionCode) { var db = SpecificationProductDetail.GetDatabase(); string sql = @" SELECT * FROM SpecificationProductDetails WHERE ConstructionCode = '" + constructionCode + @"' AND SpecificationType = 3 AND Class1Code IS NULL AND Class2Code = '0035' AND (ProductCode = '0400107' OR ProductCode = '0400108')"; return(db.ExecuteQuery <SpecificationProductDetail>(sql)); }
public static string GetRoomName(string roomCode) { var db = SpecificationProductDetail.GetDatabase(); string sql = @" SELECT RoomNameJapanese FROM Rooms WHERE RoomCode ='" + roomCode + "'"; var obj = db.ExecuteScalar(sql); if (obj == null) { return(string.Empty); } return(obj.ToString()); }
private static SpecificationProductDetail Get(string constructionCode, int floor, int specificationType, string class1Code, string class2Code) { string sql = @" SELECT * FROM SpecificationProductDetails WHERE ConstructionCode = '" + constructionCode + @"' AND Floor = " + floor + @" AND SpecificationType = " + specificationType + @" AND Class1Code = '" + class1Code + @"' AND Class2Code = '" + class2Code + @"'"; var db = SpecificationProductDetail.GetDatabase(); var list = db.ExecuteQuery <SpecificationProductDetail>(sql); if (list.Count == 0) { return(null); } return(list[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); }