public void UpdateStateParkCells(RecordRequest record) { // ALQU DIS ParkCells parkcell = db.ParkCells.Find(record.idCell); parkcell.state = "OCUP"; parkcell.license = record.license; db.Entry(parkcell).State = EntityState.Modified; db.SaveChanges(); }
public IHttpActionResult PutPayment(int id, Payment payment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != payment.id) { return(BadRequest()); } db.Entry(payment).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PaymentExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
//Funcion para modificar un precio public String UpdatePrice(int id, Price Price) { try { db.Entry(Price).State = EntityState.Modified; db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PriceExists(id)) { mensaje = "NOT_FOUND"; } } return(mensaje); }
public String UpdateUser(int id, User user) { try { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!UserExists(id)) { mensaje = "NOT_FOUND"; } } return(mensaje); }