Example #1
0
        public AdSearchResultModel SearchAdsFromUrl(string cityLabel, string categoryLabel)
        {
            AdSearchModel model = new AdSearchModel();

            if (!String.IsNullOrEmpty(categoryLabel))
            {
                Category c = _categoryRepository.GetCategoryFromUrlPart(categoryLabel);
                if (c != null)
                {
                    model.CategorySelectedId    = c.Id;
                    model.CategorySelectedLabel = c.Label;
                    model.CategoryImagePath     = c.ImageName;
                }
            }

            if (!String.IsNullOrEmpty(cityLabel))
            {
                City city = _locationServices.GetCityFromLabelUrlPart(cityLabel);
                if (city != null)
                {
                    model.CitySelectedId = city.Id;
                }
            }

            return(LightSearchAds(model));
        }