Esempio n. 1
0
        public GridJsonNetJObjectResult <Tag> IndexGridJsonData()
        {
            var hasTagDeletePermission = new FirmaAdminFeature().HasPermissionByFirmaSession(CurrentFirmaSession);
            var gridSpec = new IndexGridSpec(hasTagDeletePermission);
            var tags     = HttpRequestStorage.DatabaseEntities.Tags.OrderBy(x => x.TagName).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Tag>(tags, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Esempio n. 2
0
        public IndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage)
        {
            PageTitle = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} Tags";

            var hasTagManagePermissions = new FirmaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession);

            GridSpec = new IndexGridSpec(hasTagManagePermissions)
            {
                ObjectNameSingular = "Tag", ObjectNamePlural = "Tags", SaveFiltersInCookie = true
            };
            GridName    = "TagsGrid";
            GridDataUrl = SitkaRoute <TagController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());

            HasTagManagePermissions = hasTagManagePermissions;
            NewUrl = SitkaRoute <TagController> .BuildUrlFromExpression(t => t.New());
        }
Esempio n. 3
0
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle = "Tags";

            var hasTagManagePermissions = new FirmaAdminFeature().HasPermissionByPerson(currentPerson);

            GridSpec = new IndexGridSpec(hasTagManagePermissions)
            {
                ObjectNameSingular = "Tag", ObjectNamePlural = "Tags", SaveFiltersInCookie = true
            };

            if (hasTagManagePermissions)
            {
                var contentUrl = SitkaRoute <TagController> .BuildUrlFromExpression(t => t.New());

                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(contentUrl, "Create a new Tag");
            }

            GridName    = "TagsGrid";
            GridDataUrl = SitkaRoute <TagController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());
        }