Example #1
0
        public async Task <IActionResult> PutComicItem(long id, ComicItem comicItem)
        {
            if (id != comicItem.Id)
            {
                return(BadRequest());
            }

            _context.Entry(comicItem).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ComicItemExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #2
0
 public void Edit(ComicBook comicbook)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comicbook).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
 public ActionResult Edit(Publisher publisher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(publisher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(publisher));
 }
Example #4
0
 public ActionResult Edit([Bind(Include = "ID,strTitle,iIssueNumber,strSeries,strPublisher,strAuthor,strArtist,iYearPublished")] Comic comic)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comic).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(comic));
 }
Example #5
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Artist artist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(artist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(artist));
 }
Example #6
0
 public ActionResult Edit([Bind(Include = "Id,Title,Description")] Series series)
 {
     if (ModelState.IsValid)
     {
         db.Entry(series).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(series));
 }
 public ActionResult Edit([Bind(Include = "Id,SeriesId,IssueNumber,Description,PublishedOn,AverageRating")] ComicBook comicbook)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comicbook).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SeriesId = new SelectList(db.Series, "Id", "Title", comicbook.SeriesId);
     return(View(comicbook));
 }
Example #8
0
 public ActionResult Edit([Bind(Include = "Id,ComicBookId,ArtistId,RoleId")] ComicBookArtist comicbookartist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comicbookartist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ArtistId    = new SelectList(db.Artists, "Id", "Name", comicbookartist.ArtistId);
     ViewBag.ComicBookId = new SelectList(db.ComicBooks, "Id", "Description", comicbookartist.ComicBookId);
     ViewBag.RoleId      = new SelectList(db.Roles, "Id", "Name", comicbookartist.RoleId);
     return(View(comicbookartist));
 }