Beispiel #1
0
        public IHttpActionResult PostMA_LIBROS_CONFIGURADOS(MA_LIBROS_CONFIGURADOS mA_LIBROS_CONFIGURADOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.MA_LIBROS_CONFIGURADOS.Add(mA_LIBROS_CONFIGURADOS);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (MA_LIBROS_CONFIGURADOSExists(mA_LIBROS_CONFIGURADOS.cs_documento))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = mA_LIBROS_CONFIGURADOS.cs_documento }, mA_LIBROS_CONFIGURADOS));
        }
Beispiel #2
0
        public IHttpActionResult PutMA_LIBROS_CONFIGURADOS(string id, MA_LIBROS_CONFIGURADOS mA_LIBROS_CONFIGURADOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != mA_LIBROS_CONFIGURADOS.cs_documento)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #3
0
        public IHttpActionResult GetMA_LIBROS_CONFIGURADOS(string id)
        {
            MA_LIBROS_CONFIGURADOS mA_LIBROS_CONFIGURADOS = db.MA_LIBROS_CONFIGURADOS.Find(id);

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

            return(Ok(mA_LIBROS_CONFIGURADOS));
        }
Beispiel #4
0
        public IHttpActionResult DeleteMA_LIBROS_CONFIGURADOS(string id)
        {
            MA_LIBROS_CONFIGURADOS mA_LIBROS_CONFIGURADOS = db.MA_LIBROS_CONFIGURADOS.Find(id);

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

            db.MA_LIBROS_CONFIGURADOS.Remove(mA_LIBROS_CONFIGURADOS);
            db.SaveChanges();

            return(Ok(mA_LIBROS_CONFIGURADOS));
        }