From 6055afb34cda11df71a1704fdde1eb3955e92992 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 25 一月 2022 16:03:27 +0800 Subject: [PATCH] 提交 --- zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs | 35 ++++++++++++++++++++++++++++++++++- 1 files changed, 34 insertions(+), 1 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs b/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs index 07d97cb..485fb56 100644 --- a/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs @@ -740,6 +740,8 @@ public string Savequestiontypes(SysCodeDtlEntity data) { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ResultEntity resultEntity = new ResultEntity(); + resultEntity.Result = false; ViewData["curentuser"] = curentuser; data.RecStatus = "A"; if (String.IsNullOrEmpty(data.Id)) @@ -749,8 +751,39 @@ } data.Modifier = curentuser.Id; data.Modifytime = DateTime.Now; + if(data.CodeSns==null || data.CodeSns.Length == 0) + { + resultEntity.Result = false; + resultEntity.Message = "娉曞緥渚濇嵁涓嶈兘涓虹┖锛�"; + return JsonConvert.SerializeObject(resultEntity); + } + foreach (var CodeSn in data.CodeSns) + { + if (string.IsNullOrWhiteSpace(CodeSn)) + { + resultEntity.Result = false; + resultEntity.Message = "缂栫爜涓嶈兘涓虹┖锛�"; + return JsonConvert.SerializeObject(resultEntity); + } + } + if (data.Commentss == null || data.Commentss.Length == 0) + { + resultEntity.Result = false; + resultEntity.Message = "娉曞緥鍚嶇О涓嶈兘涓虹┖锛�"; + return JsonConvert.SerializeObject(resultEntity); + } + foreach (var Comment in data.Commentss) + { + if (string.IsNullOrWhiteSpace(Comment)) + { + resultEntity.Result = false; + resultEntity.Message = "娉曞緥鍚嶇О涓嶈兘涓虹┖锛�"; + return JsonConvert.SerializeObject(resultEntity); + } + } + - ResultEntity resultEntity = _sysCodeService.SaveSysCodeDtls(data); + resultEntity = _sysCodeService.SaveSysCodeDtls(data); return JsonConvert.SerializeObject(resultEntity); } -- Gitblit v1.9.1