Esempio n. 1
0
        public static RetailListModel GetByBrand(string brand)
        {
            var model = new RetailListModel();

            if (!string.IsNullOrEmpty(brand))
            {
                using (var client = new LandauPortalWebAPI())
                {
                    var retailers = client.Retailers.GetAllOnlineByBrand(brand);
                    model.Retailers = retailers.Results.Select(x => toRetailModel(x)).ToList();
                }
            }
            return(model);
        }
Esempio n. 2
0
        public static RetailListModel GetByCityAndState(HttpSessionStateBase session, string city, string state, bool isDiamond, int pageNum, int pageSize)
        {
            var model = new RetailListModel();

            if (!string.IsNullOrEmpty(city) && !string.IsNullOrEmpty(state))
            {
                using (var client = new LandauPortalWebAPI())
                {
                    var retailers = client.Retailers.FindByCityAndState(city, state, isDiamond, null, pageNum, pageSize);
                    model.Retailers = retailers.Results.Select(x => toRetailModel(x)).ToList();

                    model.Pagination.CurrentPage = retailers.Pagination.CurrentPage ?? 0;
                    model.Pagination.PageCount   = retailers.Pagination.TotalCount ?? 0;
                    model.Pagination.PageSize    = pageSize;
                }
            }
            return(model);
        }
Esempio n. 3
0
        public static RetailListModel FindByCountry(string brand, string countryCode, int pageNumber, int pageSize)
        {
            var model = new RetailListModel();

            if (!string.IsNullOrEmpty(countryCode))
            {
                using (var client = new LandauPortalWebAPI())
                {
                    var retailers = client.Retailers.FindByCountry(brand, countryCode, pageNumber, pageSize);
                    model.Retailers = retailers.Results.Select(x => toRetailModel(x)).ToList();

                    model.Pagination.CurrentPage = retailers.Pagination.CurrentPage ?? 0;
                    model.Pagination.PageCount   = retailers.Pagination.TotalCount ?? 0;
                    model.Pagination.PageSize    = pageSize;

                    model.Seo.PageDescription = retailers.Seo.MetaDescription;
                    model.Seo.PageTitle       = retailers.Seo.PageTitle;
                }
            }
            return(model);
        }