コード例 #1
0
 public ActionResult Edit([Bind(Include = "MId,Mname,Price")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
コード例 #2
0
ファイル: TheatresController.cs プロジェクト: 845289/c-
 public ActionResult Edit([Bind(Include = "TId,Tname,Tlocation,MovieMId")] Theatre theatre)
 {
     if (ModelState.IsValid)
     {
         db.Entry(theatre).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MovieMId = new SelectList(db.Movies, "MId", "Mname", theatre.MovieMId);
     return(View(theatre));
 }