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