示例#1
0
        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));
        }
示例#2
0
        public void CanSetAndGetCurrentShopList()
        {
            var testValue = new ShopListVM();

            _testClass.CurrentShopList = testValue;
            Assert.That(_testClass.CurrentShopList, Is.EqualTo(testValue));
        }
示例#3
0
        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));
        }
示例#6
0
        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));
        }
示例#7
0
        public void CanConstruct()
        {
            var instance = new ShopListVM();

            Assert.That(instance, Is.Not.Null);
        }
示例#8
0
 public void SetUp()
 {
     _testClass = new ShopListVM();
 }