Beispiel #1
0
        public IHttpActionResult PostTR_PEND_CLIENTES(TR_PEND_CLIENTES tR_PEND_CLIENTES)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.TR_PEND_CLIENTES.Add(tR_PEND_CLIENTES);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (TR_PEND_CLIENTESExists(tR_PEND_CLIENTES.c_CODCLIENTE))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = tR_PEND_CLIENTES.c_CODCLIENTE }, tR_PEND_CLIENTES));
        }
Beispiel #2
0
        public IHttpActionResult PutTR_PEND_CLIENTES(string id, TR_PEND_CLIENTES tR_PEND_CLIENTES)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tR_PEND_CLIENTES.c_CODCLIENTE)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #3
0
        public IHttpActionResult GetTR_PEND_CLIENTES(string id)
        {
            TR_PEND_CLIENTES tR_PEND_CLIENTES = db.TR_PEND_CLIENTES.Find(id);

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

            return(Ok(tR_PEND_CLIENTES));
        }
Beispiel #4
0
        public IHttpActionResult DeleteTR_PEND_CLIENTES(string id)
        {
            TR_PEND_CLIENTES tR_PEND_CLIENTES = db.TR_PEND_CLIENTES.Find(id);

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

            db.TR_PEND_CLIENTES.Remove(tR_PEND_CLIENTES);
            db.SaveChanges();

            return(Ok(tR_PEND_CLIENTES));
        }