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)); }
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)); }