Ejemplo n.º 1
0
        public List<SelectListItem> ChooseSiteOptions(ChooseSiteParams chooseSiteParams)
        {
            IEnumerable<StringResource> resourcesByKey = _provider.AllResources.Where(x => x.Key == chooseSiteParams.Key);
            List<Site> sites = GetAllSites();

            if (!chooseSiteParams.Language)
            {
                resourcesByKey = resourcesByKey.Where(resource => resource.Site != null && resource.UICulture == null);
                sites =
                    sites.Where(site => !resourcesByKey.Select(resource => resource.Site.Id).Contains(site.Id)).ToList();
            }

            return sites
                .BuildSelectItemList(site => site.DisplayName, site => site.Id.ToString(), emptyItem: null);
        }
Ejemplo n.º 2
0
 public ViewResult ChooseSite(ChooseSiteParams chooseSiteParams)
 {
     ViewData["site-options"] = _stringResourceAdminService.ChooseSiteOptions(chooseSiteParams);
     return View(chooseSiteParams);
 }