Пример #1
0
        public DetailViewData(Person currentPerson,
                              Models.TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType) : base(currentPerson, NeptuneArea.OCStormwaterTools)
        {
            TreatmentBMPAssessmentObservationType = treatmentBMPAssessmentObservationType;
            EntityName = "Observation Type";
            EntityUrl  = SitkaRoute <TreatmentBMPAssessmentObservationTypeController> .BuildUrlFromExpression(c => c.Index());

            PageTitle = TreatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeName;

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

            ViewSchemaDetailUrl = TreatmentBMPAssessmentObservationType.ObservationTypeSpecification.ObservationTypeCollectionMethod.ViewSchemaDetailUrl(TreatmentBMPAssessmentObservationType);

            TreatmentBMPTypeGridSpec = new TreatmentBMPTypeGridSpec(currentPerson)
            {
                ObjectNameSingular  = $"{FieldDefinitionType.TreatmentBMPType.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{FieldDefinitionType.TreatmentBMPType.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            TreatmentBMPTypeGridName    = "treatmentBMPTypeGridForObservationType";
            TreatmentBMPTypeGridDataUrl = SitkaRoute <TreatmentBMPAssessmentObservationTypeController> .BuildUrlFromExpression(tc => tc.TreatmentBMPTypeGridJsonData(TreatmentBMPAssessmentObservationType));

            ViewModelForPreview = new EditViewModel(treatmentBMPAssessmentObservationType);
            PreviewUrl          = SitkaRoute <TreatmentBMPAssessmentObservationTypeController> .BuildUrlFromExpression(x => x.PreviewObservationType());
        }
        public GridJsonNetJObjectResult <TreatmentBMPType> TreatmentBMPTypeGridJsonData()
        {
            var gridSpec                 = new TreatmentBMPTypeGridSpec(CurrentPerson);
            var treatmentBMPTypes        = HttpRequestStorage.DatabaseEntities.TreatmentBMPTypes.OrderBy(x => x.TreatmentBMPTypeName).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <TreatmentBMPType>(treatmentBMPTypes, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Пример #3
0
        public GridJsonNetJObjectResult <TreatmentBMPType> TreatmentBMPTypeGridJsonData(TreatmentBMPAssessmentObservationTypePrimaryKey treatmentBMPAssessmentObservationTypePrimaryKey)
        {
            var gridSpec = new TreatmentBMPTypeGridSpec(CurrentPerson);
            var treatmentBMPAssessmentObservationType = treatmentBMPAssessmentObservationTypePrimaryKey.EntityObject;
            var treatmentBMPTypes        = treatmentBMPAssessmentObservationType.TreatmentBMPTypeAssessmentObservationTypes.Select(x => x.TreatmentBMPType).OrderBy(x => x.TreatmentBMPTypeName).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <TreatmentBMPType>(treatmentBMPTypes, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Пример #4
0
        public GridJsonNetJObjectResult <TreatmentBMPType> TreatmentBMPTypeGridJsonData(CustomAttributeTypePrimaryKey customAttributeTypePrimaryKey)
        {
            var gridSpec                 = new TreatmentBMPTypeGridSpec(CurrentPerson);
            var customAttributeType      = customAttributeTypePrimaryKey.EntityObject;
            var treatmentBMPTypes        = customAttributeType.TreatmentBMPTypeCustomAttributeTypes.Select(x => x.TreatmentBMPType).OrderBy(x => x.TreatmentBMPTypeName).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <TreatmentBMPType>(treatmentBMPTypes, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Пример #5
0
        public DetailViewData(Person currentPerson,
                              Models.CustomAttributeType customAttributeType) : base(currentPerson, NeptuneArea.OCStormwaterTools)
        {
            CustomAttributeType = customAttributeType;
            EntityName          = FieldDefinitionType.CustomAttributeType.GetFieldDefinitionLabelPluralized();
            PageTitle           = customAttributeType.CustomAttributeTypeName;

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

            if (UserHasCustomAttributeTypeManagePermissions)
            {
                EntityUrl = SitkaRoute <CustomAttributeTypeController> .BuildUrlFromExpression(c => c.Manage());
            }

            TreatmentBMPTypeGridSpec = new TreatmentBMPTypeGridSpec(currentPerson)
            {
                ObjectNameSingular  = $"{FieldDefinitionType.TreatmentBMPType.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{FieldDefinitionType.TreatmentBMPType.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            TreatmentBMPTypeGridName    = "treatmentBMPTypeGridForAttribute";
            TreatmentBMPTypeGridDataUrl = SitkaRoute <CustomAttributeTypeController> .BuildUrlFromExpression(tc => tc.TreatmentBMPTypeGridJsonData(customAttributeType));
        }