public IHttpActionResult PutServicioBicicleta(long id, ServicioBicicleta servicioBicicleta) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != servicioBicicleta.IDServicio) { return(BadRequest()); } db.Entry(servicioBicicleta).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ServicioBicicletaExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutVentas(int id, Ventas ventas) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != ventas.crr_venta) { return(BadRequest()); } db.Entry(ventas).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!VentasExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutPedido_Bicicleta(int id, Pedido_Bicicleta pedido_Bicicleta) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pedido_Bicicleta.id_pedido) { return(BadRequest()); } db.Entry(pedido_Bicicleta).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Pedido_BicicletaExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Putstock(long id, stock stock) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != stock.id_stock) { return(BadRequest()); } db.Entry(stock).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!stockExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }