//CLOSE DESIGN REQUEST POST public ActionResult Close(int id) { ViewBag.Employee = new SelectList(EmployeeRepo.Get(), "Id", "First_Name"); DesignApproveViewModel model = DesignApproveRepo.GetById(id); UserViewModel access = DesignApproveRepo.GetIdByName(User.Identity.Name); if (access.Role == "Staff" || access.Role == "Admin") { return(PartialView("_Close", model)); } else { return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" }))); } }
public ActionResult Approve(int id) { UserViewModel result = UserRepo.GetIdByName(User.Identity.Name); ViewBag.Panel = "Approval Design Request"; ViewBag.Employee = new SelectList(DesignApproveRepo.GetAssign(), "Id", "Full_Name"); DesignApproveViewModel model = DesignApproveRepo.GetById(id); if (result.Role == "Admin") { return(PartialView("_Approve", model)); } else { return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" }))); } }