Ejemplo n.º 1
0
        public GridJsonNetJObjectResult <Project> ProjectsGridJsonData(ProjectTypePrimaryKey projectTypePrimaryKey)
        {
            var gridSpec                 = new BasicProjectInfoGridSpec(CurrentPerson, true);
            var projectProjectTypes      = projectTypePrimaryKey.EntityObject.GetAssociatedProjects(CurrentPerson);
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(projectProjectTypes, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Ejemplo n.º 2
0
        public GridJsonNetJObjectResult <Project> ProjectsGridJsonData(TagPrimaryKey tagPrimaryKey)
        {
            var gridSpec = new BasicProjectInfoGridSpec(CurrentFirmaSession, true);
            var projectGeospatialAreas   = tagPrimaryKey.EntityObject.GetAssociatedProjects(CurrentFirmaSession);
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(projectGeospatialAreas, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Ejemplo n.º 3
0
        public GridJsonNetJObjectResult <Project> ProjectsGridJsonData(DNRUplandRegionPrimaryKey dnrUplandRegionPrimaryKey)
        {
            var gridSpec                 = new BasicProjectInfoGridSpec(CurrentPerson, false);
            var projectRegions           = dnrUplandRegionPrimaryKey.EntityObject.GetAssociatedProjects(CurrentPerson);
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(projectRegions, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Ejemplo n.º 4
0
        public GridJsonNetJObjectResult <Project> CostAuthorityProjectsGridJsonData(CostAuthorityPrimaryKey costAuthorityPrimaryKey)
        {
            var costAuthority = costAuthorityPrimaryKey.EntityObject;
            var gridSpec      = new BasicProjectInfoGridSpec(CurrentFirmaSession, true, costAuthority);
            var projectReclamationAgreements = costAuthority.GetAssociatedProjects();
            var gridJsonNetJObjectResult     = new GridJsonNetJObjectResult <Project>(projectReclamationAgreements, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Ejemplo n.º 5
0
        public GridJsonNetJObjectResult <Project> AgreementProjectsGridJsonData(AgreementPrimaryKey agreementPrimaryKey)
        {
            var reclamationAgreement = agreementPrimaryKey.EntityObject;
            var gridSpec             = new BasicProjectInfoGridSpec(CurrentFirmaSession, true, reclamationAgreement);
            //var projectTaxonomyBranches = taxonomyBranchPrimaryKey.EntityObject.GetAssociatedProjects(CurrentPerson);
            var projectReclamationAgreements = reclamationAgreement.GetAssociatedProjects();
            var gridJsonNetJObjectResult     = new GridJsonNetJObjectResult <Project>(projectReclamationAgreements, gridSpec);

            return(gridJsonNetJObjectResult);
        }
        /*
         * public ObligationItemBudgetGridSpec ObligationItemBudgetGridSpec { get; }
         * public string ObligationItemBudgetGridName { get; }
         * public string ObligationItemBudgetGridDataUrl { get; }
         */

        public CostAuthorityDetailViewData(FirmaSession currentFirmaSession,
                                           ProjectFirmaModels.Models.CostAuthority costAuthority) : base(currentFirmaSession)
        {
            CostAuthority = costAuthority;

            PageTitle  = $"{FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabel()}: {costAuthority.CostAuthorityWorkBreakdownStructure}";
            EntityName = $"{FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabel()} Detail";

            UserHasCostAuthorityManagePermissions = new CostAuthorityManageFeature().HasPermissionByPerson(CurrentPerson);
            IsAdmin = new FirmaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession);

            IndexUrl = SitkaRoute <CostAuthorityController> .BuildUrlFromExpression(ca => ca.CostAuthorityIndex());

            AgreementIndexUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(ac => ac.AgreementIndex());

            FieldDefinitionForAgreement = FieldDefinitionEnum.Agreement.ToType();
            FieldDefinitionForProject   = FieldDefinitionEnum.Project.ToType();
            FieldDefinitionForCostAuthorityWorkBreakdownStructure = FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType();

            BasicProjectInfoProjectGridName = "costAuthorityProjectListGrid";
            BasicProjectInfoGridSpec        = new BasicProjectInfoGridSpec(CurrentFirmaSession, true, CostAuthority)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} associated with {FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabel()} {costAuthority.CostAuthorityWorkBreakdownStructure}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()} associated with {FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabel()} {costAuthority.CostAuthorityWorkBreakdownStructure}",
                SaveFiltersInCookie = true
            };
            BasicProjectInfoProjectGridDataUrl = SitkaRoute <CostAuthorityController> .BuildUrlFromExpression(cac => cac.CostAuthorityProjectsGridJsonData(costAuthority));

            AgreementGridName = "costAuthorityAgreementListGrid";
            AgreementGridSpec = new AgreementGridSpec(CurrentFirmaSession)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.Agreement.ToType().GetFieldDefinitionLabel()} associated with {FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabel()} {costAuthority.CostAuthorityWorkBreakdownStructure}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.Agreement.ToType().GetFieldDefinitionLabelPluralized()} associated with {FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabel()} {costAuthority.CostAuthorityWorkBreakdownStructure}",
                SaveFiltersInCookie = true
            };
            AgreementGridDataUrl = SitkaRoute <CostAuthorityController> .BuildUrlFromExpression(cac => cac.CostAuthorityAgreementGridJsonData(costAuthority));

            HasPnBudgetViewPermission = new PnBudgetViewFeature().HasPermissionByFirmaSession(currentFirmaSession);

            PnBudgetGridName    = "PnBudgetsGrid";
            PnBudgetGridSpec    = new PnBudgetGridSpec(currentFirmaSession);
            PnBudgetGridDataUrl = SitkaRoute <PnBudgetController> .BuildUrlFromExpression(c => c.PnBudgetsForCostAuthorityGridJsonData(costAuthority.CostAuthorityWorkBreakdownStructure));

            HasObligationViewPermission = new ObligationViewFeature().HasPermissionByFirmaSession(currentFirmaSession);

            ContractualInvoiceGridName    = "contractualInvoiceGrid";
            ContractualInvoiceGridSpec    = new ContractualInvoiceGridSpec(currentFirmaSession);
            ContractualInvoiceGridDataUrl = SitkaRoute <CostAuthorityController> .BuildUrlFromExpression(cac => cac.ContractualInvoiceGridJsonData(costAuthority));

            //ObligationItemBudgetGridName = "obligationItemBudgets";
            //ObligationItemBudgetGridSpec = new ObligationItemBudgetGridSpec(currentFirmaSession);
            //ObligationItemBudgetGridDataUrl = SitkaRoute<CostAuthorityController>.BuildUrlFromExpression(oc => oc.ObligationItemBudgetGridJsonData(costAuthority));
        }
Ejemplo n.º 7
0
        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));
        }
