public ActionResult DeleteConfirmed(int id) { Book_Language book_Language = db.Book_Language.Find(id); db.Book_Language.Remove(book_Language); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Language")] Book_Language book_Language) { if (ModelState.IsValid) { db.Entry(book_Language).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(book_Language)); }
public ActionResult Create([Bind(Include = "Id,Language")] Book_Language book_Language) { if (ModelState.IsValid) { db.Book_Language.Add(book_Language); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(book_Language)); }
// GET: Books/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Book book = db.Book.Find(id); Book_Language language = db.Book_Language.FirstOrDefault(b => b.Id == book.LanguageId); Book_Type book_Type = db.Book_Type.FirstOrDefault(t => t.Id == book.TypeId); User publisher = db.Users.FirstOrDefault(p => p.Id == book.PublisherId); if (book == null) { return(HttpNotFound()); } return(View(book)); }
// GET: BookLanguage/Edit/5 public ActionResult Edit(int?id) { if (userAuth.UserCheck(1)) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Book_Language book_Language = db.Book_Language.Find(id); if (book_Language == null) { return(HttpNotFound()); } return(View(book_Language)); } else { return(RedirectToAction("Home", "Home")); } }