public IActionResult Search(string property, string value, int?page) { ShopListVM model = new ShopListVM(); model.Shops = shopOperations.SearchShopBy(property, value).ToPagedList(page ?? 1, 5); return(View("ShopList", model)); }
public void CanSetAndGetCurrentShopList() { var testValue = new ShopListVM(); _testClass.CurrentShopList = testValue; Assert.That(_testClass.CurrentShopList, Is.EqualTo(testValue)); }
public IActionResult ShopList(int?page) { ShopListVM model = new ShopListVM(); model.Shops = shopOperations.GetAllShops().ToPagedList(page ?? 1, 5); return(View(model)); }
public IActionResult Index() { ShopListVM model = new ShopListVM() { Shop = _shopOperation.GetAll().OrderByDescending(e => e.Id), Components = _shopOperation.GetShopFormComponents() }; return(View(model)); }
public IActionResult Index(string searchName, string searchAddress, int searchType) { ShopListVM model = new ShopListVM() { Shop = _shopOperation.SearchAll(searchName, searchAddress, searchType).OrderByDescending(e => e.Id), Components = _shopOperation.GetShopFormComponents() }; ViewBag.searchName = searchName; ViewBag.searchAddress = searchAddress; ViewBag.searchType = searchType; return(View(model)); }
public async Task <IActionResult> Index(int productPage = 1, string searchByShop = null, string searchByCity = null) { var(shops, shopsCount) = await _shopService.GetFiltered(searchByShop, searchByCity, PageSize, productPage); var shopListVM = new ShopListVM() { Shops = shops }; const string Url = "/Admin/Shop/Index?productPage=:"; shopListVM.PagingInfo = new PagingInfo { CurrentPage = productPage, ItemsPerPage = PageSize, TotalItem = shopsCount, UrlParam = Url }; return(View(shopListVM)); }
public void CanConstruct() { var instance = new ShopListVM(); Assert.That(instance, Is.Not.Null); }
public void SetUp() { _testClass = new ShopListVM(); }