Пример #1
0
 public ActionResult Edit([Bind(Include = "OrderId,OrderDate,Username,FirstName,LastName,Adress,City,State,PostalCose,Country,Phone,Email,Total")] Order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(order));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "ArtistId,Name")] Artist artist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(artist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(artist));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "GenreId,Name,Description")] Genre genre)
 {
     if (ModelState.IsValid)
     {
         db.Entry(genre).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(genre));
 }
Пример #4
0
 public ActionResult Edit(Genre genre)
 {
     if (ModelState.IsValid)
     {
         db.Entry(genre).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(genre));
 }
 public ActionResult Edit([Bind(Include = "ID,Title,ReleaseDate,Genre,Price")] MVCMovie mVCMovie)
 {
     if (ModelState.IsValid)//表单数据是否可用于修改(编辑或更新)一个 Movie 对象
     {
         db.Entry(mVCMovie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mVCMovie));
 }
Пример #6
0
 public ActionResult Edit([Bind(Include = "AlbumId,GenreId,ArtistId,Title,Price,AlbumArtUrl")] Album album)
 {
     if (ModelState.IsValid)
     {
         db.Entry(album).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ArtistId = new SelectList(db.Artists, "ArtistId", "Name", album.ArtistId);
     ViewBag.GenreId  = new SelectList(db.Genres, "GenreId", "Name", album.GenreId);
     return(View(album));
 }