public async Task <IActionResult> AddUser(User user) { var temp = await _userModuleUserBll.GetAsync(user.UserId); if (temp != null) { //从用户表中赋值 user.UserName = temp.UserName; user.Phone = temp.Phone; user.Email = temp.Email; user.Company = temp.Company; } else { return(new JsonResult(new { success = false, message = "用户不存在" })); } user.Create(Request.RequestUser().UserId); await _userBll.AddAsync(user); //日志 await _logBll.AddAsync( Request.RequestUser().UserId, Request.RequestUser().UserName + "添加了项目用户:" + user.UserName, Json.Serialize(user), user.ProjectId ); return(new JsonResult(new { success = true })); }
public async Task <IActionResult> AddUser(User user) { user.Create(Request.RequestUser().UserId); user.Status = UserStatus.Normal; await _userBll.AddAsync(user); //日志 await _logBll.AddAsync( Request.RequestUser().UserId, Request.RequestUser().UserName + "添加了用户:" + user.UserName, Json.Serialize(user), user.PrimaryKey ); return(new JsonResult(new { success = true })); }