public ActionResult DeleteConfirmed(int id) { BookedTable bookedTable = db.BookedTables.Find(id); db.BookedTables.Remove(bookedTable); db.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Edit([Bind(Include = "id,idTable,CustomerName,CustomerPhone,CustomerAddress,BookDate,BookTimeStart,BookTimeEnd")] BookedTable bookedTable) { if (ModelState.IsValid) { db.Entry(bookedTable).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.idTable = new SelectList(db.Tables, "idTable", "name", bookedTable.idTable); ViewBag.idTable = new SelectList(db.Tables, "idTable", "name", bookedTable.idTable); return View(bookedTable); }
// GET: BookedTables/Details/5 public ActionResult Details(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } BookedTable bookedTable = db.BookedTables.Find(id); if (bookedTable == null) { return HttpNotFound(); } return View(bookedTable); }
public ActionResult Create([Bind(Include = "id,idTable,CustomerName,CustomerPhone,CustomerAddress,BookDate,BookTimeStart,BookTimeEnd")] BookedTable bookedTable) { if (ModelState.IsValid) { db.BookedTables.Add(bookedTable); db.SaveChanges(); return(RedirectToAction("Details", new { id = bookedTable.id })); } ViewBag.idTable = new SelectList(db.Tables, "idTable", "name", bookedTable.idTable); return(View(bookedTable)); }
// GET: BookedTables/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BookedTable bookedTable = db.BookedTables.Find(id); if (bookedTable == null) { return(HttpNotFound()); } return(View(bookedTable)); }
// GET: BookedTables/Edit/5 public ActionResult Edit(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } BookedTable bookedTable = db.BookedTables.Find(id); if (bookedTable == null) { return HttpNotFound(); } ViewBag.idTable = new SelectList(db.Tables, "idTable", "name", bookedTable.idTable); ViewBag.idTable = new SelectList(db.Tables, "idTable", "name", bookedTable.idTable); return View(bookedTable); }