Beispiel #1
0
        public IHttpActionResult PostMA_CONCEPTOS(MA_CONCEPTOS mA_CONCEPTOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.MA_CONCEPTOS.Add(mA_CONCEPTOS);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (MA_CONCEPTOSExists(mA_CONCEPTOS.IDCONCEPTO))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = mA_CONCEPTOS.IDCONCEPTO }, mA_CONCEPTOS));
        }
Beispiel #2
0
        public IHttpActionResult PutMA_CONCEPTOS(decimal id, MA_CONCEPTOS mA_CONCEPTOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != mA_CONCEPTOS.IDCONCEPTO)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #3
0
        public IHttpActionResult GetMA_CONCEPTOS(decimal id)
        {
            MA_CONCEPTOS mA_CONCEPTOS = db.MA_CONCEPTOS.Find(id);

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

            return(Ok(mA_CONCEPTOS));
        }
Beispiel #4
0
        public IHttpActionResult DeleteMA_CONCEPTOS(decimal id)
        {
            MA_CONCEPTOS mA_CONCEPTOS = db.MA_CONCEPTOS.Find(id);

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

            db.MA_CONCEPTOS.Remove(mA_CONCEPTOS);
            db.SaveChanges();

            return(Ok(mA_CONCEPTOS));
        }