Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "MaCuaHang,TenCuaHang,DiaChi,SoDienThoai")] CuaHang cuaHang)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cuaHang).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cuaHang));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "MaSP,TenSP,GiaBan,MoTa,HinhAnh,NgayCapNhat,SoLuongTon,MaNCC,MaNhom")] SanPham sanPham)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sanPham).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaNCC  = new SelectList(db.NhaCungCaps, "MaNCC", "TenNCC", sanPham.MaNCC);
     ViewBag.MaNhom = new SelectList(db.NhomSPs, "MaNhom", "TenNhom", sanPham.MaNhom);
     return(View(sanPham));
 }