示例#1
0
 public ActionResult Edit([Bind(Include = "id,email_address,creditcard_number,cvc,Card_Holder")] creditcard creditcard)
 {
     if (ModelState.IsValid)
     {
         db.Entry(creditcard).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(creditcard));
 }
示例#2
0
        public ActionResult Create([Bind(Include = "Id,First_Name,Last_name,email,flightId,SeatLetter,rowseat")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                db.customer_table.Add(customer);
                db.SaveChanges();
                Session["idofcustomer"] = customer.Id;
                Flight thislight = db.flights_table.Find(customer.flightId);
                Session["flight"]         = thislight.Id;
                thislight.flight_capacity = thislight.flight_capacity - 1;
                db.Entry(thislight).State = EntityState.Modified;
                db.SaveChanges();
                Session["currentId"] = customer.Id;
                return(RedirectToAction("Seatdetails", "Customers"));
            }

            ViewBag.flightId = new SelectList(db.flights_table, "Id", "flightNumber", customer.flightId);
            return(View(customer));
        }
示例#3
0
 public ActionResult Edit([Bind(Include = "Id,flightNumber,location,destination,aircrafttype,Departure_date,Arrival_date,flight_capacity")] Flight flight)
 {
     if (ModelState.IsValid)
     {
         db.Entry(flight).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(flight));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "Id,row,seatLetter,whatflightId,idoftheCustomer,seatcapacity")] Seats seats)
 {
     if (ModelState.IsValid)
     {
         db.Entry(seats).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.whatflightId = new SelectList(db.flights_table, "Id", "flightNumber", seats.whatflightId);
     return(View(seats));
 }