public async Task <IActionResult> PutCuenta(int id, Cuenta cuenta) { if (id != cuenta.Id) { return(BadRequest()); } _context.Entry(cuenta).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CuentaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTipoTransaccion(int id, TipoTransaccion tipoTransaccion) { if (id != tipoTransaccion.Id) { return(BadRequest()); } _context.Entry(tipoTransaccion).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TipoTransaccionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutMovimiento(int id, Movimiento movimiento) { if (id != movimiento.Id) { return(BadRequest()); } _context.Entry(movimiento).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MovimientoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <Transaccion> crearTransaccion(Transaccion transaccion) { this.transaccion = transaccion; this.transaccion.Estado = EstadoTransaccion.Sin_confirmar; var t = _context.Transacciones.Add(this.transaccion); this.transaccion.Id = t.Entity.Id; await _context.SaveChangesAsync(); generarMovimientos(); return(transaccion); }