コード例 #1
0
 public ActionResult Edit([Bind(Include = "PersonId,PersonLastname,PersonFirstname,PersondateOfBirth,PersonaddressId,Personemail")] Person person)
 {
     if (ModelState.IsValid)
     {
         db.Entry(person).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(person));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "GeolocationId,GeoLatitude,GeoLongitude")] Geolocation geolocation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(geolocation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(geolocation));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "AmenityId,Amenity1,AmenityDescription")] Amenity amenity)
 {
     if (ModelState.IsValid)
     {
         db.Entry(amenity).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(amenity));
 }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "PictureId,Path,Caption")] Picture picture)
 {
     if (ModelState.IsValid)
     {
         db.Entry(picture).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(picture));
 }
コード例 #5
0
 public ActionResult Edit([Bind(Include = "AssetId,AssetName")] Asset asset)
 {
     if (ModelState.IsValid)
     {
         db.Entry(asset).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(asset));
 }
コード例 #6
0
 public ActionResult Edit([Bind(Include = "AddressId,PostalId,AddressStreetname,AddressNumber,AddressBus,AddressLand")] Address address)
 {
     if (ModelState.IsValid)
     {
         db.Entry(address).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PostalId = new SelectList(db.Postal, "PostalId", "PostalCode", address.PostalId);
     return(View(address));
 }
コード例 #7
0
 public ActionResult Edit([Bind(Include = "PaymentId,BookingId,PaymentAmount,PaymentMethod,Succesfull")] Payment payment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(payment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BookingId = new SelectList(db.Booking, "BookingId", "BookingId", payment.BookingId);
     return(View(payment));
 }
コード例 #8
0
 public ActionResult Edit([Bind(Include = "HotelId,HotelName,LocationId,Phonenumber,HotelDescription,HotelRating")] Hotel hotel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hotel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LocationId = new SelectList(db.Location, "LocationId", "LocationId", hotel.LocationId);
     return(View(hotel));
 }
コード例 #9
0
 public ActionResult Edit([Bind(Include = "LocationId,AddressId,GeolocationId")] Location location)
 {
     if (ModelState.IsValid)
     {
         db.Entry(location).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AddressId     = new SelectList(db.Address, "AddressId", "AddressStreetname", location.AddressId);
     ViewBag.GeolocationId = new SelectList(db.Geolocation, "GeolocationId", "GeolocationId", location.GeolocationId);
     return(View(location));
 }
コード例 #10
0
 public ActionResult Edit([Bind(Include = "BookingId,UserId,RoomId,BookingDate,BookingDateFrom,BookingDateTo")] Booking booking)
 {
     if (ModelState.IsValid)
     {
         db.Entry(booking).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RoomId = new SelectList(db.Room, "RoomId", "Roomdescription", booking.RoomId);
     ViewBag.UserId = new SelectList(db.User, "UserId", "UserId", booking.UserId);
     return(View(booking));
 }