| | |
| | | using System.Threading.Tasks; |
| | | using zhengcaioa.Models; |
| | | using zhengcaioa.IService; |
| | | using System.Transactions; |
| | | |
| | | namespace zhengcaioa.Controllers.Customer |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | 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> |
| | |
| | | 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 = "无联系人号码"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |