public ActionResult EditRequest(int id) { using (var sRepository = new SpecRequestRepository()) { ViewBag.BlankInformation = sRepository.NewSpecRequest(false); return(View(sRepository.GetSpecRequest(id))); } }
public ActionResult AddRequest() { using (var sRepository = new SpecRequestRepository()) { ViewBag.BlankInformation = sRepository.NewSpecRequest(true); return(View(viewName: "NewAddRequest")); } }
public ActionResult EditRequest(SpecRequestInformation sInfo) { using (var sRepository = new SpecRequestRepository()) { if (ModelState.IsValid) { sRepository.UpdateSpecRequest(sInfo); return(RedirectToAction("Manage")); } ViewBag.BlankInformation = sRepository.NewSpecRequest(false); } return(View(sInfo)); }
public ActionResult AddRequest(SpecRequestInformation sInfo) { using (var sRepository = new SpecRequestRepository()) { if (ModelState.IsValid) { sRepository.AddSpecRequest(sInfo); if (PaoliWebUser.CurrentUser.CanManageTypicals) { return(RedirectToAction("Manage")); } return(RedirectToAction("ViewAll")); } ViewBag.BlankInformation = sRepository.NewSpecRequest(true); } return(View(viewName: "NewAddRequest", model: sInfo)); }