Пример #1
0
 public ActionResult Edit([Bind(Include = "countryid,countryname")] CountryT countryT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(countryT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(countryT));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "customerid,customername,customersurname,birthdate,phone,email,address")] CustomerT customerT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customerT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customerT));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "hotelid,hotelname,hotelcapacity,hoteltype,hotelprice,hotelphone,hoteladdress,countryid,tourid")] HotelT hotelT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hotelT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.countryid = new SelectList(db.CountryT, "countryid", "countryname", hotelT.countryid);
     ViewBag.tourid    = new SelectList(db.TourT, "tourid", "tourname", hotelT.tourid);
     return(View(hotelT));
 }
 public ActionResult Edit([Bind(Include = "tourid,tourname,tourprice,tourcapacity,startdate,finishdate,tourtypeid,countryid")] TourT tourT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tourT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.countryid  = new SelectList(db.CountryT, "countryid", "countryname", tourT.countryid);
     ViewBag.tourtypeid = new SelectList(db.TourtypeT, "tourtypeid", "tourtypename", tourT.tourtypeid);
     return(View(tourT));
 }
 public ActionResult Edit([Bind(Include = "reservationid,reservationnumber,customerid,tourid,status,hotelid")] ReservationT reservationT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(reservationT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.customerid = new SelectList(db.CustomerT, "customerid", "customername", reservationT.customerid);
     ViewBag.hotelid    = new SelectList(db.HotelT, "hotelid", "hotelname", reservationT.hotelid);
     ViewBag.tourid     = new SelectList(db.TourT, "tourid", "tourname", reservationT.tourid);
     return(View(reservationT));
 }