public AgreementIndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage) { PageTitle = MultiTenantHelpers.GetAgreementNamePluralized(); HasAgreementManagePermissions = new AgreementManageFeature().HasPermissionByFirmaSession(currentFirmaSession); DisplayActionButtons = HasAgreementManagePermissions; AgreementGridSpec = new AgreementGridSpec(currentFirmaSession) { ObjectNameSingular = MultiTenantHelpers.GetAgreementName(), ObjectNamePlural = MultiTenantHelpers.GetAgreementNamePluralized(), SaveFiltersInCookie = true }; AgreementGridName = "AgreementsGrid"; AgreementGridDataUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(c => c.AgreementGridJsonData()); AgreementIndexViewPageContentViewData = new ViewPageContentViewData(firmaPage, true); bool hasAgreementManagementRights = new AgreementManageFeature().HasPermissionByPerson(currentFirmaSession.Person); ShowAgreementEditingControls = FirmaWebConfiguration.FeatureAlevinAgreementCreationAndEditing && hasAgreementManagementRights; NewAgreementUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(t => t.NewAgreement()); //AgreementGridSpec.CustomExcelDownloadLinkText = $"Download with {FieldDefinitionEnum.AgreementSubcategory.ToType().GetFieldDefinitionLabelPluralized()}"; //AgreementGridSpec.CustomExcelDownloadUrl = SitkaRoute<AgreementController>.BuildUrlFromExpression(tc => tc.IndexExcelDownload()); }
public AgreementDetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Agreement agreement) : base(currentFirmaSession) { PageTitle = $"Agreement Number: {agreement.AgreementNumber}"; EntityName = "Agreement Detail"; Agreement = agreement; UserHasAgreementManagePermissions = new AgreementManageFeature().HasPermissionByPerson(CurrentPerson); IsAdmin = new FirmaAdminFeature().HasPermissionByPerson(CurrentPerson); EditAgreementBasicsUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(c => c.EditBasics(agreement)); /* * EditPerformanceMeasureUrl = SitkaRoute<PerformanceMeasureController>.BuildUrlFromExpression(c => c.Edit(performanceMeasure)); * EditSubcategoriesAndOptionsUrl = SitkaRoute<PerformanceMeasureController>.BuildUrlFromExpression(c => c.EditSubcategoriesAndOptions(performanceMeasure)); * * EditCriticalDefinitionsUrl = SitkaRoute<PerformanceMeasureController>.BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.CriticalDefinitions)); * EditProjectReportingUrl = SitkaRoute<PerformanceMeasureController>.BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.ProjectReporting)); */ IndexUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(c => c.AgreementIndex()); CostAuthorityIndexUrl = SitkaRoute <CostAuthorityController> .BuildUrlFromExpression(cac => cac.CostAuthorityIndex()); FieldDefinitionForAgreement = FieldDefinitionEnum.Agreement.ToType(); FieldDefinitionForProject = FieldDefinitionEnum.Project.ToType(); FieldDefinitionForCostAuthorityWorkBreakdownStructure = FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType(); /* Basic Project Info */ BasicProjectInfoProjectGridName = "agreementProjectListGrid"; BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(currentFirmaSession, true, agreement) { ObjectNameSingular = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} associated with Agreement Number {agreement.AgreementNumber}", ObjectNamePlural = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()} associated with Agreement Number {agreement.AgreementNumber}", SaveFiltersInCookie = true }; BasicProjectInfoProjectGridDataUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(tc => tc.AgreementProjectsGridJsonData(agreement)); /* Cost Authority */ BasicCostAuthorityGridName = "costAuthorityAgreementListGrid"; BasicCostAuthorityGridSpec = new BasicCostAuthorityGridSpec(CurrentPerson) { ObjectNameSingular = $"{FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabel()} associated with {FieldDefinitionEnum.Agreement.ToType().GetFieldDefinitionLabel()} {agreement.AgreementNumber}", ObjectNamePlural = $"{FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabelPluralized()} associated with {FieldDefinitionEnum.Agreement.ToType().GetFieldDefinitionLabel()} {agreement.AgreementNumber}", SaveFiltersInCookie = true }; BasicCostAuthorityGridDataUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(ac => ac.AgreementCostAuthorityGridJsonData(agreement)); }