public ActionResult RoleAddUser(RoleModel model) {
if (String.IsNullOrEmpty(model.NewUserId)) {
ModelState.AddModelError("NewUserId", "The New User field is required.");
}
Helper.ForceValidation(ModelState, model);
UserRole role = model.Role;
if (ModelState.IsValid) {
if (!String.IsNullOrEmpty(model.NewUserId)) {
SecurityData.AddUserToRole(new Guid(model.NewUserId), role.RoleName);
}
return RedirectToAction("RoleAddEdit", new { @id = role.RoleId });
}
Helper.HandleErrorDict(ModelState);
model.LoadUsers();
return View("RoleAddEdit", model);
}