public GrantDetailViewData(Person currentPerson, Models.Grant grant, EntityNotesViewData grantNotesViewData, EntityNotesViewData internalNotesViewData) : base(currentPerson, grant) { PageTitle = grant.GrantTitle.ToEllipsifiedStringClean(110); BreadCrumbTitle = $"{Models.FieldDefinition.Grant.GetFieldDefinitionLabel()} Detail"; NewGrantNoteUrl = grant.GetNewNoteUrl(); GrantNotesViewData = grantNotesViewData; InternalGrantNotesViewData = internalNotesViewData; GrantModificationGridSpec = new GrantModificationGridSpec(currentPerson, grant); GrantModificationGridName = "grantModificationsGridName"; GrantModificationGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantModificationGridJsonDataByGrant(grant.PrimaryKey)); //GrantAllocationGridSpec = new GrantAllocationGridSpec(currentPerson, GrantAllocationGridSpec.GrantAllocationGridCreateButtonType.Shown, grant); //GrantAllocationGridName = "grantAllocationsGridName"; //GrantAllocationGridDataUrlTemplate = SitkaRoute<GrantController>.BuildUrlFromExpression(tc => tc.GrantAllocationGridJsonDataByGrantModification(UrlTemplate.Parameter1Int)); GrantAllocationBudgetLineItemGridSpec = new GrantAllocationBudgetLineItemGridSpec(); GrantAllocationBudgetLineItemGridName = "grantAllocationBudgetLineItemsGridName"; GrantAllocationBudgetLineItemGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantAllocationBudgetLineItemGridJsonDataByGrant(grant)); GrantAgreementGridSpec = new GrantAgreementGridSpec(); GrantAgreementGridName = "grantAgreementGridName"; GrantAgreementGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantAgreementGridJsonData(grant)); GrantDetailsFileDetailsViewData = new FileDetailsViewData( EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(grant.GrantFileResources)), SitkaRoute <GrantController> .BuildUrlFromExpression(x => x.NewGrantFiles(grant.PrimaryKey)), new GrantEditAsAdminFeature().HasPermission(currentPerson, grant).HasPermission, Models.FieldDefinition.Grant ); }
public InteractionEventDetailViewData(Person currentPerson, Models.InteractionEvent interactionEvent, string locationMapFormID, MapInitJson interactionEventLocationSummaryMapInitJson) : base(currentPerson) { IndexUrl = SitkaRoute <InteractionEventController> .BuildUrlFromExpression(x => x.Index()); EditInteractionEventBasicsUrl = SitkaRoute <InteractionEventController> .BuildUrlFromExpression(x => x.EditInteractionEvent(interactionEvent.PrimaryKey)); EditInteractionEventLocationSimpleUrl = SitkaRoute <InteractionEventController> .BuildUrlFromExpression(x => x.EditInteractionEventLocation(interactionEvent.PrimaryKey)); UserHasInteractionEventManagePermissions = new InteractionEventManageFeature().HasPermissionByPerson(currentPerson); InteractionEvent = interactionEvent; InteractionEventContacts = interactionEvent.InteractionEventContacts.ToList(); InteractionEventProjects = interactionEvent.InteractionEventProjects.ToList(); LocationMapFormID = locationMapFormID; InteractionEventLocationSummaryMapInitJson = interactionEventLocationSummaryMapInitJson; PageTitle = interactionEvent.InteractionEventTitle; var canEditDocuments = new InteractionEventManageFeature().HasPermissionByPerson(CurrentPerson); InteractionEventDetailFileDetailsViewData = new FileDetailsViewData( EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(interactionEvent.InteractionEventFileResources)), SitkaRoute <InteractionEventController> .BuildUrlFromExpression(x => x.NewInteractionEventFiles(interactionEvent.PrimaryKey)), canEditDocuments, Models.FieldDefinition.InteractionEvent ); }
public GrantModificationDetailViewData(Person currentPerson, Models.GrantModification grantModification, EntityNotesViewData internalGrantModificationNotesViewData) : base(currentPerson) { Check.EnsureNotNull(currentPerson); Check.EnsureNotNull(grantModification); GrantModification = grantModification; PageTitle = grantModification.GrantModificationName; BreadCrumbTitle = $"{Models.FieldDefinition.GrantModification.GetFieldDefinitionLabel()} Detail"; InternalGrantModificationNotesViewData = internalGrantModificationNotesViewData; ParentGrantUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(gc => gc.GrantDetail(grantModification.GrantID)); BackToParentGrantUrlText = $"Back to {Models.FieldDefinition.Grant.GetFieldDefinitionLabel()}: {grantModification.Grant.GrantName}"; EditGrantModificationBasicsUrl = SitkaRoute <GrantModificationController> .BuildUrlFromExpression(gmc => gmc.EditGrantModification(grantModification.PrimaryKey)); UserHasEditGrantModificationPermissions = new GrantModificationEditAsAdminFeature().HasPermissionByPerson(currentPerson); var canEditDocuments = new GrantModificationEditAsAdminFeature().HasPermission(currentPerson, grantModification).HasPermission; GrantModificationDetailFileDetailsViewData = new FileDetailsViewData( EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(grantModification.GrantModificationFileResources)), SitkaRoute <GrantModificationController> .BuildUrlFromExpression(x => x.NewGrantModificationFiles(grantModification.PrimaryKey)), canEditDocuments, Models.FieldDefinition.GrantModification ); var relevantGrant = grantModification.Grant; GrantAllocationGridSpec = new GrantAllocationGridSpec(currentPerson, GrantAllocationGridSpec.GrantAllocationGridCreateButtonType.Shown, relevantGrant); GrantAllocationGridName = "grantAllocationsGridName"; GrantAllocationGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantAllocationGridJsonDataByGrantModification(grantModification)); }
public DetailViewData(Person currentPerson, Models.PriorityLandscape priorityLandscape, MapInitJson mapInitJson, ViewGoogleChartViewData viewGoogleChartViewData, List <Models.PerformanceMeasure> performanceMeasures) : base(currentPerson) { PriorityLandscape = priorityLandscape; MapInitJson = mapInitJson; ViewGoogleChartViewData = viewGoogleChartViewData; PageTitle = priorityLandscape.PriorityLandscapeName; EntityName = "PriorityLandscape"; UserHasPriorityLandscapeManagePermissions = new PriorityLandscapeManageFeature().HasPermissionByPerson(currentPerson); IndexUrl = SitkaRoute <PriorityLandscapeController> .BuildUrlFromExpression(x => x.Index()); BasicProjectInfoGridName = "priorityLandscapeProjectListGrid"; BasicProjectInfoGridSpec = new ProjectIndexGridSpec(CurrentPerson, false, false, new Dictionary <int, vTotalTreatedAcresByProject>()) { ObjectNameSingular = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} in this {Models.FieldDefinition.PriorityLandscape.GetFieldDefinitionLabel()}", ObjectNamePlural = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} in this {Models.FieldDefinition.PriorityLandscape.GetFieldDefinitionLabel()}", SaveFiltersInCookie = true }; BasicProjectInfoGridDataUrl = SitkaRoute <PriorityLandscapeController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(priorityLandscape)); PerformanceMeasureChartViewDatas = performanceMeasures.Select(x => priorityLandscape.GetPerformanceMeasureChartViewData(x, CurrentPerson)).ToList(); EditPriorityLandscapeBasicsUrl = SitkaRoute <PriorityLandscapeController> .BuildUrlFromExpression(plc => plc.EditPriorityLandscape(priorityLandscape)); PriorityLandscapeFileDetailsViewData = new FileDetailsViewData( EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(priorityLandscape.PriorityLandscapeFileResources)), SitkaRoute <PriorityLandscapeController> .BuildUrlFromExpression(x => x.NewPriorityLandscapeFiles(priorityLandscape.PrimaryKey)), UserHasPriorityLandscapeManagePermissions, Models.FieldDefinition.PriorityLandscape ); }
public DetailViewData(Person currentPerson, Models.GrantAllocation grantAllocation , GrantAllocationBasicsViewData grantAllocationBasicsViewData , EntityNotesViewData grantAllocationNotesViewData , EntityNotesViewData grantAllocationNoteInternalsViewData , ViewGoogleChartViewData viewGoogleChartViewData , GridSpec <Models.ProjectGrantAllocationRequest> projectGrantAllocationRequestsGridSpec , GrantAllocationExpendituresGridSpec grantAllocationExpendituresGridSpec) : base(currentPerson, grantAllocation) { PageTitle = grantAllocation.GrantAllocationName.ToEllipsifiedStringClean(110); BreadCrumbTitle = $"{Models.FieldDefinition.GrantAllocation.GetFieldDefinitionLabel()} Detail"; GrantAllocationBasicsViewData = grantAllocationBasicsViewData; GrantAllocationNotesViewData = grantAllocationNotesViewData; NewGrantAllocationNoteUrl = grantAllocation.GetNewNoteUrl(); GrantAllocationNoteInternalsViewData = grantAllocationNoteInternalsViewData; ViewGoogleChartViewData = viewGoogleChartViewData; var projectGrantAllocationExpenditures = GrantAllocation.ProjectGrantAllocationExpenditures.ToList(); CalendarYearsForProjectExpenditures = projectGrantAllocationExpenditures.CalculateCalendarYearRangeForExpenditures(grantAllocation); ProjectCalendarYearExpendituresGridSpec = new ProjectCalendarYearExpendituresGridSpec(CalendarYearsForProjectExpenditures) { ObjectNameSingular = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()}", ObjectNamePlural = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true }; ProjectCalendarYearExpendituresGridName = "projectsCalendarYearExpendituresFromGrantAllocationGrid"; ProjectCalendarYearExpendituresGridDataUrl = SitkaRoute <GrantAllocationController> .BuildUrlFromExpression(tc => tc.ProjectCalendarYearExpendituresGridJsonData(grantAllocation)); ProjectGrantAllocationRequestsGridSpec = projectGrantAllocationRequestsGridSpec; ProjectGrantAllocationRequestsGridName = "projectsGrantAllocationRequestsFromGrantAllocationGrid"; ProjectGrantAllocationRequestsGridDataUrl = SitkaRoute <GrantAllocationController> .BuildUrlFromExpression(tc => tc.ProjectGrantAllocationRequestsGridJsonData(grantAllocation)); GrantAllocationExpendituresGridSpec = grantAllocationExpendituresGridSpec; GrantAllocationExpendituresGridName = "grantAllocationExpendituresGrid"; GrantAllocationExpendituresGridDataUrl = SitkaRoute <GrantAllocationController> .BuildUrlFromExpression(gac => gac.GrantAllocationExpendituresGridJsonData(grantAllocation)); GrantAllocationBudgetLineItemsViewData = new GrantAllocationBudgetLineItemsViewData(currentPerson, grantAllocation, grantAllocation.GrantAllocationBudgetLineItems.ToList()); GrantAllocationBudgetVsActualsViewData = new GrantAllocationBudgetVsActualsViewData(currentPerson, grantAllocation); var canEditDocuments = new GrantAllocationEditAsAdminFeature().HasPermission(currentPerson, grantAllocation).HasPermission; GrantAllocationDetailsFileDetailsViewData = new FileDetailsViewData( EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(grantAllocation.GrantAllocationFileResources)), SitkaRoute <GrantAllocationController> .BuildUrlFromExpression(x => x.NewGrantAllocationFiles(grantAllocation.PrimaryKey)), canEditDocuments, Models.FieldDefinition.GrantAllocation ); }