示例#1
0
        protected virtual void PrepareAllCataloguesModel(CataloguesModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            model.AvailableCatalogues.Add(new SelectListItem
            {
                Text  = "[None]",
                Value = "0"
            });
            var catalogues = _cataloguesService.GetAllCatalogues(showHidden: true);

            foreach (var c in catalogues)
            {
                model.AvailableCatalogues.Add(new SelectListItem
                {
                    Text  = c.GetFormattedBreadCrumb(catalogues),
                    Value = c.Id.ToString()
                });
            }
        }
示例#2
0
        protected virtual void PrepareNewsModel(NewsItemModel model, NewsItem newsItem)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            if (newsItem != null)
            {
                var allCategories = _catalogueService.GetAllCatalogues(showHidden: true);
                foreach (var category in allCategories)
                {
                    model.AvailableCatalogues.Add(new SelectListItem
                    {
                        Text  = category.Name,
                        Value = category.Id.ToString()
                    });
                }
            }
        }