コード例 #1
0
        public IndexViewData(Person currentPerson, Models.NeptunePage neptunePage, int treatmentBmpsInExportCount, int featureClassesInExportCount, string bulkBMPUploadUrl)
            : base(currentPerson, neptunePage, NeptuneArea.OCStormwaterTools)
        {
            TreatmentBmpsInExportCount  = treatmentBmpsInExportCount;
            FeatureClassesInExportCount = featureClassesInExportCount;
            PageTitle  = "All Treatment BMPs";
            EntityName = $"{FieldDefinitionType.TreatmentBMP.GetFieldDefinitionLabelPluralized()}";
            var showDelete = new JurisdictionManageFeature().HasPermissionByPerson(currentPerson);
            var showEdit   = new JurisdictionEditFeature().HasPermissionByPerson(currentPerson);

            GridSpec = new TreatmentBMPGridSpec(currentPerson, showDelete, showEdit)
            {
                ObjectNameSingular = "Treatment BMP", ObjectNamePlural = "Treatment BMPs", SaveFiltersInCookie = true
            };
            GridName    = "treatmentBMPsGrid";
            GridDataUrl = SitkaRoute <TreatmentBMPController> .BuildUrlFromExpression(j => j.TreatmentBMPGridJsonData());

            NewUrl = SitkaRoute <TreatmentBMPController> .BuildUrlFromExpression(x => x.New());

            BulkBMPUploadUrl        = bulkBMPUploadUrl;
            HasEditPermissions      = new JurisdictionEditFeature().HasPermissionByPerson(currentPerson);
            HasAdminPermissions     = new NeptuneAdminFeature().HasPermissionByPerson(currentPerson);
            DownloadBMPInventoryUrl = SitkaRoute <TreatmentBMPController> .BuildUrlFromExpression(x => x.BMPInventoryExport());

            RefreshLSPCBasinsUrl = SitkaRoute <TreatmentBMPController> .BuildUrlFromExpression(x => x.RefreshLSPCBasinsFromOCSurvey());

            RefreshPrecipitationZonesUrl = SitkaRoute <TreatmentBMPController> .BuildUrlFromExpression(x => x.RefreshPrecipitationZonesFromOCSurvey());
        }
コード例 #2
0
        public DetailViewData(Person currentPerson,
                              Models.TreatmentBMPType treatmentBMPType) : base(currentPerson, NeptuneArea.OCStormwaterTools)
        {
            CurrentPersonIsAnonymousOrUnassigned = currentPerson.IsAnonymousOrUnassigned();
            TreatmentBMPType = treatmentBMPType;
            EntityName       = FieldDefinitionType.TreatmentBMPType.GetFieldDefinitionLabelPluralized();
            PageTitle        = treatmentBMPType.TreatmentBMPTypeName;
            var showDelete = new JurisdictionManageFeature().HasPermissionByPerson(currentPerson);
            var showEdit   = new JurisdictionEditFeature().HasPermissionByPerson(currentPerson);

            GridSpec = new TreatmentBMPsInTreatmentBMPTypeGridSpec(currentPerson, showDelete, showEdit, treatmentBMPType)
            {
                ObjectNameSingular = "Treatment BMP", ObjectNamePlural = "Treatment BMPs", SaveFiltersInCookie = true
            };
            GridName    = "treatmentBMPsGrid";
            GridDataUrl = SitkaRoute <TreatmentBMPTypeController> .BuildUrlFromExpression(j => j.TreatmentBMPsInTreatmentBMPTypeGridJsonData(treatmentBMPType));

            UserHasTreatmentBMPTypeManagePermissions = new NeptuneAdminFeature().HasPermissionByPerson(currentPerson);

            EntityUrl = SitkaRoute <TreatmentBMPTypeController> .BuildUrlFromExpression(c => c.Index());

            ObservationTypeSortOrderUrl =
                SitkaRoute <TreatmentBMPTypeController> .BuildUrlFromExpression(x =>
                                                                                x.EditObservationTypesSortOrder(TreatmentBMPType));
        }
コード例 #3
0
        private List <RegionalSubbasinRevisionRequest> GetTreatmentBmpsAndGridSpec(
            out RegionalSubbasinRevisionRequestGridSpec gridSpec, Person currentPerson)
        {
            var showDelete = new JurisdictionManageFeature().HasPermissionByPerson(currentPerson);
            var showEdit   = new JurisdictionEditFeature().HasPermissionByPerson(currentPerson);

            gridSpec = new RegionalSubbasinRevisionRequestGridSpec();
            return(HttpRequestStorage.DatabaseEntities.RegionalSubbasinRevisionRequests.ToList()
                   .Where(x => x.CanView(CurrentPerson)).ToList());
        }
コード例 #4
0
        public GridJsonNetJObjectResult <vTreatmentBMPDetailedWithTreatmentBMPEntity> TreatmentBMPsInTreatmentBMPTypeGridJsonData(TreatmentBMPTypePrimaryKey treatmentBmpTypePrimaryKey)
        {
            var treatmentBmpType = treatmentBmpTypePrimaryKey.EntityObject;
            var stormwaterJurisdictionIDsPersonCanView = CurrentPerson.GetStormwaterJurisdictionIDsPersonCanView();
            var showDelete    = new JurisdictionManageFeature().HasPermissionByPerson(CurrentPerson);
            var showEdit      = new JurisdictionEditFeature().HasPermissionByPerson(CurrentPerson);
            var gridSpec      = new TreatmentBMPsInTreatmentBMPTypeGridSpec(CurrentPerson, showDelete, showEdit, treatmentBmpType);
            var treatmentBMPs =
                HttpRequestStorage.DatabaseEntities.TreatmentBMPs
                .Include(x => x.WaterQualityManagementPlan)
                .Include(x => x.CustomAttributes)
                .Include(x => x.CustomAttributes.Select(y => y.CustomAttributeValues))
                .Where(x => stormwaterJurisdictionIDsPersonCanView.Contains(x.StormwaterJurisdictionID) && x.TreatmentBMPTypeID == treatmentBmpType.TreatmentBMPTypeID)
                .ToList()
                .Join(HttpRequestStorage.DatabaseEntities.vTreatmentBMPDetaileds,
                      x => x.TreatmentBMPID,
                      y => y.TreatmentBMPID,
                      (x, y) => new vTreatmentBMPDetailedWithTreatmentBMPEntity(x, y))
                .ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <vTreatmentBMPDetailedWithTreatmentBMPEntity>(treatmentBMPs, gridSpec);

            return(gridJsonNetJObjectResult);
        }