public ActionResult DeleteConfirmed(int id) { RegisterTicket registerTicket = db.RegisterTickets.Find(id); db.RegisterTickets.Remove(registerTicket); db.SaveChanges(); return(RedirectToAction("Index")); }
public static void SendTicket(RegisterTicket command) { var client = new RestClient(TicketingApiEndpoint); var request = new RestRequest("Ticket", Method.POST); request.AddJsonBody(command); var response = client.Execute(request); HandleRequestFailure(response); }
public ActionResult Edit([Bind(Include = "Id,TicketId,CreatedDate,ModifiedDate")] RegisterTicket registerTicket) { if (ModelState.IsValid) { db.Entry(registerTicket).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TicketId = new SelectList(db.Tickets, "Id", "TaskDetail", registerTicket.TicketId); return(View(registerTicket)); }
// GET: RegisterTickets/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RegisterTicket registerTicket = db.RegisterTickets.Find(id); if (registerTicket == null) { return(HttpNotFound()); } return(View(registerTicket)); }
// GET: RegisterTickets/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RegisterTicket registerTicket = db.RegisterTickets.Find(id); if (registerTicket == null) { return(HttpNotFound()); } ViewBag.TicketId = new SelectList(db.Tickets, "Id", "TaskDetail", registerTicket.TicketId); return(View(registerTicket)); }
public IActionResult Post(RegisterTicket command) { _commandBus.Dispatch(command); return(Ok()); }