コード例 #1
0
        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"));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        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));
        }
コード例 #4
0
        // 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));
        }
コード例 #5
0
 // 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"));
     }
 }