Exemplo n.º 1
0
        public ActionResult Banner()
        {
            //IEnumerable<ProductDetail> productDetails = new ProductDetailF().accessDatabase.Where(x => x.Images.)
            IEnumerable <Image> model = new ProductImageF().accessDatabase.Where(x => x.Official == true);

            return(PartialView(model));
        }
Exemplo n.º 2
0
        public ActionResult ImageProduct(string Id)//ProductDetail Pdetail)
        {
            //ProductDetail Pdetail = new ProductDetailF().accessDatabase.FirstOrDefault();
            IEnumerable <Image> model = new ProductImageF().accessDatabase.Where(x => x.ProductID == Id);

            return(PartialView("ImageProduct", model));
        }
Exemplo n.º 3
0
        // GET: AdminArea/ImagesAdmin
        public ActionResult Index(int page = 1, int pageSize = 5)
        {
            IEnumerable <Image> ProductImages = new ProductImageF().accessDatabase.OrderByDescending(x => x.url).ToPagedList(page, pageSize);

            ViewBag.Model = ProductImages;
            return(View(ProductImages));
        }
Exemplo n.º 4
0
        public ActionResult HeroSection()
        {
            ProductImageF productImageF = new ProductImageF();
            var           model         = productImageF.accessDatabase.Where(x => x.ProductDetail.Advertise == true).ToList();

            return(PartialView(model));
        }
Exemplo n.º 5
0
        public ActionResult Delete(Image images)
        {
            // phần xoá liên quan tới nhiều bảng khác anh em phải xoá các mấy bảng khác mới xoá được
            ProductImageF model = new ProductImageF();

            model.Delete(images);
            model.Save();
            return(RedirectToAction("Index", "ProductAdmin"));
        }
Exemplo n.º 6
0
        public ActionResult Index(string search)
        {
            var model = new ProductImageF().accessDatabase.Where(x => String.Compare(x.ProductDetail.Product.Name, search) >= 0 && x.Official == true).ToList();

            if (model.Count > 0)
            {
                return(View("Index", model));
            }
            return(View("Index"));
        }
Exemplo n.º 7
0
        public ActionResult Edit(Image model)
        {
            if (ModelState.IsValid)
            {
                ProductImageF productImageF = new ProductImageF();
                productImageF.Update(model);
                return(RedirectToAction("Index", "PDAdmin"));
            }
            IEnumerable <Product> productList = new ProductF().accessDatabase;

            ViewBag.ProductID = new SelectList(productList, "id", "Name", model.id);
            return(View());
        }
Exemplo n.º 8
0
        public ActionResult CategoryBody(string id)
        {
            var image = new ProductImageF().accessDatabase.Where(x => x.Official == true).ToList();
            var item  = image.Where(x => x.ProductDetail.Product.Species.Category.id == id).ToList();

            if (item.Count > 0)
            {
                var model = item.Where(x => x.ProductDetail != null).ToList();
                if (model.Count > 0)
                {
                    return(PartialView(model));
                }
            }
            else
            {
                var tryitem = image.Where(x => x.ProductDetail.Product.Species.id == id).ToList();
                var model   = tryitem.Where(x => x.ProductDetail != null).ToList();
                if (model.Count > 0)
                {
                    return(PartialView(model));
                }
            }
            return(PartialView());
        }
Exemplo n.º 9
0
        public ActionResult Delete(string id)
        {
            Image image = new ProductImageF().FindImage(id);

            return(View(image));
        }