public ActionResult Permission(PermissionModel model,FormCollection collection) { //RoleRepository.ClearFunction(model.SelectedRoleID); //RoleRepository.SetFunction(model.SelectedRoleID,model.PostedFunction.FunctionID.ToList(),UserRepository.GetCurrentUserInfo().UserID); //return RedirectToAction("Permission", new { id =model.SelectedRoleID}); return View(); }
public ActionResult Permission(int? id) { var fun = FunctionRepository.GetChild(0); var lstfun = new List<FunctionInfo>(); foreach (var info in fun) { lstfun.Add(info); Function_Bind(lstfun, info.FunctionID, ""); } var model = new PermissionModel { Functions = lstfun, Roles =new SelectList(RoleRepository.GetAll(),"RoleID","Name") }; if (id != null) { model.SelectedRoleID = id.Value; model.FunctionsSelected = FunctionRepository.GetApprovedForRole(id.Value); } return View(model); }