public ActionResult Delete(int id) { //ViewBag.Unit = new SelectList(SouvenirRepo.Get(), "Id", "Name"); SouvenirViewModel model = SouvenirRepo.GetById(id); return(PartialView("_Delete", model)); }
public ActionResult Edit(int id) { UserViewModel model2 = SouvenirRequestRepo.GetIdByName(User.Identity.Name); ViewBag.Unit = new SelectList(UnitRepo.Get(), "Id", "Name"); SouvenirViewModel model = SouvenirRepo.GetById(id); if (model2.Role == "Staff" || model2.Role == "Admin") { return(PartialView("_Edit", model)); } else { return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" }))); } }
public ActionResult Show(int id) { SouvenirViewModel model = SouvenirRepo.GetById(id); return(PartialView("_Show", model)); }