Пример #1
0
        public IHttpActionResult PutEQUIPOS_INSTALADOS(int id, EQUIPOS_INSTALADOS eQUIPOS_INSTALADOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != eQUIPOS_INSTALADOS.EQUIPO_INSTALADO_ID)
            {
                return(BadRequest());
            }

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

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EQUIPOS_INSTALADOSExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #2
0
        public IHttpActionResult GetEQUIPOS_INSTALADOS(int id)
        {
            EQUIPOS_INSTALADOS eQUIPOS_INSTALADOS = db.EQUIPOS_INSTALADOS.Find(id);

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

            return(Ok(eQUIPOS_INSTALADOS));
        }
Пример #3
0
        public IHttpActionResult PostEQUIPOS_INSTALADOS(EQUIPOS_INSTALADOS eQUIPOS_INSTALADOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.EQUIPOS_INSTALADOS.Add(eQUIPOS_INSTALADOS);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = eQUIPOS_INSTALADOS.EQUIPO_INSTALADO_ID }, eQUIPOS_INSTALADOS));
        }
Пример #4
0
        public IHttpActionResult DeleteEQUIPOS_INSTALADOS(int id)
        {
            EQUIPOS_INSTALADOS eQUIPOS_INSTALADOS = db.EQUIPOS_INSTALADOS.Find(id);

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

            db.EQUIPOS_INSTALADOS.Remove(eQUIPOS_INSTALADOS);
            db.SaveChanges();

            return(Ok(eQUIPOS_INSTALADOS));
        }