public IActionResult Product(int sellerId, string searchString, int?categoryId, decimal?price, short?priceIndication, ProductStatus?status, bool?active, ProductTypeStatus?productTypeStatus, short?page = 1) { ProductSearchModel searchModel = new ProductSearchModel { SellerId = sellerId, SearchString = searchString, CategoryId = categoryId, Price = price, PriceIndication = priceIndication, Status = status, Active = active, ProductTypeStatus = productTypeStatus }; ViewData[GlobalViewBagKeys.ECommerceService] = eCommerce; return(View(new ProductsListViewModel { Products = eCommerce.GetProductsBySellerId(searchModel, (page - 1) * recordsPerPage, recordsPerPage), PagingInfo = new PagingInfo { CurrentPage = (short)page, RecordsPerPage = recordsPerPage, TotalRecords = eCommerce.CountProductsBySellerId(searchModel) }, SearchModel = searchModel })); }
public IActionResult Product(short?page = 1) { SellerView seller = loginPersistence.PersistLogin(); ProductSearchModel searchModel = new ProductSearchModel { SellerId = int.Parse(seller.Id) }; ViewData[GlobalViewBagKeys.ECommerceService] = eCommerce; return(View(new ProductsListViewModel { Products = eCommerce.GetProductsBySellerId(searchModel, (page - 1) * recordsPerPage, recordsPerPage), PagingInfo = new PagingInfo { CurrentPage = (short)page, RecordsPerPage = recordsPerPage, TotalRecords = eCommerce.CountProductsBySellerId(searchModel) } })); }
public IActionResult Seller(int sellerId, short?page = 1) { ProductSearchModel searchModel = new ProductSearchModel { SellerId = sellerId, Status = ProductStatus.Active, Active = true, ProductTypeStatus = ProductTypeStatus.Active }; ViewData[GlobalViewBagKeys.ECommerceService] = eCommerce; return(View(new ProductsListViewModel { Products = eCommerce.GetProductsBySellerId(searchModel, (page - 1) * recordsPerPage, recordsPerPage), PagingInfo = new PagingInfo { CurrentPage = (short)page, RecordsPerPage = recordsPerPage, TotalRecords = eCommerce.CountProductsBySellerId(searchModel) }, SearchModel = searchModel })); }