Пример #1
0
        public ExtendedSearch()
        {
            Page             = 1;
            CurrentPlaceType = -1;
            SearchItems      = new[]
            {
                new ListItem((int)SearchItem.Country, new Translation("countries", "страны")),
                new ListItem((int)SearchItem.Region, new Translation("regions", "регионы")),
                new ListItem((int)SearchItem.Place, new Translation("places", "места")),
                new ListItem((int)SearchItem.Route, new Translation("routes", "маршруты"))
            };
            SearchOrders = SearchOrder.GetAll(Culture.En);
            var list = PlaceTypes.GetAllPlaceTypes().ToList();

            list.Add(new PlaceType(-1, new Translation("all", "все")));
            SearchPlaceTypes = list.OrderBy(x => x.Id);
            NeedToSearch     = false;
        }
Пример #2
0
        public ExtendedSearch(Culture culture, int searchItem = 0, int searchOrder = 0, int placeType = -1, string name = null, int page = 1)
        {
            SearchItems = new[]
            {
                new ListItem((int)SearchItem.Country, new Translation("countries", "страны")),
                new ListItem((int)SearchItem.Region, new Translation("regions", "регионы")),
                new ListItem((int)SearchItem.Place, new Translation("places", "места")),
                new ListItem((int)SearchItem.Route, new Translation("routes", "маршруты"))
            };
            SearchOrders = SearchOrder.GetAll(culture);
            var list = PlaceTypes.GetAllPlaceTypes().ToList();

            list.Add(new PlaceType(-1, new Translation("All", "Все")));
            SearchPlaceTypes   = list.OrderBy(x => x.Id);
            CurrentSearchItem  = searchItem;
            CurrentSearchOrder = searchOrder;
            CurrentPlaceType   = placeType;
            Name         = name;
            Page         = page;
            NeedToSearch = false;
        }