コード例 #1
0
        public IHttpActionResult PostMA_PAGOS(MA_PAGOS mA_PAGOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.MA_PAGOS.Add(mA_PAGOS);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (MA_PAGOSExists(mA_PAGOS.c_Caja))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = mA_PAGOS.c_Caja }, mA_PAGOS));
        }
コード例 #2
0
        public IHttpActionResult PutMA_PAGOS(string id, MA_PAGOS mA_PAGOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != mA_PAGOS.c_Caja)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #3
0
        public IHttpActionResult GetMA_PAGOS(string id)
        {
            MA_PAGOS mA_PAGOS = db.MA_PAGOS.Find(id);

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

            return(Ok(mA_PAGOS));
        }
コード例 #4
0
        public IHttpActionResult DeleteMA_PAGOS(string id)
        {
            MA_PAGOS mA_PAGOS = db.MA_PAGOS.Find(id);

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

            db.MA_PAGOS.Remove(mA_PAGOS);
            db.SaveChanges();

            return(Ok(mA_PAGOS));
        }