コード例 #1
0
 public ActionResult Edit([Bind(Include = "UserID,Name,Username,password")] Admin admin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(admin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(admin));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "FlightId,Name,Day,Seat,Source,Destination,Distance")] Flight flight)
 {
     if (ModelState.IsValid)
     {
         db.Entry(flight).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(flight));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "UserID,Name,Contact,Address,Gender,Email,Username,password")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "bookingId,SeatType,DayofJry,Amt")] Booking booking)
 {
     if (ModelState.IsValid)
     {
         db.Entry(booking).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(booking));
 }