From ed3015095f1b0e88bc579877c678a3fac191381f Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 28 六月 2021 14:32:26 +0800
Subject: [PATCH] Merge branch 'master' of http://47.108.235.38:8080/r/zhengcaioa
---
zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs | 81 +++++++++++++++++++++++++++++++---------
1 files changed, 62 insertions(+), 19 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs b/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs
index 1c317d5..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
{
@@ -176,6 +177,40 @@
}
+
+
+ public IActionResult EditByName( string name)
+ {
+ var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+ ViewData["curentuser"] = curentuser;
+
+ IntentionCustomerDTO intentionCustomerDTO = new IntentionCustomerDTO();
+
+ intentionCustomerDTO = _intentionCustomerService.GetByName(name);
+
+
+
+ var sheng = _projectService.Getsheng();
+ var shi = _projectService.Getshi(intentionCustomerDTO.Sheng);
+ var quxian = _projectService.Getquxian(intentionCustomerDTO.City);
+ var users = _userService.GetList().Where(x => x.IsYwjl == "A").ToList(); ;
+
+ ViewData["khlx"] = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx");
+ ViewData["khly"] = _liaotianService.GetSYScode("CooperatecustomCustomer", "khly");
+ ViewData["hyfl"] = _liaotianService.GetSYScode("CooperatecustomCustomer", "hyfl");
+
+ ViewData["users"] = users;
+
+ ViewData["sheng"] = sheng;
+ ViewData["shi"] = shi;
+ ViewData["quxian"] = quxian;
+ ViewData["DeptId"] = _hrDeptService.GetList();
+ ViewData.Model = intentionCustomerDTO;
+ return View();
+ }
+
+
+
/// <summary>
/// 淇濆瓨
/// </summary>
@@ -240,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