Преглед изворни кода

修改运营商为空判断

tangjiang пре 3 дана
родитељ
комит
bc97214b19
1 измењених фајлова са 10 додато и 10 уклоњено
  1. 10 10
      src/Hotline.Api/Controllers/SystemMobilAreaController.cs

+ 10 - 10
src/Hotline.Api/Controllers/SystemMobilAreaController.cs

@@ -57,15 +57,15 @@ namespace Hotline.Api.Controllers
         [HttpPost("add-system-mobil-area")]
         public async Task AddSystemMobilArea([FromBody] AddSystemMobilAreaDto dto)
         {
-            if (!string.IsNullOrEmpty(dto.TelCode))
+            if (string.IsNullOrEmpty(dto.TelCode))
                 throw UserFriendlyException.SameMessage("座机编号不能为空!");
-            if (!string.IsNullOrEmpty(dto.MobileCode))
+            if (string.IsNullOrEmpty(dto.MobileCode))
                 throw UserFriendlyException.SameMessage("手机编号不能为空!");
-            if (!string.IsNullOrEmpty(dto.MobileAreaName))
+            if (string.IsNullOrEmpty(dto.MobileAreaName))
                 throw UserFriendlyException.SameMessage("归属地不能为空!");
-            if (!string.IsNullOrEmpty(dto.OFlag))
+            if (string.IsNullOrEmpty(dto.OFlag))
                 throw UserFriendlyException.SameMessage("运营商不能为空!");
-            if (!string.IsNullOrEmpty(dto.OperatorName))
+            if (string.IsNullOrEmpty(dto.OperatorName))
                 throw UserFriendlyException.SameMessage("卡类型不能为空!");
 
             var data = await _systemMobilAreaRepository.AnyAsync(p => p.TelCode == dto.TelCode && p.MobileCode == dto.MobileCode && p.OFlag == p.OFlag, HttpContext.RequestAborted);
@@ -106,15 +106,15 @@ namespace Hotline.Api.Controllers
         [HttpPost("update-system-mobil-area")]
         public async Task UpdateSystemMobilAreaDetail([FromBody] UpdateSystemMobilAreaDto dto)
         {
-            if (!string.IsNullOrEmpty(dto.TelCode))
+            if (string.IsNullOrEmpty(dto.TelCode))
                 throw UserFriendlyException.SameMessage("座机编号不能为空!");
-            if (!string.IsNullOrEmpty(dto.MobileCode))
+            if (string.IsNullOrEmpty(dto.MobileCode))
                 throw UserFriendlyException.SameMessage("手机编号不能为空!");
-            if (!string.IsNullOrEmpty(dto.MobileAreaName))
+            if (string.IsNullOrEmpty(dto.MobileAreaName))
                 throw UserFriendlyException.SameMessage("归属地不能为空!");
-            if (!string.IsNullOrEmpty(dto.OFlag))
+            if (string.IsNullOrEmpty(dto.OFlag))
                 throw UserFriendlyException.SameMessage("运营商不能为空!");
-            if (!string.IsNullOrEmpty(dto.OperatorName))
+            if (string.IsNullOrEmpty(dto.OperatorName))
                 throw UserFriendlyException.SameMessage("卡类型不能为空!");
             var isCheack = await _systemMobilAreaRepository.AnyAsync(p => p.Id != dto.Id && p.TelCode == dto.TelCode
             && p.MobileCode == dto.MobileCode && p.OFlag == p.OFlag, HttpContext.RequestAborted);