From 8de9a465342385e0ebee7dc430abadd69a2b67dd Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 28 六月 2021 12:42:46 +0800
Subject: [PATCH] 工资修改

---
 zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs |   47 ++++++++++++++++++++++++++++-------------------
 1 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs b/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs
index d7b9f68..bab207c 100644
--- a/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs
@@ -15,6 +15,7 @@
 using System.Threading.Tasks;
 using zhengcaioa.Models;
 using zhengcaioa.IService;
+using System.Transactions;
 
 namespace zhengcaioa.Controllers.Customer
 {
@@ -274,31 +275,39 @@
                 resultEntity.Result = false;
                 resultEntity.Message = "娌℃湁鎵惧埌瀹㈡埛!";
             }
-          
-         
-            if (result != null && result.Count > 0)
+             using(TransactionScope scope = new TransactionScope())
             {
-                for (int i = 0; i < result.Count; i++)
+                if (result != null && result.Count > 0)
                 {
-                    var dto = _mapper.Map<CooperatecustomCustomerDTO>(result[i]);
-                    dto.Id = "";
-                    dto.Creater = curentuser.Id;
-                    dto.Modifier = curentuser.Id;
-                    dto.Createtime = DateTime.Now;
-                    dto.Modifytime = dto.Createtime;
-                    dto.zhuanyi = true;
-                    resultEntity =  _cooperatecustomCustomerService.save(dto);
-                    if (!resultEntity.Result)
+                    for (int i = 0; i < result.Count; i++)
                     {
-                        return new JsonResult(resultEntity);
+
+                        resultEntity = _intentionCustomerService.ModifyStatus(result[i].Id, curentuser.Id);
+                        if (!resultEntity.Result)
+                        {
+                            return new JsonResult(resultEntity);
+                        }
+
+                        var dto = _mapper.Map<CooperatecustomCustomerDTO>(result[i]);
+                        dto.Id = "";
+                        dto.Creater = curentuser.Id;
+                        dto.Modifier = curentuser.Id;
+                        dto.Createtime = DateTime.Now;
+                        dto.Modifytime = dto.Createtime;
+                        dto.zhuanyi = true;
+                        resultEntity = _cooperatecustomCustomerService.save(dto);
+                        if (!resultEntity.Result)
+                        {
+                            return new JsonResult(resultEntity);
+                        }
                     }
                 }
+                
+
+                scope.Complete();
             }
-            else
-            {
-                resultEntity.Result = false;
-                resultEntity.Message = "鏃犺仈绯讳汉鍙风爜";
-            }
+         
+            
 
             
 

--
Gitblit v1.9.1