public async Task <IActionResult> PutTv(string id, Tv tv) { if (id != tv.TvID) { return(BadRequest()); } _context.Entry(tv).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TvExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPago(string id, Pago pago) { if (id != pago.Id_Transaccion) { return(BadRequest()); } _context.Entry(pago).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PagoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutLinped([FromRoute] int id, [FromBody] Linped linped) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != linped.PedidoID) { return(BadRequest()); } _context.Entry(linped).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LinpedExists(id)) { return(NotFound()); } else { throw; } } return(Ok(linped)); //return NoContent(); }
public async Task <IActionResult> PutEquipo([FromRoute] string id, [FromBody] Equipo equipo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != equipo.ServiceTag) { return(BadRequest()); } _context.Entry(equipo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EquipoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutEmpleado(int id, Empleado empleado) { if (id != empleado.Codigo_Empleado) { return(BadRequest()); } _context.Entry(empleado).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmpleadoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutUsuario([FromRoute] int id, [FromBody] Usuario usuario) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != usuario.UsuarioID) { return(BadRequest()); } _context.Entry(usuario).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutObjetivo(string id, Objetivo objetivo) { if (id != objetivo.ObjetivoID) { return(BadRequest()); } _context.Entry(objetivo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ObjetivoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutLocalidad(string id, Localidad localidad) { if (id != localidad.LocalidadID) { return(BadRequest()); } _context.Entry(localidad).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LocalidadExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutGama_Producto(string id, Gama_Producto gama_Producto) { if (id != gama_Producto.Gama) { return(BadRequest()); } _context.Entry(gama_Producto).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Gama_ProductoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutProvincia(string id, Provincia provincia) { if (id != provincia.ProvinciaID) { return(BadRequest()); } _context.Entry(provincia).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProvinciaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutMemoria([FromRoute] string id, [FromBody] Memoria memoria) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != memoria.MemoriaID) { return(BadRequest()); } _context.Entry(memoria).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MemoriaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCliente(int id, Cliente cliente) { if (id != cliente.Codigo_Cliente) { return(BadRequest()); } _context.Entry(cliente).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteExists(id)) { return(NotFound()); } else { throw; } } return(Ok(cliente)); }
public async Task <IActionResult> PutStock(string id, Stock stock) { if (id != stock.ArticuloID) { return(BadRequest()); } _context.Entry(stock).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StockExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutLinped(int id, Linped linped) { if (id != linped.Linea) { return(BadRequest()); } _context.Entry(linped).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LinpedExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutDetalle_Pedido([FromRoute] int id, [FromBody] Detalle_Pedido detalle_Pedido) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != detalle_Pedido.Codigo_Pedido) { return(BadRequest()); } _context.Entry(detalle_Pedido).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Detalle_PedidoExists(id)) { return(NotFound()); } else { throw; } } return(Ok(detalle_Pedido)); }
public async Task <IActionResult> PutTicketEnCurso([FromRoute] int?id, [FromBody] TicketEnCurso ticketEnCurso) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != ticketEnCurso.Id) { return(BadRequest()); } _context.Entry(ticketEnCurso).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TicketEnCursoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }