Пример #1
0
        public IHttpActionResult PostMA_DOCUMENTOS_FISCAL(MA_DOCUMENTOS_FISCAL mA_DOCUMENTOS_FISCAL)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.MA_DOCUMENTOS_FISCAL.Add(mA_DOCUMENTOS_FISCAL);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (MA_DOCUMENTOS_FISCALExists(mA_DOCUMENTOS_FISCAL.cu_DocumentoStellar))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = mA_DOCUMENTOS_FISCAL.cu_DocumentoStellar }, mA_DOCUMENTOS_FISCAL));
        }
Пример #2
0
        public IHttpActionResult PutMA_DOCUMENTOS_FISCAL(string id, MA_DOCUMENTOS_FISCAL mA_DOCUMENTOS_FISCAL)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != mA_DOCUMENTOS_FISCAL.cu_DocumentoStellar)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #3
0
        public IHttpActionResult GetMA_DOCUMENTOS_FISCAL(string id)
        {
            MA_DOCUMENTOS_FISCAL mA_DOCUMENTOS_FISCAL = db.MA_DOCUMENTOS_FISCAL.Find(id);

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

            return(Ok(mA_DOCUMENTOS_FISCAL));
        }
Пример #4
0
        public IHttpActionResult DeleteMA_DOCUMENTOS_FISCAL(string id)
        {
            MA_DOCUMENTOS_FISCAL mA_DOCUMENTOS_FISCAL = db.MA_DOCUMENTOS_FISCAL.Find(id);

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

            db.MA_DOCUMENTOS_FISCAL.Remove(mA_DOCUMENTOS_FISCAL);
            db.SaveChanges();

            return(Ok(mA_DOCUMENTOS_FISCAL));
        }