Esempio n. 1
0
 public ActionResult Edit([Bind(Include = "ID,Name,MoTa")] DanhMuc danhMuc)
 {
     if (ModelState.IsValid)
     {
         db.Entry(danhMuc).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(danhMuc));
 }
 public ActionResult Edit([Bind(Include = "MaKhuyenMai,PhanTram")] KM kM)
 {
     if (ModelState.IsValid)
     {
         db.Entry(kM).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(kM));
 }
Esempio n. 3
0
 public ActionResult Edit(SanPham sanPham)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sanPham).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("IndexPage"));
     }
     ViewBag.DanhMucID   = new SelectList(db.DanhMucs, "ID", "Name", sanPham.DanhMucID);
     ViewBag.MaKhuyenMai = new SelectList(db.KmS, "MaKhuyenMai", "MaKhuyenMai", sanPham.MaKhuyenMai);
     return(View(sanPham));
 }