Beispiel #1
0
        public IHttpActionResult PostMA_PAGOS_IMPUESTOS(MA_PAGOS_IMPUESTOS mA_PAGOS_IMPUESTOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.MA_PAGOS_IMPUESTOS.Add(mA_PAGOS_IMPUESTOS);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (MA_PAGOS_IMPUESTOSExists(mA_PAGOS_IMPUESTOS.c_Numero))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = mA_PAGOS_IMPUESTOS.c_Numero }, mA_PAGOS_IMPUESTOS));
        }
Beispiel #2
0
        public IHttpActionResult PutMA_PAGOS_IMPUESTOS(string id, MA_PAGOS_IMPUESTOS mA_PAGOS_IMPUESTOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != mA_PAGOS_IMPUESTOS.c_Numero)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #3
0
        public IHttpActionResult GetMA_PAGOS_IMPUESTOS(string id)
        {
            MA_PAGOS_IMPUESTOS mA_PAGOS_IMPUESTOS = db.MA_PAGOS_IMPUESTOS.Find(id);

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

            return(Ok(mA_PAGOS_IMPUESTOS));
        }
Beispiel #4
0
        public IHttpActionResult DeleteMA_PAGOS_IMPUESTOS(string id)
        {
            MA_PAGOS_IMPUESTOS mA_PAGOS_IMPUESTOS = db.MA_PAGOS_IMPUESTOS.Find(id);

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

            db.MA_PAGOS_IMPUESTOS.Remove(mA_PAGOS_IMPUESTOS);
            db.SaveChanges();

            return(Ok(mA_PAGOS_IMPUESTOS));
        }