예제 #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());
        }
예제 #2
0
 public void Edit(ComicBook comicbook)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comicbook).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
예제 #3
0
 public ActionResult Edit(Publisher publisher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(publisher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(publisher));
 }
예제 #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));
 }
예제 #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));
 }
예제 #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));
 }
예제 #7
0
 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));
 }
예제 #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));
 }