// PUT api/NhaXuatBan/5
        public 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
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NHA_XUAT_BANExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        // PUT api/Sach/5


        public IHttpActionResult PutSACH(long id, SACH sach)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != sach.MA_SACH)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #3
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));
        }
        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));
        }
Beispiel #5
0
 public ActionResult Edit([Bind(Include = "MA_DM,TEN_DM")] DANH_MUC danh_muc)
 {
     if (ModelState.IsValid)
     {
         db.Entry(danh_muc).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(danh_muc));
 }
Beispiel #6
0
 public ActionResult Edit([Bind(Include = "USERNAME,PASSWORD,IDQH,XACTHUC,BARCODE,EMAIL,HO_TEN,DIA_CHI")] NGUOI_DUNG nguoi_dung)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nguoi_dung).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nguoi_dung));
 }
Beispiel #7
0
 public ActionResult Edit([Bind(Include = "MA_NXB,TEN_NXB")] NHA_XUAT_BAN nha_xuat_ban)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nha_xuat_ban).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nha_xuat_ban));
 }
Beispiel #8
0
 public ActionResult Edit([Bind(Include = "MA_HD,USERNAME,IDTT,DIA_CHI,HO_TEN,DIEN_THOAI,NGAYDATHANG,GHI_CHU,TONG_TIEN")] HOA_DON hoa_don)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hoa_don).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(hoa_don));
 }