Esempio n. 1
0
        public async Task <IHttpActionResult> PutNHA_XUAT_BAN(long id, NHA_XUAT_BAN nHA_XUAT_BAN)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != nHA_XUAT_BAN.MA_NXB)
            {
                return(BadRequest());
            }

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

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NHA_XUAT_BANExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> PutDANH_MUC(long id, DANH_MUC dANH_MUC)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != dANH_MUC.MA_DM)
            {
                return(BadRequest());
            }

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

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DANH_MUCExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }