public static bool IsTenjijyo(string constructionCode)
        {
            var construction = Construction.Get(constructionCode);

            if (construction == null)
            {
                return(false);
            }

            return(construction.ConstructionKind == 4 && construction.ConstructionDetailKind == 3);
        }
예제 #2
0
        public static bool IsBeforeProcessRequest(string constructionCode)
        {
            //長期物件区分、0:通常物件 1:長期物件(待機) 2:長期物件(再開)
            //加工依頼送信日があっても、長期物件区分が
            //「1:長期物件(待機)」の場合は、加工依頼前と同じ処理にする。
            var construction = Construction.Get(constructionCode);

            if (construction.ProlongedPlanStatus == 1)
            {
                return(true);
            }

            var schedule = ConstructionSchedule.Get(constructionCode);

            return(!schedule.SentProcessRequestDate.HasValue);
        }
        // 物件情報一括取得
        public static List <Construction> Get(List <string> constructionCodes)
        {
            if (constructionCodes.Count == 0)
            {
                return(new List <Construction>());
            }

            var codes = string.Empty;

            constructionCodes.ForEach(p => codes += "'" + p + "',");
            if (codes.Length == 0)
            {
                return(new List <Construction>());
            }

            codes = codes.Substring(0, codes.Length - 1);
            var sql = "SELECT * FROM Constructions WHERE ConstructionCode IN (" + codes + ")";
            var db  = Construction.GetDatabase();

            return(db.ExecuteQuery <Construction>(sql));
        }
        public static bool IsNewStandardQtyRule(string constructionCode)
        {
            var construction = Construction.Get(constructionCode);

            if (construction == null)
            {
                return(true);
            }

            var basedDate = Properties.Settings.Default.StandardItemSwitchingDate;

            //値なしor2016/9/1以降のときtrue
            var isNew = false;

            if (construction.ContractDate.HasValue)
            {
                isNew = basedDate <= construction.ContractDate.Value;
            }
            else
            {
                isNew = true;
            }

            var isProvisionalNew = false;

            if (construction.ProvisionalContractDate.HasValue)
            {
                isProvisionalNew = basedDate <= construction.ProvisionalContractDate.Value;
            }
            else
            {
                isProvisionalNew = true;
            }

            return(isNew && isProvisionalNew);
        }
        public static bool IsNewBunpaikiStandardQtyRule(string constructionCode)
        {
            var construction = Construction.Get(constructionCode);

            if (construction == null)
            {
                return(true);
            }

            var basedDate = new DateTime(2017, 5, 1);

            //値なしor2017/5/1以降のときtrue
            var isNew = false;

            if (construction.ContractDate.HasValue)
            {
                isNew = basedDate <= construction.ContractDate.Value;
            }
            else
            {
                isNew = true;
            }

            var isProvisionalNew = false;

            if (construction.ProvisionalContractDate.HasValue)
            {
                isProvisionalNew = basedDate <= construction.ProvisionalContractDate.Value;
            }
            else
            {
                isProvisionalNew = true;
            }

            return(isNew && isProvisionalNew);
        }