Example #1
0
        public ViewResult Detail(FundingSourceCustomAttributeTypePrimaryKey fundingSourceCustomAttributeTypePrimaryKey)
        {
            var fundingSourceCustomAttributeType = fundingSourceCustomAttributeTypePrimaryKey.EntityObject;
            var viewData = new DetailViewData(CurrentFirmaSession, fundingSourceCustomAttributeType);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #2
0
        public ViewResult Detail(ProjectCustomAttributeTypePrimaryKey projectCustomAttributeTypePrimaryKey)
        {
            var projectCustomAttributeType = projectCustomAttributeTypePrimaryKey.EntityObject;
            var viewData = new DetailViewData(CurrentPerson, projectCustomAttributeType);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #3
0
        public ViewResult Detail(TreatmentBMPAssessmentPrimaryKey treatmentBMPAssessmentPrimaryKey)
        {
            var treatmentBMPAssessment = treatmentBMPAssessmentPrimaryKey.EntityObject;
            var viewData = new DetailViewData(CurrentPerson, treatmentBMPAssessment);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
        public ViewResult Detail(DocumentLibraryPrimaryKey documentLibraryPrimaryKey)
        {
            var documentLibrary = documentLibraryPrimaryKey.EntityObject;
            var viewData        = new DetailViewData(CurrentFirmaSession, documentLibrary);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #5
0
        public ViewResult Detail(EvaluationPrimaryKey evaluationPrimaryKey)
        {
            var evaluation = evaluationPrimaryKey.EntityObject;
            var viewData   = new DetailViewData(CurrentFirmaSession, evaluation);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #6
0
        public ViewResult Detail(ProgramPrimaryKey programPrimaryKey)
        {
            var program  = programPrimaryKey.EntityObject;
            var viewData = new DetailViewData(CurrentPerson, program);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
        public ViewResult Detail(MaintenanceRecordPrimaryKey maintenanceRecordPrimaryKey)
        {
            var maintenanceRecord = maintenanceRecordPrimaryKey.EntityObject;
            var viewData          = new DetailViewData(CurrentPerson, maintenanceRecord);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #8
0
        public ViewResult AgreementDetail(AgreementPrimaryKey agreementPrimaryKey)
        {
            var userHasAgreementAdminPermissions = new FirmaAdminFeature().HasPermissionByPerson(CurrentPerson);
            var agreement = agreementPrimaryKey.EntityObject;
            var viewData  = new DetailViewData(CurrentPerson, agreement, userHasAgreementAdminPermissions);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #9
0
        public ViewResult Detail()
        {
            var tenant                                = HttpRequestStorage.Tenant;
            var tenantAttribute                       = MultiTenantHelpers.GetTenantAttributeFromCache();
            var editBasicsUrl                         = new SitkaRoute <TenantController>(c => c.EditBasics()).BuildUrlFromExpression();
            var editBoundingBoxUrl                    = new SitkaRoute <TenantController>(c => c.EditBoundingBox()).BuildUrlFromExpression();
            var editClassificationSystemsUrl          = new SitkaRoute <TenantController>(c => c.EditClassificationSystems()).BuildUrlFromExpression();
            var editStylesheetUrl                     = new SitkaRoute <TenantController>(c => c.EditStylesheet()).BuildUrlFromExpression();
            var editTenantLogoUrl                     = new SitkaRoute <TenantController>(c => c.EditTenantLogo()).BuildUrlFromExpression();
            var deleteTenantStyleSheetFileResourceUrl = new SitkaRoute <TenantController>(c => c.DeleteTenantStyleSheetFileResource()).BuildUrlFromExpression();
            var deleteTenantSquareLogoFileResourceUrl = new SitkaRoute <TenantController>(c => c.DeleteTenantSquareLogoFileResource()).BuildUrlFromExpression();
            var deleteTenantBannerLogoFileResourceUrl = new SitkaRoute <TenantController>(c => c.DeleteTenantBannerLogoFileResource()).BuildUrlFromExpression();
            var boundingBoxLayer                      = new LayerGeoJson("Bounding Box",
                                                                         new FeatureCollection(new List <TenantAttribute> {
                tenantAttribute
            }.Select(x => DbGeometryToGeoJsonHelper.FromDbGeometry(x.DefaultBoundingBox)).ToList()),
                                                                         FirmaHelpers.DefaultColorRange[0],
                                                                         0.8m,
                                                                         LayerInitialVisibility.LayerInitialVisibilityEnum.Show);
            var layers = MapInitJson.GetConfiguredGeospatialAreaMapLayers();

            layers.Add(boundingBoxLayer);
            var mapInitJson = new MapInitJson("TenantDetailBoundingBoxMap",
                                              10,
                                              layers,
                                              MapInitJson.GetExternalMapLayers(),
                                              BoundingBox.MakeBoundingBoxFromLayerGeoJsonList(new List <LayerGeoJson> {
                boundingBoxLayer
            }));
            var gridSpec = new DetailGridSpec {
                ObjectNameSingular = "Tenant", ObjectNamePlural = "Tenants", SaveFiltersInCookie = true
            };
            var gridName    = "Tenants";
            var gridDataUrl = new SitkaRoute <TenantController>(c => c.DetailGridJsonData()).BuildUrlFromExpression();
            var costTypes   = HttpRequestStorage.DatabaseEntities.CostTypes.ToList().Count > 0 ? string.Join(", ", HttpRequestStorage.DatabaseEntities.CostTypes.Select(x => x.CostTypeName).ToList()) : null;

            var viewData = new DetailViewData(CurrentFirmaSession,
                                              tenant,
                                              tenantAttribute,
                                              editBasicsUrl,
                                              editBoundingBoxUrl,
                                              deleteTenantStyleSheetFileResourceUrl,
                                              deleteTenantSquareLogoFileResourceUrl,
                                              deleteTenantBannerLogoFileResourceUrl,
                                              EditBoundingBoxFormID,
                                              mapInitJson,
                                              gridSpec,
                                              gridName,
                                              gridDataUrl,
                                              editClassificationSystemsUrl,
                                              editStylesheetUrl,
                                              editTenantLogoUrl,
                                              costTypes);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #10
0
        public ViewResult Detail(FocusAreaPrimaryKey focusAreaPrimaryKey)
        {
            var focusArea = focusAreaPrimaryKey.EntityObject;

            var mapInitJson = GetMapInitJsonWithProjects(focusArea, out var hasSpatialData, CurrentPerson);

            var grantAllocationAwardGridSpec = new GrantAllocationAwardGridSpec(CurrentPerson, focusArea);


            var viewData = new DetailViewData(CurrentPerson, focusArea, mapInitJson, hasSpatialData, grantAllocationAwardGridSpec);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
        public ViewResult Detail(GisFeaturePrimaryKey gisFeaturePrimaryKey)
        {
            var gisFeature = gisFeaturePrimaryKey.EntityObject;
            var mapDivID   = $"gisFeature_{gisFeature.GisFeatureID}_Map";

            var sqlGeom = gisFeature.GisFeatureGeometry.ToSqlGeometry().MakeValid();
            var feature = sqlGeom.ToDbGeometryWithCoordinateSystem();

            var layers = GisFeature.GetGisFeatureLayers(gisFeature);

            var mapInitJson = new MapInitJson(mapDivID, 10, layers, new BoundingBox(feature));
            var viewData    = new DetailViewData(CurrentPerson, gisFeature, mapInitJson);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #12
0
        public ViewResult Detail(PersonPrimaryKey personPrimaryKey)
        {
            var person = personPrimaryKey.EntityObject;
            var userNotificationGridSpec    = new UserNotificationGridSpec();
            var userNotificationGridDataUrl = SitkaRoute <UserController> .BuildUrlFromExpression(x => x.UserNotificationsGridJsonData(personPrimaryKey));

            var activateInactivateUrl = SitkaRoute <UserController> .BuildUrlFromExpression(x => x.ActivateInactivatePerson(person));

            var viewData = new DetailViewData(CurrentPerson,
                                              person,
                                              userNotificationGridSpec,
                                              "userNotifications",
                                              userNotificationGridDataUrl,
                                              activateInactivateUrl);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #13
0
        public ViewResult Detail(PersonPrimaryKey personPrimaryKey)
        {
            ShowWarningAboutInactivatedUserForOrganizationPrimaryContact(personPrimaryKey.EntityObject);

            var person = personPrimaryKey.EntityObject;
            var userNotificationGridSpec    = new UserNotificationGridSpec();
            var userNotificationGridDataUrl =
                SitkaRoute <UserController> .BuildUrlFromExpression(
                    x => x.UserNotificationsGridJsonData(personPrimaryKey));

            var basicProjectInfoGridSpec = new Views.Project.UserProjectGridSpec(CurrentFirmaSession, person)
            {
                ObjectNameSingular =
                    $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} where {person.GetFullNameFirstLast()} is a Contact",
                ObjectNamePlural =
                    $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()} where {person.GetFullNameFirstLast()} is a Contact",
                SaveFiltersInCookie = true
            };
            const string basicProjectInfoGridName    = "userProjectListGrid";
            var          basicProjectInfoGridDataUrl =
                SitkaRoute <UserController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(person));

            var activateInactivateUrl =
                SitkaRoute <UserController> .BuildUrlFromExpression(x => x.ActivateInactivatePerson(person));

            var actionItemsGridSpec    = new ActionItemsUserGridSpec(CurrentFirmaSession);
            var actionItemsGridName    = "actionItems";
            var actionItemsGridDataUrl = SitkaRoute <ActionItemController> .BuildUrlFromExpression(c => c.ActionItemsUserGridJsonData(person));

            var viewData = new DetailViewData(this.CurrentFirmaSession,
                                              person,
                                              basicProjectInfoGridSpec,
                                              basicProjectInfoGridName,
                                              basicProjectInfoGridDataUrl,
                                              userNotificationGridSpec,
                                              "userNotifications",
                                              userNotificationGridDataUrl,
                                              activateInactivateUrl,
                                              actionItemsGridSpec,
                                              actionItemsGridName,
                                              actionItemsGridDataUrl);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
        private ViewResult ViewDetail(RegionalSubbasinRevisionRequest regionalSubbasinRevisionRequest)
        {
            var geometry = regionalSubbasinRevisionRequest.RegionalSubbasinRevisionRequestGeometry;
            var feature  = DbGeometryToGeoJsonHelper.FromDbGeometryWithReprojectionCheck(geometry);

            var layerGeoJson = new LayerGeoJson("centralizedDelineationLayer",
                                                new FeatureCollection(new List <Feature> {
                feature
            }), "#ffff00", .5m, LayerInitialVisibility.Show);

            var mapInitJson = new RegionalSubbasinRevisionRequestMapInitJson("revisionRequestMap",
                                                                             MapInitJson.DefaultZoomLevel, new List <LayerGeoJson>(),
                                                                             new BoundingBox(new List <DbGeometry> {
                geometry
            }), layerGeoJson);

            var viewData = new DetailViewData(CurrentPerson, regionalSubbasinRevisionRequest, mapInitJson);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #15
0
        private ViewResult ViewDetail(IRole role)
        {
            var viewData = new DetailViewData(CurrentPerson, role);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Example #16
0
        private ViewResult ViewDetail(IRole role, List <FeaturePermission> featurePermissions, string roleName)
        {
            var viewData = new DetailViewData(CurrentFirmaSession, role, featurePermissions, roleName);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
        public ViewResult Detail(WaterQualityManagementPlanPrimaryKey waterQualityManagementPlanPrimaryKey)
        {
            var waterQualityManagementPlan = waterQualityManagementPlanPrimaryKey.EntityObject;

            var parcels = waterQualityManagementPlan.WaterQualityManagementPlanParcels
                          .Select(x => x.Parcel).ToList();
            var parcelGeoJsonFeatureCollection = parcels.ToGeoJsonFeatureCollection();
            var treatmentBMPs = CurrentPerson.GetInventoriedBMPsForWQMP(waterQualityManagementPlanPrimaryKey);
            var treatmentBmpGeoJsonFeatureCollection =
                treatmentBMPs.ToGeoJsonFeatureCollection();

            treatmentBmpGeoJsonFeatureCollection.Features.ForEach(x =>
            {
                var treatmentBmpID = x.Properties.ContainsKey("TreatmentBMPID")
                    ? int.Parse(x.Properties["TreatmentBMPID"].ToString())
                    : (int?)null;
                if (treatmentBmpID != null)
                {
                    x.Properties.Add("PopupUrl", SitkaRoute <TreatmentBMPController> .BuildUrlFromExpression(c => c.MapPopup(treatmentBmpID)));
                }
            });

            //var boundingBoxGeometries = new List<DbGeometry>();
            //boundingBoxGeometries.AddRange(treatmentBMPs.Select(x=>x.LocationPoint4326));
            //boundingBoxGeometries.AddRange(parcels.Select(x=>x.ParcelGeometry4326));

            var layerGeoJsons = new List <LayerGeoJson>
            {
                new LayerGeoJson(FieldDefinitionType.Parcel.GetFieldDefinitionLabelPluralized(),
                                 parcelGeoJsonFeatureCollection,
                                 ParcelModelExtensions.ParcelColor,
                                 1,
                                 LayerInitialVisibility.Show),
                new LayerGeoJson(FieldDefinitionType.TreatmentBMP.GetFieldDefinitionLabelPluralized(),
                                 treatmentBmpGeoJsonFeatureCollection,
                                 "#935f59",
                                 1,
                                 LayerInitialVisibility.Show)
            };
            //var mapInitJson = new MapInitJson("waterQualityManagementPlanMap", 0, layerGeoJsons,
            //    new BoundingBox(boundingBoxGeometries));

            var mapInitJson = new MapInitJson("waterQualityManagementPlanMap", 0, layerGeoJsons,
                                              BoundingBox.MakeBoundingBoxFromLayerGeoJsonList(layerGeoJsons));

            if (treatmentBMPs.Any(x => x.Delineation != null))
            {
                mapInitJson.Layers.Add(StormwaterMapInitJson.MakeDelineationLayerGeoJson(
                                           treatmentBMPs.Where(x => x.Delineation != null).Select(x => x.Delineation)));
            }

            var waterQualityManagementPlanVerifies = HttpRequestStorage.DatabaseEntities.WaterQualityManagementPlanVerifies.Where(x =>
                                                                                                                                  x.WaterQualityManagementPlanID == waterQualityManagementPlan.PrimaryKey).OrderByDescending(x => x.VerificationDate).ToList();
            var waterQualityManagementPlanVerifyDraft = waterQualityManagementPlanVerifies.SingleOrDefault(x => x.IsDraft);

            var waterQualityManagementPlanVerifyQuickBMP =
                HttpRequestStorage.DatabaseEntities.WaterQualityManagementPlanVerifyQuickBMPs.Where(x =>
                                                                                                    x.WaterQualityManagementPlanVerify.WaterQualityManagementPlanID ==
                                                                                                    waterQualityManagementPlan.WaterQualityManagementPlanID).ToList();
            var waterQualityManagementPlanVerifyTreatmentBMP =
                HttpRequestStorage.DatabaseEntities.WaterQualityManagementPlanVerifyTreatmentBMPs.Where(x =>
                                                                                                        x.WaterQualityManagementPlanVerify.WaterQualityManagementPlanID ==
                                                                                                        waterQualityManagementPlan.WaterQualityManagementPlanID).ToList();

            var anyLspcBasins = waterQualityManagementPlan.WaterQualityManagementPlanBoundary != null && HttpRequestStorage.DatabaseEntities.LSPCBasins.Any(x =>
                                                                                                                                                            x.LSPCBasinGeometry.Intersects(waterQualityManagementPlan.WaterQualityManagementPlanBoundary));

            var dryWeatherFlowOverrides = DryWeatherFlowOverride.All;
            var waterQualityManagementPlanModelingApproaches = WaterQualityManagementPlanModelingApproach.All;

            var viewData = new DetailViewData(CurrentPerson, waterQualityManagementPlan,
                                              waterQualityManagementPlanVerifyDraft, mapInitJson, treatmentBMPs, new ParcelGridSpec(),
                                              waterQualityManagementPlanVerifies, waterQualityManagementPlanVerifyQuickBMP,
                                              waterQualityManagementPlanVerifyTreatmentBMP,
                                              new HRUCharacteristicsViewData(waterQualityManagementPlan,
                                                                             ((IHaveHRUCharacteristics)waterQualityManagementPlan).GetHRUCharacteristics().ToList()),
                                              anyLspcBasins, dryWeatherFlowOverrides, waterQualityManagementPlanModelingApproaches, new ModeledPerformanceViewData(waterQualityManagementPlan, CurrentPerson));

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