public ActionResult Delete(int id, TicketViewModel tvm) { try { this.mgr.Remove(id); return RedirectToAction("Index", "Ticket"); } catch (Exception e) { return View("~/Views/Shared/Error.cshtml", e.Message); } }
public ActionResult Create(TicketViewModel tvm) { try { this.mgr.Add(tvm.Ticket); return RedirectToAction("Details", "Ticket", new { @id = tvm.Ticket.Id }); } catch (Exception e) { return View("~/Views/Shared/Error.cshtml", e); } }
// GET: Ticket/Details/5 public ActionResult Details(int id) { Ticket ticket = this.mgr.Get(id); TicketViewModel tvm = new TicketViewModel() { Ticket = ticket }; tvm.Ticket.Responses = this.mgr.GetResponses(id).ToList(); return View("~/Views/Ticket/Details.cshtml", tvm); }
public ActionResult Delete(int id) { Ticket ticket = this.mgr.Get(id); TicketViewModel tvm = new TicketViewModel() { Ticket = ticket }; return View("~/Views/Ticket/Delete.cshtml", tvm); }
// GET: Ticket/Create public ActionResult Create() { TicketViewModel tvm = new TicketViewModel() { Ticket = new Ticket() }; return View("~/Views/Ticket/Create.cshtml", tvm); }
// GET: Ticket public ActionResult Index() { IEnumerable<Ticket> tickets = this.mgr.Get(); TicketViewModel tvm = new TicketViewModel() { Tickets = tickets }; return View("~/Views/Ticket/Index.cshtml", tvm); }
public ActionResult Edit(int id, TicketViewModel tvm) { try { this.mgr.Change(tvm.Ticket); return RedirectToAction("Details", "Ticket", new { @id = tvm.Ticket.Id }); } catch (Exception e) { return View("~/Views/Shared/Error.cshtml", e.Message); } }