Example #1
0
        public IHttpActionResult PutLICHLAMVIEC(int id, LICHLAMVIEC lICHLAMVIEC)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != lICHLAMVIEC.STT)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutGIANGVIEN(int id, GIANGVIEN gIANGVIEN)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != gIANGVIEN.MaGV)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #3
0
        public IHttpActionResult PutBOMONTRUNGTAM(int id, BOMONTRUNGTAM bOMONTRUNGTAM)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != bOMONTRUNGTAM.MaBm)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }