예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 // 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);
 }
예제 #4
0
 public ActionResult Delete(int id)
 {
     Ticket ticket = this.mgr.Get(id);
     TicketViewModel tvm = new TicketViewModel() { Ticket = ticket };
     return View("~/Views/Ticket/Delete.cshtml", tvm);
 }
예제 #5
0
 // GET: Ticket/Create
 public ActionResult Create()
 {
     TicketViewModel tvm = new TicketViewModel() { Ticket = new Ticket() };
     return View("~/Views/Ticket/Create.cshtml", tvm);
 }
예제 #6
0
 // GET: Ticket
 public ActionResult Index()
 {
     IEnumerable<Ticket> tickets = this.mgr.Get();
     TicketViewModel tvm = new TicketViewModel() { Tickets = tickets };
     return View("~/Views/Ticket/Index.cshtml", tvm);
 }
예제 #7
0
 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);
     }
 }