public IHttpActionResult PutDATOSINTERES(int id, DATOSINTERES dATOSINTERES) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != dATOSINTERES.id) { return(BadRequest()); } db.Entry(dATOSINTERES).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!DATOSINTERESExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
// - - - - - MODIFICA una entidad el la tabla public static string ModificaEntidad(DATOSINTERES entidad) { DATOSINTERES e = DBAccess.ORM.dbe.DATOSINTERES.Find(entidad.id); e = entidad; return(DBAccess.ORM.SaveChanges()); }
public IHttpActionResult GetDATOSINTERES(int id) { DATOSINTERES dATOSINTERES = db.DATOSINTERES.Find(id); if (dATOSINTERES == null) { return(NotFound()); } return(Ok(dATOSINTERES)); }
public IHttpActionResult PostDATOSINTERES(DATOSINTERES dATOSINTERES) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.DATOSINTERES.Add(dATOSINTERES); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = dATOSINTERES.id }, dATOSINTERES)); }
public IHttpActionResult DeleteDATOSINTERES(int id) { DATOSINTERES dATOSINTERES = db.DATOSINTERES.Find(id); if (dATOSINTERES == null) { return(NotFound()); } db.DATOSINTERES.Remove(dATOSINTERES); db.SaveChanges(); return(Ok(dATOSINTERES)); }
public InterestDataJson(DATOSINTERES d) { this.id = d.id; this.nombre = d.nombre; this.descripcion = d.descripcion; this.direccion = d.direccion; this.ciudad = d.ciudad; this.cp = d.cp; this.idprovincia = (int)d.idprovincia; this.idccaa = (int)d.idccaa; this.telefono = d.telefono; this.email = d.email; this.contacto = d.contacto; this.iddelegacion = (int)d.iddelegacion; }
// - - - - - ELIMINA una entidad de la tabla public static string DeleteEntidad(DATOSINTERES entidad) { ORM.dbe.DATOSINTERES.Remove(entidad); return(DBAccess.ORM.SaveChanges()); }
// - - - - - INSERTA una entidad el la tabla public static string InsertaEntidad(DATOSINTERES entidad) { ORM.dbe.DATOSINTERES.Add(entidad); return(DBAccess.ORM.SaveChanges()); }