Ejemplo n.º 8
0
        public DetailViewData(Person currentPerson,
                              Models.TaxonomyTrunk taxonomyTrunk,
                              ProjectLocationsMapInitJson projectLocationsMapInitJson,
                              ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel) : base(currentPerson)
        {
            TaxonomyTrunk                       = taxonomyTrunk;
            TaxonomyTrunkDisplayName            = Models.FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabel();
            TaxonomyTrunkDisplayNamePluralized  = Models.FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabelPluralized();
            TaxonomyBranchDisplayNamePluralized = Models.FieldDefinition.TaxonomyBranch.GetFieldDefinitionLabelPluralized();
            ProjectTypeDisplayNamePluralized    = Models.FieldDefinition.ProjectType.GetFieldDefinitionLabelPluralized();

            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            ProjectLocationsMapViewData = projectLocationsMapViewData;

            ProjectMapFilteredUrl = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            PageTitle  = taxonomyTrunk.DisplayName;
            EntityName = TaxonomyTrunkDisplayName;
            IndexUrl   = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(c => c.Taxonomy());

            UserHasTaxonomyTrunkManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByPerson(CurrentPerson);
            UserHasProjectTaxonomyTrunkExpenditureManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByPerson(currentPerson);
            EditTaxonomyTrunkUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(c => c.Edit(taxonomyTrunk.TaxonomyTrunkID));

            TaxonomyBranchIndexUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(c => c.Index());

            BasicProjectInfoGridName = "taxonomyTrunkProjectListGrid";
            BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} with this {TaxonomyTrunkDisplayName}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} with this {TaxonomyTrunkDisplayName}",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(taxonomyTrunk));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyTrunk, taxonomyLevel);

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasureChartViewDatas     = performanceMeasureChartViewDatas;
            RelatedPerformanceMeasuresViewData   = relatedPerformanceMeasuresViewData;

            EditChildrenSortOrderUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(x => x.EditChildrenSortOrder(taxonomyTrunk));
        }
