public ActionResult RoleActions(short roleId) { var model = new RoleActionsModel { RoleId = roleId, ListActionsByRole = new Actions().GetActionsByRole(roleId) }; return(View(model)); }
public ActionResult RoleActions(RoleActionsModel model) { var roleActions = new RoleActions { RoleId = model.RoleId }; roleActions.DeleteQuickBy(0); if (model.ActionsId != null && model.ActionsId.Length > 0) { foreach (var item in model.ActionsId) { roleActions.ActionId = item; roleActions.InsertQuick(0); } } model.ListActionsByRole = new Actions().GetActionsByRole(model.RoleId); model.SystemStatus = SystemStatus.Success; ModelState.AddModelError("SystemMessages", "Gán chức năng cho quyền thành công !"); return(View(model)); }