// GET: Policies public ActionResult Index() { var repo = new PolicyRepository(); repo.RootPath = Server.MapPath("~/"); var pvm = new PoliciesByCategoryVM(); pvm.AllPolicies = repo.GetAll(); pvm.Polcatlist = repo.GetAllPolicyCategories(); return View("Index", pvm); }
public ActionResult Manage() { var repo = new PolicyRepository(); repo.RootPath = Server.MapPath("~/"); var policies = repo.GetAll(); return View(policies); }
public ActionResult PoliciesByCategory(PoliciesByCategoryVM pvm) { var repo = new PolicyRepository {RootPath = Server.MapPath("~/")}; pvm.Policies = repo.GetAll().Where(p=>p.Category == pvm.Category).ToList(); return View(pvm); }