保存客户信息 [ValidateInput(false)] , OperaAction = )] 6 public ActionResult Save(Domain.SYS_BUSSINESSCUSTOMER entity) 7 { 8 bool isEdit = false; 9 var FK_RELATIONID = ""; , Status = }; { 13 if (entity != null) 14 { contentId = Request[] == ].ToString()); (entity.ID <= { 20 FK_RELATIONID = Guid.NewGuid().ToString(); 21 entity.FK_RELATIONID = FK_RELATIONID; 22 entity.Fk_DepartId = this.CurrentUser.DptInfo == null ? "" : this.CurrentUser.DptInfo.ID; 23 entity.CreateUser = CurrentUser.Name; 24 entity.CreateDate = DateTime.Now; 25 entity.UpdateUser = CurrentUser.Name; 26 entity.UpdateDate = DateTime.Now; 27 28 } { 31 FK_RELATIONID = entity.FK_RELATIONID; 32 entity.UpdateUser = CurrentUser.Name; 33 entity.UpdateDate = DateTime.Now; 34 isEdit = true; 35 } (!this.BussinessCustomerManage.IsExist(p => p.CompanyName.Equals(entity.CompanyName) && p.ID != entity.ID && p.Fk_DepartId == entity.Fk_DepartId)) 38 { 39 using (TransactionScope ts = new TransactionScope()) 40 { { 43 if (this.BussinessCustomerManage.SaveOrUpdate(entity, isEdit)) 44 { 45 if (contentId <= 0) 46 { 47 this.ContentManage.Save(new Domain.COM_CONTENT() 48 { ], 50 FK_RELATIONID = FK_RELATIONID, , 52 CREATEDATE = DateTime.Now 53 }); 54 } { 57 this.ContentManage.Update(new Domain.COM_CONTENT() 58 { 59 ID = contentId, ], 61 FK_RELATIONID = FK_RELATIONID, , 63 CREATEDATE = DateTime.Now 64 }); 65 } ; 67 68 } 69 70 ts.Complete(); 71 72 } 73 catch(Exception e) 74 { ; , e); 77 } 78 79 } 80 } { ; 84 } 85 } { ; 89 } 90 if (isEdit) 91 { + entity.CompanyName + + json.Msg, Common.Enums.enumLog4net.INFO); 93 } { + entity.CompanyName + + json.Msg, Common.Enums.enumLog4net.INFO); 97 } 98 } 99 catch (Exception e) 100 { ; , e); 103 } 104 return Json(json); 105 106 }
7.3 删除客户