示例#1
0
 public ActionResult Edit(Contract contract)
 {
     contract.TotalCost       = db.Services.Find(contract.ServiceId).Price *((contract.ContractFinishDate - contract.ContractStartDate).TotalDays + 1);
     db.Entry(contract).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Table"));
 }
示例#2
0
        public ActionResult Create([Bind(Include = "ReservacionID")] Reservacion reservacion)
        {
            if (ModelState.IsValid)
            {
                db.Reservacion.Add(reservacion);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(reservacion));
        }
        public ActionResult Create([Bind(Include = "AerolineaID,Nombre")] Aerolinea aerolinea)
        {
            if (ModelState.IsValid)
            {
                db.Aereolinea.Add(aerolinea);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aerolinea));
        }
示例#4
0
        public ActionResult Create([Bind(Include = "PaisID,Nombre")] Pais pais)
        {
            if (ModelState.IsValid)
            {
                db.Pais.Add(pais);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pais));
        }
示例#5
0
        public ActionResult Create([Bind(Include = "AvionID,Nombre")] Avion avion)
        {
            if (ModelState.IsValid)
            {
                db.Avion.Add(avion);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(avion));
        }
示例#6
0
        public ActionResult Create([Bind(Include = "PuestoID,estado")] Puesto puesto)
        {
            if (ModelState.IsValid)
            {
                db.puesto.Add(puesto);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(puesto));
        }
示例#7
0
        public ActionResult Create([Bind(Include = "VueloID,Nombre,HoraSalida,HoraLlegada,Destino,Fecha")] Vuelo vuelo)
        {
            if (ModelState.IsValid)
            {
                db.Vuelo.Add(vuelo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(vuelo));
        }
示例#8
0
 public ActionResult Edit(Administrator administrator)
 {
     db.Entry(administrator).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Table"));
 }
示例#9
0
 public ActionResult Edit(Service service)
 {
     db.Entry(service).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Table"));
 }
示例#10
0
 public ActionResult Edit(Base aerobase)
 {
     db.Entry(aerobase).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Table"));
 }
示例#11
0
 public ActionResult Edit(Aircraft aircraft)
 {
     db.Entry(aircraft).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Table"));
 }
示例#12
0
 public ActionResult Edit(Customer customer)
 {
     db.Entry(customer).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Table"));
 }