Example #1
0
        // Thay đổi status
        public JsonResult BrandStatus(int id)
        {
            ProductCategorySmallDao psd = new ProductCategorySmallDao();

            psd.ChangeStatus(id);
            ProductDao pd = new ProductDao();

            var product = pd.GetProductByBrand(id);

            foreach (var item in product)
            {
                pd.ChangeStatus(item.ID);
            }

            return(Json(new { status = true }));
        }
Example #2
0
        // Thay đổi cate status
        public JsonResult CateStatus(int id)
        {
            ProductCategoryDao      pcd  = new ProductCategoryDao();
            ProductCategorySmallDao pcsd = new ProductCategorySmallDao();
            ProductDao pd = new ProductDao();

            var brand = pcsd.ListByCategoryAdmin(id);

            foreach (var item in brand)
            {
                pcsd.ChangeStatus(item.ID);
                var product = pd.GetProductByBrand(item.ID).ToList();
                foreach (var item2 in product)
                {
                    pd.ChangeStatus(item2.ID);
                }
            }

            pcd.ChangeStatus(id);
            return(Json(new { status = true }));
        }