public ActionResult DeleteConfirmed(int id) { DepartmentTicket departmentTicket = db.DepartmentTickets.Find(id); db.DepartmentTickets.Remove(departmentTicket); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DeparmentTrickId,RegisterTicketId,Approved")] DepartmentTicket departmentTicket) { if (ModelState.IsValid) { db.Entry(departmentTicket).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RegisterTicketId = new SelectList(db.RegisterTickets, "Id", "Id", departmentTicket.RegisterTicketId); return(View(departmentTicket)); }
// GET: DepartmentTickets/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DepartmentTicket departmentTicket = db.DepartmentTickets.Find(id); if (departmentTicket == null) { return(HttpNotFound()); } return(View(departmentTicket)); }
// GET: DepartmentTickets/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DepartmentTicket departmentTicket = db.DepartmentTickets.Find(id); if (departmentTicket == null) { return(HttpNotFound()); } ViewBag.RegisterTicketId = new SelectList(db.RegisterTickets, "Id", "Id", departmentTicket.RegisterTicketId); return(View(departmentTicket)); }