Esempio n. 1
0
        public PartialViewResult DeleteTaxonomyTrunk(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey)
        {
            var taxonomyTrunk = taxonomyTrunkPrimaryKey.EntityObject;
            var viewModel     = new ConfirmDialogFormViewModel(taxonomyTrunk.TaxonomyTrunkID);

            return(ViewDeleteTaxonomyTrunk(taxonomyTrunk, viewModel));
        }
Esempio n. 2
0
        public PartialViewResult EditChildrenSortOrder(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey)
        {
            var taxonomyBranches = taxonomyTrunkPrimaryKey.EntityObject.TaxonomyBranches;
            var viewModel        = new EditSortOrderViewModel();

            return(ViewEditChildrenSortOrder(taxonomyBranches, viewModel));
        }
Esempio n. 3
0
        public GridJsonNetJObjectResult <Project> ProjectsGridJsonData(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey)
        {
            var gridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true);
            var projectTaxonomyTrunks    = taxonomyTrunkPrimaryKey.EntityObject.GetAssociatedProjects(CurrentPerson);
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(projectTaxonomyTrunks, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Esempio n. 4
0
        public PartialViewResult Edit(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey)

        {
            var taxonomyTrunk = taxonomyTrunkPrimaryKey.EntityObject;
            var viewModel     = new EditViewModel(taxonomyTrunk);

            return(ViewEdit(viewModel));
        }
Esempio n. 5
0
        public GridJsonNetJObjectResult <Project> TaxonomyTrunkProjectsGridJsonData(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey)
        {
            var projectCustomGridConfigurations = 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, projectCustomGridConfigurations, ProjectCustomGridType.Default.ToEnum, projectDetails, CurrentTenant);
            var projectTaxonomyTrunks    = taxonomyTrunkPrimaryKey.EntityObject.GetAssociatedProjects(CurrentFirmaSession);
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(projectTaxonomyTrunks, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Esempio n. 6
0
        public ActionResult Edit(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey, EditViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(ViewEdit(viewModel));
            }

            var taxonomyTrunk = taxonomyTrunkPrimaryKey.EntityObject;

            viewModel.UpdateModel(taxonomyTrunk, CurrentPerson);
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 7
0
        public ActionResult EditChildrenSortOrder(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey, EditSortOrderViewModel viewModel)
        {
            var taxonomyBranches = taxonomyTrunkPrimaryKey.EntityObject.TaxonomyBranches;

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

            viewModel.UpdateModel(new List <IHaveASortOrder>(taxonomyBranches));
            SetMessageForDisplay($"Successfully Updated {FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabel()} Sort Order");
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 8
0
        public ActionResult DeleteTaxonomyTrunk(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey,
                                                ConfirmDialogFormViewModel viewModel)
        {
            var taxonomyTrunk = taxonomyTrunkPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteTaxonomyTrunk(taxonomyTrunk, viewModel));
            }

            taxonomyTrunk.DeleteFull(HttpRequestStorage.DatabaseEntities);
            return(new ModalDialogFormJsonResult());
        }
        public ViewResult Detail(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey)
        {
            var taxonomyTrunk         = taxonomyTrunkPrimaryKey.EntityObject;
            var taxonomyTrunkProjects = taxonomyTrunk.GetAssociatedProjects(CurrentFirmaSession).ToList();

            var projectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyTrunk,
                                                                      new List <int> {
                taxonomyTrunk.TaxonomyTrunkID
            }, ProjectColorByType.ProjectStage);
            var projectLocationsLayerGeoJson =
                new LayerGeoJson($"{FieldDefinitionEnum.ProjectLocation.ToType().GetFieldDefinitionLabel()}",
                                 taxonomyTrunkProjects.MappedPointsToGeoJsonFeatureCollection(false, true, true), "red", 1,
                                 LayerInitialVisibility.LayerInitialVisibilityEnum.Show);
            var projectLocationsMapInitJson = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson,
                                                                              projectMapCustomization, "TaxonomyTrunkProjectMap", false);

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

            var associatePerformanceMeasureTaxonomyLevel =
                MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel();
            var canHaveAssociatedPerformanceMeasures = associatePerformanceMeasureTaxonomyLevel == TaxonomyLevel.Trunk;
            var taxonomyTierPerformanceMeasures      = taxonomyTrunk.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, taxonomyTrunk, projectLocationsMapInitJson,
                                              projectLocationsMapViewData, canHaveAssociatedPerformanceMeasures, relatedPerformanceMeasuresViewData,
                                              performanceMeasureChartViewDatas, taxonomyLevel, projectCustomDefaultGridConfigurations);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Esempio n. 10
0
        public ViewResult Detail(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey)
        {
            var taxonomyTrunk         = taxonomyTrunkPrimaryKey.EntityObject;
            var taxonomyTrunkProjects = taxonomyTrunk.GetAssociatedProjects(CurrentPerson).ToList();

            var projectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyTrunk,
                                                                      new List <int> {
                taxonomyTrunk.TaxonomyTrunkID
            }, ProjectColorByType.ProjectStage);
            var projectLocationsLayerGeoJson =
                new LayerGeoJson($"{FieldDefinition.ProjectLocation.GetFieldDefinitionLabel()}",
                                 Project.MappedPointsToGeoJsonFeatureCollection(taxonomyTrunkProjects, true, true), "red", 1,
                                 LayerInitialVisibility.Show);
            var projectLocationsMapInitJson = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson,
                                                                              projectMapCustomization, "TaxonomyTrunkProjectMap");

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

            var associatePerformanceMeasureTaxonomyLevel =
                MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel();
            var canHaveAssociatedPerformanceMeasures = associatePerformanceMeasureTaxonomyLevel == TaxonomyLevel.Trunk;
            var taxonomyTierPerformanceMeasures      = taxonomyTrunk.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, taxonomyTrunk, projectLocationsMapInitJson,
                                                   projectLocationsMapViewData, canHaveAssociatedPerformanceMeasures, relatedPerformanceMeasuresViewData,
                                                   performanceMeasureChartViewDatas, taxonomyLevel);

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