Browse Source

进件营业执照格式判断

lcl 4 months ago
parent
commit
31cd0c2e00
1 changed files with 17 additions and 0 deletions
  1. 17 0
      Areas/Api/Controllers/Main/MerchantAddInfoController.cs

+ 17 - 0
Areas/Api/Controllers/Main/MerchantAddInfoController.cs

@@ -87,6 +87,23 @@ namespace MySystem.Areas.Api.Controllers.v1
             string IdCardAddress = data.getItem("IdCardAddress").ToString();//身份证居住地址
             string PeriodBegin = data.getItem("PeriodBegin").ToString(); //- 营业执照有效期开始
             string PeriodEnd = data.getItem("PeriodEnd").ToString(); //- 营业执照有效期结束
+            try
+            {
+                DateTime.Parse(PeriodBegin);
+            }
+            catch
+            {
+                return new AppResultJson() { Status = "-1", Info = "营业执照有效期开始时间格式有误" };
+            }
+            try
+            {
+                DateTime.Parse(PeriodEnd);
+            }
+            catch
+            {
+                return new AppResultJson() { Status = "-1", Info = "营业执照有效期结束时间格式有误" };
+            }
+
             if (string.IsNullOrEmpty(CardPeriodBegin))
             {
                 CardPeriodBegin = "1900-01-01";