public void AddUser(int userID, int roleID) { IRoleService service = this.CreateSubClient(); ICommunicationObject comm = service as ICommunicationObject; comm.Using(client => { service.AddUser(userID, roleID); }); }
public async Task <IActionResult> AddUser(InsertRoleUserModel model) { if (ModelState.IsValid) { var result = await _roleService.AddUser(model); if (result.IsSuccess) { StatusMessage = SuccessNotifcation("Insert user success!"); return(RedirectToAction("AddUser", "Role", new { id = model.RoleId })); } ModelState.AddModelError("", result.Message); } ViewBag.Users = await _userService.GetWithoutRoleId(model.RoleId); return(View(model)); }