public IHttpActionResult PutServiciosEmpresa(int id, ServiciosEmpresa serviciosEmpresa) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != serviciosEmpresa.Id_ServicioEmpresa) { return(BadRequest()); } db.Entry(serviciosEmpresa).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ServiciosEmpresaExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
private void inicializarServicios() { try { serviciosViewempresa = (ServiciosViewempresa)Configurador.ConfigurarServicio(typeof(ServiciosViewempresa)); serviciosViewempresa.AutenticacionValue = new WS_ServiciosViewempresa.Autenticacion() { usuario = "U", contrasena = "1" }; serviciosEmpresa = (ServiciosEmpresa)Configurador.ConfigurarServicio(typeof(ServiciosEmpresa)); serviciosEmpresa.AutenticacionValue = new WS_ServiciosEmpresa.Autenticacion() { usuario = "U", contrasena = "1" }; serviciosImagen = (ServiciosImagen)Configurador.ConfigurarServicio(typeof(ServiciosImagen)); serviciosImagen.AutenticacionValue = new WS_ServiciosImagen.Autenticacion() { usuario = "U", contrasena = "1" }; } catch (Exception exp) { Controles.mensajes.mensajeError(exp.Message); } }
public IHttpActionResult GetServiciosEmpresa(int id) { ServiciosEmpresa serviciosEmpresa = db.ServiciosEmpresa.Find(id); if (serviciosEmpresa == null) { return(NotFound()); } return(Ok(serviciosEmpresa)); }
public async Task <IHttpActionResult> GetServiciosEmpresa(int id) { ServiciosEmpresa serviciosEmpresa = await db.ServiciosEmpresa.FindAsync(id); if (serviciosEmpresa == null) { return(NotFound()); } return(Ok(serviciosEmpresa)); }
public IHttpActionResult PostServiciosEmpresa(ServiciosEmpresa serviciosEmpresa) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ServiciosEmpresa.Add(serviciosEmpresa); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = serviciosEmpresa.Id_ServicioEmpresa }, serviciosEmpresa)); }
private void InicializarServicios() { serviciosEmpresa = (ServiciosEmpresa)Configurador.ConfigurarServicio(typeof(ServiciosEmpresa)); serviciosEmpresa.AutenticacionValue = new WS_ServiciosEmpresa.Autenticacion() { usuario = "U", contrasena = "1" }; serviciosImagen = (ServiciosImagen)Configurador.ConfigurarServicio(typeof(ServiciosImagen)); serviciosImagen.AutenticacionValue = new WS_ServiciosImagen.Autenticacion() { usuario = "U", contrasena = "1" }; }
public IHttpActionResult DeleteServiciosEmpresa(int id) { ServiciosEmpresa serviciosEmpresa = db.ServiciosEmpresa.Find(id); if (serviciosEmpresa == null) { return(NotFound()); } db.ServiciosEmpresa.Remove(serviciosEmpresa); db.SaveChanges(); return(Ok(serviciosEmpresa)); }
public async Task <IHttpActionResult> DeleteServiciosEmpresa(int id) { ServiciosEmpresa serviciosEmpresa = await db.ServiciosEmpresa.FindAsync(id); if (serviciosEmpresa == null) { return(NotFound()); } db.ServiciosEmpresa.Remove(serviciosEmpresa); await db.SaveChangesAsync(); return(Ok(serviciosEmpresa)); }