示例#1
0
        public IHttpActionResult PutCATALOG(int id, CATALOG cATALOG)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != cATALOG.CATA_ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#2
0
        public IHttpActionResult PutYEAR(int id, YEAR yEAR)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != yEAR.YEAR_ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }