public GridJsonNetJObjectResult <AttachmentType> AttachmentTypeGridJsonData()
        {
            var hasManagePermissions     = new AttachmentTypeManageFeature().HasPermissionByFirmaSession(CurrentFirmaSession);
            var gridSpec                 = new AttachmentTypeGridSpec(hasManagePermissions);
            var attachmentTypes          = HttpRequestStorage.DatabaseEntities.AttachmentTypes.ToList().OrderBy(x => x.AttachmentTypeName).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <AttachmentType>(attachmentTypes, gridSpec);

            return(gridJsonNetJObjectResult);
        }
示例#2
0
        public IndexViewData(FirmaSession currentFirmaSession) : base(currentFirmaSession)
        {
            var fieldDefinitionForAttachmentType = FieldDefinitionEnum.AttachmentType.ToType();

            PageTitle = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} {fieldDefinitionForAttachmentType.GetFieldDefinitionLabelPluralized()}";

            var hasManagePermissions = new AttachmentTypeManageFeature().HasPermissionByFirmaSession(currentFirmaSession);

            AttachmentTypeGridSpec = new AttachmentTypeGridSpec(hasManagePermissions)
            {
                ObjectNameSingular = $"{fieldDefinitionForAttachmentType.GetFieldDefinitionLabel()}", ObjectNamePlural = $"{ fieldDefinitionForAttachmentType.GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true
            };

            AttachmentTypeGridName    = "relationshipTypeGrid";
            AttachmentTypeGridDataUrl = SitkaRoute <AttachmentTypeController> .BuildUrlFromExpression(otc => otc.AttachmentTypeGridJsonData());

            HasManagePermissions     = hasManagePermissions;
            NewProjectAssociationUrl = SitkaRoute <AttachmentTypeController> .BuildUrlFromExpression(t => t.NewAttachmentType());
        }