Exemple #1
0
        public async Task <IHttpActionResult> PutServiciosEmpresasPuntos(int id, ServiciosEmpresasPuntos serviciosEmpresasPuntos)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != serviciosEmpresasPuntos.Id_ServicioEmpresaPunto)
            {
                return(BadRequest());
            }

            db.Entry(serviciosEmpresasPuntos).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ServiciosEmpresasPuntosExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #2
0
        public async Task <IHttpActionResult> GetServiciosEmpresasPuntos(int id)
        {
            ServiciosEmpresasPuntos serviciosEmpresasPuntos = await db.ServiciosEmpresasPuntos.FindAsync(id);

            if (serviciosEmpresasPuntos == null)
            {
                return(NotFound());
            }

            return(Ok(serviciosEmpresasPuntos));
        }
        public IHttpActionResult GetServiciosEmpresasPuntos(int id)
        {
            ServiciosEmpresasPuntos serviciosEmpresasPuntos = db.ServiciosEmpresasPuntos.Find(id);

            if (serviciosEmpresasPuntos == null)
            {
                return(NotFound());
            }

            return(Ok(serviciosEmpresasPuntos));
        }
Exemple #4
0
        public async Task <IHttpActionResult> PostServiciosEmpresasPuntos(ServiciosEmpresasPuntos serviciosEmpresasPuntos)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ServiciosEmpresasPuntos.Add(serviciosEmpresasPuntos);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = serviciosEmpresasPuntos.Id_ServicioEmpresaPunto }, serviciosEmpresasPuntos));
        }
Exemple #5
0
        public async Task <IHttpActionResult> DeleteServiciosEmpresasPuntos(int id)
        {
            ServiciosEmpresasPuntos serviciosEmpresasPuntos = await db.ServiciosEmpresasPuntos.FindAsync(id);

            if (serviciosEmpresasPuntos == null)
            {
                return(NotFound());
            }

            db.ServiciosEmpresasPuntos.Remove(serviciosEmpresasPuntos);
            await db.SaveChangesAsync();

            return(Ok(serviciosEmpresasPuntos));
        }
        public IHttpActionResult DeleteServiciosEmpresasPuntos(int id)
        {
            ServiciosEmpresasPuntos serviciosEmpresasPuntos = db.ServiciosEmpresasPuntos.Find(id);

            if (serviciosEmpresasPuntos == null)
            {
                return(NotFound());
            }

            db.ServiciosEmpresasPuntos.Remove(serviciosEmpresasPuntos);
            db.SaveChanges();

            return(Ok(serviciosEmpresasPuntos));
        }