示例#1
0
        public IHttpActionResult PostMA_RTF_ESC(MA_RTF_ESC mA_RTF_ESC)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.MA_RTF_ESC.Add(mA_RTF_ESC);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (MA_RTF_ESCExists(mA_RTF_ESC.cs_codigo_Rtf))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = mA_RTF_ESC.cs_codigo_Rtf }, mA_RTF_ESC));
        }
示例#2
0
        public IHttpActionResult PutMA_RTF_ESC(string id, MA_RTF_ESC mA_RTF_ESC)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != mA_RTF_ESC.cs_codigo_Rtf)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#3
0
        public IHttpActionResult GetMA_RTF_ESC(string id)
        {
            MA_RTF_ESC mA_RTF_ESC = db.MA_RTF_ESC.Find(id);

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

            return(Ok(mA_RTF_ESC));
        }
示例#4
0
        public IHttpActionResult DeleteMA_RTF_ESC(string id)
        {
            MA_RTF_ESC mA_RTF_ESC = db.MA_RTF_ESC.Find(id);

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

            db.MA_RTF_ESC.Remove(mA_RTF_ESC);
            db.SaveChanges();

            return(Ok(mA_RTF_ESC));
        }