Ejemplo n.º 1
0
        public IHttpActionResult PostATTACHMENT(CV_ITEM_LINK aTTACHMENT)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.CV_ITEM_LINK.Add(aTTACHMENT);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (ATTACHMENTExists(aTTACHMENT.ID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(Ok(aTTACHMENT));
            //return CreatedAtRoute("DefaultApi", new { id = aTTACHMENT.ID }, aTTACHMENT);
        }
Ejemplo n.º 2
0
        public IHttpActionResult PutATTACHMENT(long id, CV_ITEM_LINK aTTACHMENT)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != aTTACHMENT.ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 3
0
        public IHttpActionResult GetATTACHMENT(long id)
        {
            CV_ITEM_LINK aTTACHMENT = db.CV_ITEM_LINK.Find(id);

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

            return(Ok(aTTACHMENT));
        }
Ejemplo n.º 4
0
        public IHttpActionResult DeleteATTACHMENT(long id)
        {
            CV_ITEM_LINK aTTACHMENT = db.CV_ITEM_LINK.Find(id);

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

            db.CV_ITEM_LINK.Remove(aTTACHMENT);
            db.SaveChanges();

            return(Ok(aTTACHMENT));
        }