Ejemplo n.º 9
0
        public DetailViewData(Person currentPerson,
                              Models.ProjectType projectType,
                              ProjectLocationsMapInitJson projectLocationsMapInitJson,
                              ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel) : base(currentPerson)
        {
            ProjectType = projectType;
            PageTitle   = projectType.DisplayName;
            var fieldDefinitionProjectType = Models.FieldDefinition.ProjectType;
            var projectTypeDisplayName     = fieldDefinitionProjectType.GetFieldDefinitionLabel();

            EntityName = projectTypeDisplayName;

            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            ProjectLocationsMapViewData = projectLocationsMapViewData;
            ProjectMapFilteredUrl       = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            UserHasProjectTypeManagePermissions = new ProjectTypeManageFeature().HasPermissionByPerson(CurrentPerson);
            EditProjectTypeUrl = SitkaRoute <ProjectTypeController> .BuildUrlFromExpression(c => c.Edit(projectType));

            IndexUrl = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(x => x.Taxonomy());

            BasicProjectInfoGridName = "projectTypeProjectListGrid";
            BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} with this {projectTypeDisplayName}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} with this {projectTypeDisplayName}",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <ProjectTypeController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(projectType));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(projectType, taxonomyLevel);

            ProjectTypeDisplayName           = projectTypeDisplayName;
            ProjectTypeDisplayNamePluralized = fieldDefinitionProjectType.GetFieldDefinitionLabelPluralized();

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasureChartViewDatas     = performanceMeasureChartViewDatas;
            RelatedPerformanceMeasuresViewData   = relatedPerformanceMeasuresViewData;
        }
Ejemplo n.º 10
0
        public DetailViewData(Person currentPerson, Models.DNRUplandRegion dnrUplandRegion, MapInitJson mapInitJson, ViewGoogleChartViewData viewGoogleChartViewData, List <Models.PerformanceMeasure> performanceMeasures) : base(currentPerson)
        {
            DNRUplandRegion         = dnrUplandRegion;
            MapInitJson             = mapInitJson;
            ViewGoogleChartViewData = viewGoogleChartViewData;
            PageTitle  = dnrUplandRegion.DNRUplandRegionName;
            EntityName = Models.FieldDefinition.DNRUplandRegion.GetFieldDefinitionLabel();
            UserHasRegionManagePermissions = new DNRUplandRegionManageFeature().HasPermissionByPerson(currentPerson);
            IndexUrl = SitkaRoute <DNRUplandRegionController> .BuildUrlFromExpression(x => x.Index());

            BasicProjectInfoGridName = "regionProjectListGrid";
            BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, false)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} in this {Models.FieldDefinition.DNRUplandRegion.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} in this {Models.FieldDefinition.DNRUplandRegion.GetFieldDefinitionLabel()}",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <DNRUplandRegionController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(dnrUplandRegion));

            PerformanceMeasureChartViewDatas = performanceMeasures.Select(x => dnrUplandRegion.GetPerformanceMeasureChartViewData(x, CurrentPerson)).ToList();
        }
Ejemplo n.º 11
0
        public DetailViewData(Person currentPerson, Models.Classification classification)
            : base(currentPerson)
        {
            Classification        = classification;
            PageTitle             = classification.ClassificationSystem.ClassificationSystemNamePluralized;
            EditClassificationUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(c => c.Edit(classification));

            IndexUrl = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(c => c.ClassificationSystem(classification.ClassificationSystem));

            UserHasClassificationManagePermissions = new PerformanceMeasureManageFeature().HasPermissionByPerson(currentPerson);
            ClassificationDisplayNamePluralized    = classification.ClassificationSystem.ClassificationSystemNamePluralized;
            ClassificationDisplayName = classification.ClassificationSystem.ClassificationSystemName;

            BasicProjectInfoGridName = "geospatialAreaProjectListGrid";
            BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, false)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} associated with the {ClassificationDisplayName} {classification.DisplayName}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} associated with the {ClassificationDisplayName} {classification.DisplayName}",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <ClassificationController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(classification));
        }
Ejemplo n.º 12
0
        public DetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Tag tag) : base(currentFirmaSession)
        {
            Tag        = tag;
            PageTitle  = tag.TagName;
            EntityName = "Tag";

            EditTagUrl = SitkaRoute <TagController> .BuildUrlFromExpression(c => c.Edit(tag));

            ManageTagsUrl = SitkaRoute <TagController> .BuildUrlFromExpression(c => c.Index());

            UserHasTagManagePermissions = new FirmaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession);

            BasicProjectInfoGridName = "tagProjectListGrid";

            BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(currentFirmaSession, true)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} with this Tag",
                ObjectNamePlural    = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()} with this Tag",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <TagController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(tag));
        }