Esempio n. 1
0
        public IHttpActionResult PostMA_CXP_IMPUESTOS(MA_CXP_IMPUESTOS mA_CXP_IMPUESTOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.MA_CXP_IMPUESTOS.Add(mA_CXP_IMPUESTOS);

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

            return(CreatedAtRoute("DefaultApi", new { id = mA_CXP_IMPUESTOS.cs_documento }, mA_CXP_IMPUESTOS));
        }
Esempio n. 2
0
        public IHttpActionResult PutMA_CXP_IMPUESTOS(string id, MA_CXP_IMPUESTOS mA_CXP_IMPUESTOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 3
0
        public IHttpActionResult GetMA_CXP_IMPUESTOS(string id)
        {
            MA_CXP_IMPUESTOS mA_CXP_IMPUESTOS = db.MA_CXP_IMPUESTOS.Find(id);

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

            return(Ok(mA_CXP_IMPUESTOS));
        }
Esempio n. 4
0
        public IHttpActionResult DeleteMA_CXP_IMPUESTOS(string id)
        {
            MA_CXP_IMPUESTOS mA_CXP_IMPUESTOS = db.MA_CXP_IMPUESTOS.Find(id);

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

            db.MA_CXP_IMPUESTOS.Remove(mA_CXP_IMPUESTOS);
            db.SaveChanges();

            return(Ok(mA_CXP_IMPUESTOS));
        }