public ActionResult List(int id) { var vm = new UnionsForm { SectionId = id }; if (User.IsInAnyRole(AppRole.Workers)) { switch (usersRepo.GetTopLevelJob(base.AdminId)) { case JobRole.UnionManager: vm.UnionsList = new UnionsRepo().GetByManagerId(base.AdminId); break; case JobRole.LeagueManager: break; case JobRole.TeamManager: break; } } else { vm.UnionsList = unionsRepo.GetBySection(id); } return(PartialView("_List", vm)); }
public ActionResult Save(UnionsForm frm) { var u = new Union { SectionId = frm.SectionId, Name = frm.Name }; unionsRepo.Create(u); unionsRepo.Save(); return(RedirectToAction("List", new { id = frm.SectionId })); }