示例#1
0
 public bool UpdateService(Service service)
 {
     try
     {
         db.Entry(service).State = EntityState.Modified;
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "ServiceID,Name,ServiceText")] Service service)
 {
     if (ModelState.IsValid)
     {
         db.Entry(service).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(service));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "FlightID,FlightClassID,From,Destination,CompanyName,Departure,Price,DepartureTime,Capacity")] Flight flight)
 {
     if (ModelState.IsValid)
     {
         db.Entry(flight).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FlightClassID = new SelectList(db.FlightClasses, "FlightClassID", "FlightClassKind", flight.FlightClassID);
     return(View(flight));
 }