示例#1
0
        public IHttpActionResult PostMA_TRANSACCION(MA_TRANSACCION mA_TRANSACCION)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.MA_TRANSACCION.Add(mA_TRANSACCION);

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

            return(CreatedAtRoute("DefaultApi", new { id = mA_TRANSACCION.c_Numero }, mA_TRANSACCION));
        }
示例#2
0
        public IHttpActionResult PutMA_TRANSACCION(string id, MA_TRANSACCION mA_TRANSACCION)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#3
0
        public IHttpActionResult GetMA_TRANSACCION(string id)
        {
            MA_TRANSACCION mA_TRANSACCION = db.MA_TRANSACCION.Find(id);

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

            return(Ok(mA_TRANSACCION));
        }
示例#4
0
        public IHttpActionResult DeleteMA_TRANSACCION(string id)
        {
            MA_TRANSACCION mA_TRANSACCION = db.MA_TRANSACCION.Find(id);

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

            db.MA_TRANSACCION.Remove(mA_TRANSACCION);
            db.SaveChanges();

            return(Ok(mA_TRANSACCION));
        }