public ActionResult WaitingProperty(int?page = 1) { int pageSize = 12; int pageIndex = 1; pageIndex = page.HasValue ? Convert.ToInt32(page) : 1; IPagedList <ProductAttributeMapping> list = _productAttributeMappingService.GetProductAttributeMappings().Where(p => !p.Value.Equals(User.Identity.Name) && p.ProductAttributeId == 19 && !p.Product.IsPublic && p.Product.IsHomePage && p.Product.IsHomePage && !p.Product.Deleted).ToPagedList(pageIndex, pageSize); return(View(list)); }
public ActionResult nhaban() { MenuModelsView model = new MenuModelsView(); model.listCategory = _productCategoryService.GetProductCategories().Where(p => p.IsPublish == true).ToList(); model.listProduct = _productAttributeMappingService.GetProductAttributeMappings().Where(p => p.ProductAttributeId == 24 && p.Value.Equals("true")).Take(4).ToList(); return(PartialView("nhabanNav", model)); }
public ActionResult SanPham(string slug) { var item = _productAttributeMappingService.GetProductAttributeMappings(); ProductDetailsModel model = new ProductDetailsModel(); model.product = _productService.GetProductBySlug(slug); double productPrice = model.product.OrginalPrice; try { if (model.product.ProductAttributeMappings.Where(p => p.ProductAttributeId == 24).FirstOrDefault().Value.Equals("true")) { model.listRelated = _productAttributeMappingService.GetProductAttributeMappings().Where(p => p.Value.Equals("true") && p.ProductAttributeId == 24).Select(p => p.Product).Where(e => (e.OrginalPrice >= productPrice - 1000000000) && (e.OrginalPrice <= productPrice + 1000000000)).Take(6).ToList(); } else { model.listRelated = _productAttributeMappingService.GetProductAttributeMappings().Where(p => !p.Value.Equals("true") && p.ProductAttributeId == 24).Select(p => p.Product).Where(e => (e.OrginalPrice >= productPrice - 2000000) && (e.OrginalPrice <= productPrice + 2000000)).Take(6).ToList(); } } catch { model.listRelated = null; } //if (model.li) //{ //} var moigioi = GetInfo(model.product.ProductAttributeMappings.Where(p => p.ProductAttributeId == 19).FirstOrDefault().Value); model.user = moigioi; model.products = _productService.GetAllProducts().ToList(); return(View("SanPham", model)); }