Esempio n. 1
0
        public virtual ActionResult PublisherTemplates(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance))
            {
                return(AccessDeniedKendoGridJson());
            }

            var templatesModel = _publisherTemplateService.GetAllPublisherTemplates()
                                 .Select(x => x.ToModel())
                                 .ToList();
            var gridModel = new DataSourceResult
            {
                Data  = templatesModel,
                Total = templatesModel.Count
            };

            return(Json(gridModel));
        }
Esempio n. 2
0
        protected virtual void PrepareTemplatesModel(PublisherModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            var templates = _publisherTemplateService.GetAllPublisherTemplates();

            foreach (var template in templates)
            {
                model.AvailablePublisherTemplates.Add(new SelectListItem
                {
                    Text  = template.Name,
                    Value = template.Id.ToString()
                });
            }
        }