コード例 #1
0
 public ActionResult Edit([Bind(Include = "Id,IsAvailable,SeatNumber,PassengerId,BusId,Time")] Seat seat)
 {
     if (ModelState.IsValid)
     {
         repository.Update(seat);
         repository.Save();
         return(RedirectToAction("Index"));
     }
     ViewBag.BusId       = new SelectList(repository_b.All, "BusId", "NrReg", seat.BusId);
     ViewBag.PassengerId = new SelectList(repository_p.All, "Id", "Name", seat.PassengerId);
     return(View(seat));
 }