Beispiel #1
0
        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"));
            }
        }
Beispiel #2
0
        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();
 }
Beispiel #4
0
 public FeedbackDAO()
 {
     db = new WebXeMotoDBContext();
 }
Beispiel #5
0
 public ColorDAO()
 {
     db = new WebXeMotoDBContext();
 }
 public ContactDAO()
 {
     db = new WebXeMotoDBContext();
 }
Beispiel #7
0
 public AccountDAO()
 {
     db = new WebXeMotoDBContext();
 }
Beispiel #8
0
 public CarManufacturerDAO()
 {
     db = new WebXeMotoDBContext();
 }
Beispiel #9
0
 public CylinderCapacityDAO()
 {
     db = new WebXeMotoDBContext();
 }
 public StaticPageDAO()
 {
     db = new WebXeMotoDBContext();
 }
Beispiel #11
0
 public ProductDAO()
 {
     db = new WebXeMotoDBContext();
 }
Beispiel #12
0
 public UserDAO()
 {
     db = new WebXeMotoDBContext();
 }
Beispiel #13
0
 public NewsDAO()
 {
     db = new WebXeMotoDBContext();
 }
 public OrdersDetailDAO()
 {
     db = new WebXeMotoDBContext();
 }