public ActionResult Delete(int id) { var idpro = new WebXeMotoDBContext().Products.Where(x => x.id_CarManufacturer == id); if (idpro == null) { new CarManufacturerDAO().Delete(id); return(RedirectToAction("Index")); } else { ViewBag.Error = "Hãng xe đang chứa sản phẩm ! Bạn không thể xoá !"; return(RedirectToAction("Index")); } }
public ActionResult Delete(int id) { var idorder = new WebXeMotoDBContext().OrdersDetails.Where(x => x.id_Product == id); if (idorder == null) { new ProductDAO().Delete(id); return(RedirectToAction("Index")); } else { ViewBag.Error = "Sản phẩm đang có trong đơn hàng. Bạn không thể xoá !!!"; return(RedirectToAction("Index")); } }
public CategoryDAO() { db = new WebXeMotoDBContext(); }
public FeedbackDAO() { db = new WebXeMotoDBContext(); }
public ColorDAO() { db = new WebXeMotoDBContext(); }
public ContactDAO() { db = new WebXeMotoDBContext(); }
public AccountDAO() { db = new WebXeMotoDBContext(); }
public CarManufacturerDAO() { db = new WebXeMotoDBContext(); }
public CylinderCapacityDAO() { db = new WebXeMotoDBContext(); }
public StaticPageDAO() { db = new WebXeMotoDBContext(); }
public ProductDAO() { db = new WebXeMotoDBContext(); }
public UserDAO() { db = new WebXeMotoDBContext(); }
public NewsDAO() { db = new WebXeMotoDBContext(); }
public OrdersDetailDAO() { db = new WebXeMotoDBContext(); }