Exemple #1
0
        /// <summary>
        ///   起票日のフォーマットをチェック
        /// </summary>
        public static bool CheckKihyoubiFormatIsValid(models.db.KaikeiDatabase db, models.db.Row row)
        {
            string gengou = row.GetStr("kihyoubi_gengou", "");
            int    year   = (int)row.GetLong("kihyoubi_year", 0);
            int    month  = (int)row.GetLong("kihyoubi_month", 0);
            int    day    = (int)row.GetLong("kihyoubi_day", 0);

            if (gengou.Length != 1 || !(1 <= year && year <= 99) || !(1 <= month && month <= 12) || !(1 <= day && day <= 31))
            {
                return(false);
            }

            DateTime?date = helper.Converter.ObjToDateTime(row.Get("kihyoubi_gengou"), row.Get("kihyoubi_year"), row.Get("kihyoubi_month"), row.Get("kihyoubi_day"));

            if (date == null)
            {
                return(false);
            }
            return(true);
        }