public GridJsonNetJObjectResult <Classification> IndexGridJsonData(ClassificationSystemPrimaryKey classificationSystemPrimaryKey) { var classificationSystem = classificationSystemPrimaryKey.EntityObject; var gridSpec = new IndexGridSpec(new FirmaAdminFeature().HasPermissionByFirmaSession(CurrentFirmaSession), classificationSystem); var classifications = classificationSystem.Classifications.SortByOrderThenName().ToList(); return(new GridJsonNetJObjectResult <Classification>(classifications, gridSpec)); }
public IndexViewData(Person currentPerson, Models.ClassificationSystem classificationSystem) : base(currentPerson) { PageTitle = classificationSystem.ClassificationSystemNamePluralized; HasClassificationManagePermissions = new PerformanceMeasureManageFeature().HasPermissionByPerson(CurrentPerson); GridSpec = new IndexGridSpec(HasClassificationManagePermissions, classificationSystem) { ObjectNameSingular = classificationSystem.ClassificationSystemName, ObjectNamePlural = classificationSystem.ClassificationSystemNamePluralized, SaveFiltersInCookie = true, CreateEntityModalDialogForm = new ModalDialogForm(SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.New(classificationSystem)), $"New {classificationSystem.ClassificationSystemName}"), }; GridName = "classificationsGrid"; GridDataUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData(classificationSystem)); EditSortOrderUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.EditSortOrder(classificationSystem)); }
public IndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.ClassificationSystem classificationSystem) : base(currentFirmaSession) { PageTitle = ClassificationSystemModelExtensions.GetClassificationSystemNamePluralized(classificationSystem); HasClassificationManagePermissions = new FirmaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession); GridSpec = new IndexGridSpec(HasClassificationManagePermissions, classificationSystem) { ObjectNameSingular = classificationSystem.ClassificationSystemName, ObjectNamePlural = ClassificationSystemModelExtensions.GetClassificationSystemNamePluralized(classificationSystem), SaveFiltersInCookie = true, }; GridName = "classificationsGrid"; GridDataUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData(classificationSystem)); NewUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.New(classificationSystem)); EditSortOrderUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.EditSortOrder(classificationSystem)); ClassificationSystemName = classificationSystem.ClassificationSystemName; }