public ActionResult DeleteConfirmed(int id) { Book_Request book_Request = db.Book_Request.Find(id); db.Book_Request.Remove(book_Request); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Book_Request_ID,Customer_ID,Book_Title,Book_Author,Book_Edition,Book_Request_Description,Customer_Name,Customer_Surname,Customer_Phone")] Book_Request book_Request) { if (ModelState.IsValid) { db.Entry(book_Request).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Customer_ID = new SelectList(db.Customers, "Customer_ID", "Customer_Name", book_Request.Customer_ID); return(View(book_Request)); }
public ActionResult Create([Bind(Include = "Book_Request_ID,Customer_ID,Book_Title,Book_Author,Book_Edition,Customer_Name,Customer_Surname,Customer_Phone")] Book_Request book_Request) { if (ModelState.IsValid) { db.Book_Request.Add(book_Request); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Customer_ID = new SelectList(db.Customers, "Customer_ID", "Customer_Name", book_Request.Customer_ID); return(View(book_Request)); }
// GET: Book_Request/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Book_Request book_Request = db.Book_Request.Find(id); if (book_Request == null) { return(HttpNotFound()); } return(View(book_Request)); }
// GET: Book_Request/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Book_Request book_Request = db.Book_Request.Find(id); if (book_Request == null) { return(HttpNotFound()); } ViewBag.Customer_ID = new SelectList(db.Customers, "Customer_ID", "Customer_Name", book_Request.Customer_ID); return(View(book_Request)); }