public IHttpActionResult PutAutomovil(int id, Automovil automovil) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != automovil.ID_Auto) { return(BadRequest()); } db.Entry(automovil).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!AutomovilExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "ID_Tipo,Tipo")] Tipo_Automovil tipo_Automovil) { if (ModelState.IsValid) { db.Entry(tipo_Automovil).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tipo_Automovil)); }
public ActionResult Edit([Bind(Include = "ID_Sucursal,Nombre,RNC,Telefono,Direccion,Latitud,Longitud")] Sucursal sucursal) { if (ModelState.IsValid) { db.Entry(sucursal).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sucursal)); }
public ActionResult Edit([Bind(Include = "ID_Empleado,Nombre,Apellido,Cedula,Email,PhoneNumber")] Empleado empleado) { if (ModelState.IsValid) { db.Entry(empleado).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(empleado)); }
public ActionResult Edit([Bind(Include = "ID_Marca,Marca1")] Marca marca) { if (ModelState.IsValid) { db.Entry(marca).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(marca)); }
public ActionResult Edit([Bind(Include = "ID_CanPasajeros,CanPasajeros")] Cant_Pasajeros cant_Pasajeros) { if (ModelState.IsValid) { db.Entry(cant_Pasajeros).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cant_Pasajeros)); }
public ActionResult Edit([Bind(Include = "ID_Condicion,ID_Auto,Condicion,Cantidad,ID_Sucursal,Detalles")] Detalle detalle) { if (ModelState.IsValid) { db.Entry(detalle).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ID_Sucursal = new SelectList(db.Automovils, "ID_Auto", "Modelo", detalle.ID_Sucursal); ViewBag.ID_Auto = new SelectList(db.Automovils, "ID_Auto", "Modelo", detalle.ID_Auto); ViewBag.ID_Sucursal = new SelectList(db.Sucursals, "ID_Sucursal", "Nombre", detalle.ID_Sucursal); return(View(detalle)); }
public ActionResult Edit([Bind(Include = "ID_Compra,ID_User,ID_Empleado,ID_Auto,Cantidad,Total")] Compra compra) { if (ModelState.IsValid) { db.Entry(compra).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ID_User = new SelectList(db.AspNetUsers, "Id", "Email", compra.ID_User); ViewBag.ID_Auto = new SelectList(db.Automovils, "ID_Auto", "Modelo", compra.ID_Auto); ViewBag.ID_Empleado = new SelectList(db.Empleados, "ID_Empleado", "Nombre", compra.ID_Empleado); return(View(compra)); }