public ActionResult DeleteThatCategory(string categoryName) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); grinder.DeleteCategory(categoryName); return(RedirectToAction("ViewCategories")); }
public ActionResult DeletePolicy(Policy policy) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); grinder.DeletePolicy(policy); return(RedirectToAction("ManagePolicies")); }
public ActionResult DeleteCategory(string categoryName) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); CategoryResponse category = grinder.GetOneCategory(categoryName); return(View(category)); }
public ActionResult ManagePolicies() { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); var viewModel = new CategoryVM(); viewModel.CategoryList = grinder.GetAllCategoryies(); return(View(viewModel)); }
public void CanSearchOnePolicy(string name, bool expectedResults) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); Policy policy = new Policy(); policy.Name = name; PolicyResponse response = grinder.GetOnePolicy(policy); Assert.AreEqual(expectedResults, response.Success); }
public void CanDeleteCategory(string name, bool expectedResults) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); Category category = new Category(); category.Name = name; CategoryResponse response = grinder.DeleteCategory(category.Name); Assert.AreEqual(expectedResults, response.Success); }
public ActionResult ManagePolicies(int categoryId) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); var viewModel = new CategoryVM(); var categoryList = grinder.GetAllCategoryies(); viewModel.CategoryList = categoryList; viewModel.Category = categoryList.FirstOrDefault(c => c.Id == categoryId); return(View(viewModel)); }
public ActionResult AddCategory(Category category) { if (ModelState.IsValid) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); CategoryResponse response = grinder.AddNewCategory(category); return(RedirectToAction("ManagePolicies", response)); } return(View(new Category())); }
public ActionResult AddPolicy(Policy policy) { if (ModelState.IsValid) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); PolicyResponse response = grinder.AddNewPolicy(policy); return(RedirectToAction("ManagePolicies", response)); } return(View(policy)); }
public ActionResult ApplicationHome(Applicant applicant) { if (ModelState.IsValid) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); grinder.AddApplicant(applicant); return(RedirectToAction("ConfirmApplication")); } return(View()); }
public void CanDeletePolicy(string name, string content, bool expectedResults) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); Policy policy = new Policy(); policy.Name = name; policy.Content = content; PolicyResponse response = grinder.DeletePolicy(policy); Assert.AreEqual(expectedResults, response.Success); }
public ActionResult Policy(string id, string reference) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); Policy newPolicy = new Policy(); if (reference != null && reference == "categories") { ViewBag.LinkText = "Return to View Policies"; ViewBag.LinkAction = "Categories"; ViewBag.LinkController = "Admin"; } else { ViewBag.LinkText = "Return to Manage Policies"; ViewBag.LinkAction = "ManagePolicies"; ViewBag.LinkController = "Admin"; } newPolicy.Name = id; var policySearched = grinder.GetOnePolicy(newPolicy); return(View(policySearched)); }