Beispiel #1
0
        public PartialViewResult DeleteTaxonomyBranch(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey)
        {
            var taxonomyBranch = taxonomyBranchPrimaryKey.EntityObject;
            var viewModel      = new ConfirmDialogFormViewModel(taxonomyBranch.TaxonomyBranchID);

            return(ViewDeleteTaxonomyBranch(taxonomyBranch, viewModel));
        }
Beispiel #2
0
        public ViewResult Detail(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey)
        {
            var taxonomyBranch         = taxonomyBranchPrimaryKey.EntityObject;
            var taxonomyBranchProjects = taxonomyBranch.GetAssociatedProjects(CurrentPerson).ToList();

            var projectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyBranch, new List <int> {
                taxonomyBranch.TaxonomyBranchID
            }, ProjectColorByType.ProjectStage);
            var projectLocationsLayerGeoJson = new LayerGeoJson($"{FieldDefinition.ProjectLocation.GetFieldDefinitionLabel()}", Project.MappedPointsToGeoJsonFeatureCollection(taxonomyBranchProjects, true, true), "red", 1, LayerInitialVisibility.Show);
            var projectLocationsMapInitJson  = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson, projectMapCustomization, "TaxonomyBranchProjectMap");
            var projectLocationsMapViewData  = new ProjectLocationsMapViewData(projectLocationsMapInitJson.MapDivID, ProjectColorByType.ProjectStage.DisplayName, MultiTenantHelpers.GetTopLevelTaxonomyTiers(), CurrentPerson.CanViewProposals);

            var associatePerformanceMeasureTaxonomyLevel = MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel();
            var canHaveAssociatedPerformanceMeasures     = associatePerformanceMeasureTaxonomyLevel == TaxonomyLevel.Branch;
            var taxonomyTierPerformanceMeasures          = taxonomyBranch.GetTaxonomyTierPerformanceMeasures();
            var relatedPerformanceMeasuresViewData       = new RelatedPerformanceMeasuresViewData(associatePerformanceMeasureTaxonomyLevel, true, taxonomyTierPerformanceMeasures, canHaveAssociatedPerformanceMeasures);
            List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas = null;

            if (canHaveAssociatedPerformanceMeasures)
            {
                performanceMeasureChartViewDatas = taxonomyTierPerformanceMeasures.Select(x => new PerformanceMeasureChartViewData(x.Key, CurrentPerson, false, new List <Project>())).ToList();
            }

            var taxonomyLevel = MultiTenantHelpers.GetTaxonomyLevel();
            var viewData      = new DetailViewData(CurrentPerson, taxonomyBranch, projectLocationsMapInitJson, projectLocationsMapViewData, canHaveAssociatedPerformanceMeasures, relatedPerformanceMeasuresViewData, performanceMeasureChartViewDatas, taxonomyLevel);

            return(RazorView <Summary, DetailViewData>(viewData));
        }
Beispiel #3
0
        public PartialViewResult EditChildrenSortOrder(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey)
        {
            var projectTypes = taxonomyBranchPrimaryKey.EntityObject.ProjectTypes;
            var viewModel    = new EditSortOrderViewModel();

            return(ViewEditChildrenSortOrder(projectTypes, viewModel));
        }
Beispiel #4
0
        public PartialViewResult Edit(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey)
        {
            var taxonomyBranch = taxonomyBranchPrimaryKey.EntityObject;
            var viewModel      = new EditViewModel(taxonomyBranch);

            return(ViewEdit(viewModel, taxonomyBranch.TaxonomyTrunk.DisplayName));
        }
Beispiel #5
0
        public GridJsonNetJObjectResult <Project> ProjectsGridJsonData(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey)
        {
            var gridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true);
            var projectTaxonomyBranches  = taxonomyBranchPrimaryKey.EntityObject.GetAssociatedProjects(CurrentPerson);
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(projectTaxonomyBranches, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Beispiel #6
0
        public GridJsonNetJObjectResult <Project> TaxonomyBranchProjectsGridJsonData(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey)
        {
            var projectCustomDefaultGridConfigurations = HttpRequestStorage.DatabaseEntities.ProjectCustomGridConfigurations.Where(x => x.IsEnabled && x.ProjectCustomGridTypeID == ProjectCustomGridType.Default.ProjectCustomGridTypeID).OrderBy(x => x.SortOrder).ToList();
            var projectDetails           = HttpRequestStorage.DatabaseEntities.vProjectDetails.ToDictionary(x => x.ProjectID);
            var gridSpec                 = new ProjectCustomGridSpec(CurrentFirmaSession, projectCustomDefaultGridConfigurations, ProjectCustomGridType.Default.ToEnum, projectDetails, CurrentTenant);
            var taxonomyBranchProjects   = taxonomyBranchPrimaryKey.EntityObject.GetAssociatedProjects(CurrentFirmaSession);
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(taxonomyBranchProjects, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Beispiel #7
0
        public ActionResult DeleteTaxonomyBranch(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey, ConfirmDialogFormViewModel viewModel)
        {
            var taxonomyBranch = taxonomyBranchPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteTaxonomyBranch(taxonomyBranch, viewModel));
            }
            taxonomyBranch.DeleteFull(HttpRequestStorage.DatabaseEntities);
            return(new ModalDialogFormJsonResult());
        }
Beispiel #8
0
        public ActionResult Edit(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey, EditViewModel viewModel)
        {
            var taxonomyBranch = taxonomyBranchPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEdit(viewModel, taxonomyBranch.TaxonomyTrunk.DisplayName));
            }
            viewModel.UpdateModel(taxonomyBranch, CurrentPerson);
            return(new ModalDialogFormJsonResult());
        }
