public void OnGet() { CategoryIndexVM = _cate.GetCategoryListVm("", "", 1); var n = from m in _context.Products orderby m.Id descending select m.Id; mm = n.First(); // int mm = n.First(); objOrders = new List <ObjOrder>(); int[] a = new int[100]; int[] sl = new int[100]; for (int i = 1; i <= mm; i++) { string tmp = Convert.ToString(i); int temp = HttpContext.Session.GetInt32(tmp).GetValueOrDefault(); if (temp != 0) { a[i] = i; sl[i] = temp; objOrders.Add(new ObjOrder(tmp, temp)); } } var ids = a; var _products = _context.Products.Where(x => ids.Contains(x.Id)); Products = _products.ToList(); }
public IActionResult Index(int pageIndex = 1) { if (HttpContext.Session.GetInt32("LoginLevel") != 2) { ViewBag.checkLogin = 0; return(View("../Home/AddCart")); } IndexVm CategoryIndexVM = _categoryService.GetCategoryListVm(pageIndex); return(View(CategoryIndexVM)); }
public IActionResult OnGet(int?id) { if (id == null) { return(NotFound()); } CategoryIndexVM = _categoryService.GetCategoryListVm("", "", 1); var product = _context.GetProduct(id ?? default(int)); if (product == null) { return(NotFound()); } Product = _mapper.Map <ProductDto, SaveProductDto>(product); return(Page()); }
public void OnGet(string searchString, int pageIndex = 1) { CategoryIndexVM = _CategoryService.GetCategoryListVm(SearchString, CategoryGenre, pageIndex); }
public void OnGet(string searchString, int pageIndex = 1) { ProductIndexVm = _productService.GetProductListVm1(SearchString, categoryGenre, pageIndex); CategoryIndexVm = _pro.GetCategoryListVm("", "", pageIndex); }
public IActionResult OnGet() { CategoryIndexVM = _categoryService.GetCategoryListVm("", "", 1); return(Page()); }