Beispiel #9
0
        public ActionResult EditChildrenSortOrder(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey, EditSortOrderViewModel viewModel)
        {
            var projectTypes = taxonomyBranchPrimaryKey.EntityObject.ProjectTypes;

            if (!ModelState.IsValid)
            {
                return(ViewEditChildrenSortOrder(projectTypes, viewModel));
            }

            viewModel.UpdateModel(new List <IHaveASortOrder>(projectTypes));
            SetMessageForDisplay($"Successfully Updated {FieldDefinition.TaxonomyBranch.GetFieldDefinitionLabel()} Sort Order");
            return(new ModalDialogFormJsonResult());
        }
        public ViewResult Detail(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey)
        {
            var taxonomyBranch         = taxonomyBranchPrimaryKey.EntityObject;
            var taxonomyBranchProjects = taxonomyBranch.GetAssociatedProjects(CurrentFirmaSession).ToList();

            var projectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyBranch, new List <int> {
                taxonomyBranch.TaxonomyBranchID
            }, ProjectColorByType.ProjectStage);
            var projectLocationsLayerGeoJson = new LayerGeoJson(
                $"{FieldDefinitionEnum.ProjectLocation.ToType().GetFieldDefinitionLabel()}",
                taxonomyBranchProjects.MappedPointsToGeoJsonFeatureCollection(false, true, true),
                "red", 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show);
            var projectLocationsMapInitJson = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson, projectMapCustomization,
                                                                              "TaxonomyBranchProjectMap", false);

            // Add Organization Type boundaries according to configuration
            projectLocationsMapInitJson.Layers.AddRange(HttpRequestStorage.DatabaseEntities.Organizations.GetConfiguredBoundaryLayersGeoJson());

            var projectLocationsMapViewData = new ProjectLocationsMapViewData(projectLocationsMapInitJson.MapDivID, ProjectColorByType.ProjectStage.GetDisplayNameFieldDefinition(), MultiTenantHelpers.GetTopLevelTaxonomyTiers(), CurrentFirmaSession.CanViewProposals());

            var associatePerformanceMeasureTaxonomyLevel = MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel();
            var canHaveAssociatedPerformanceMeasures     = associatePerformanceMeasureTaxonomyLevel == TaxonomyLevel.Branch;
            var taxonomyTierPerformanceMeasures          = taxonomyBranch.GetTaxonomyTierPerformanceMeasures();
            var relatedPerformanceMeasuresViewData       = new RelatedPerformanceMeasuresViewData(associatePerformanceMeasureTaxonomyLevel, true, taxonomyTierPerformanceMeasures, canHaveAssociatedPerformanceMeasures);
            List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas = null;

            if (canHaveAssociatedPerformanceMeasures)
            {
                performanceMeasureChartViewDatas = taxonomyTierPerformanceMeasures.Select(x => new PerformanceMeasureChartViewData(x.Key, CurrentFirmaSession, false, new List <Project>())).ToList();
            }

            var taxonomyLevel = MultiTenantHelpers.GetTaxonomyLevel();
            var projectCustomDefaultGridConfigurations = HttpRequestStorage.DatabaseEntities.ProjectCustomGridConfigurations.Where(x => x.IsEnabled && x.ProjectCustomGridTypeID == ProjectCustomGridType.Default.ProjectCustomGridTypeID).OrderBy(x => x.SortOrder).ToList();
            var viewData = new DetailViewData(CurrentFirmaSession, taxonomyBranch, projectLocationsMapInitJson, projectLocationsMapViewData, canHaveAssociatedPerformanceMeasures, relatedPerformanceMeasuresViewData, performanceMeasureChartViewDatas, taxonomyLevel, projectCustomDefaultGridConfigurations);

            return(RazorView <Summary, DetailViewData>(viewData));
        }