Ejemplo n.º 1
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public TreatmentBMPTypeCustomAttributeType(TreatmentBMPType treatmentBMPType, CustomAttributeType customAttributeType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.TreatmentBMPTypeCustomAttributeTypeID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.TreatmentBMPTypeCustomAttributeTypes.Add(this);
     this.CustomAttributeTypeID = customAttributeType.CustomAttributeTypeID;
     this.CustomAttributeType   = customAttributeType;
     customAttributeType.TreatmentBMPTypeCustomAttributeTypes.Add(this);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public TreatmentBMPTypeAssessmentObservationType(TreatmentBMPType treatmentBMPType, TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType, bool overrideAssessmentScoreIfFailing) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.TreatmentBMPTypeAssessmentObservationTypeID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.TreatmentBMPTypeAssessmentObservationTypes.Add(this);
     this.TreatmentBMPAssessmentObservationTypeID = treatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeID;
     this.TreatmentBMPAssessmentObservationType   = treatmentBMPAssessmentObservationType;
     treatmentBMPAssessmentObservationType.TreatmentBMPTypeAssessmentObservationTypes.Add(this);
     this.OverrideAssessmentScoreIfFailing = overrideAssessmentScoreIfFailing;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public QuickBMP(WaterQualityManagementPlan waterQualityManagementPlan, TreatmentBMPType treatmentBMPType, string quickBMPName) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.QuickBMPID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.WaterQualityManagementPlanID = waterQualityManagementPlan.WaterQualityManagementPlanID;
     this.WaterQualityManagementPlan   = waterQualityManagementPlan;
     waterQualityManagementPlan.QuickBMPs.Add(this);
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.QuickBMPs.Add(this);
     this.QuickBMPName = quickBMPName;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public MaintenanceRecord(TreatmentBMP treatmentBMP, TreatmentBMPType treatmentBMPType, FieldVisit fieldVisit) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.MaintenanceRecordID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TreatmentBMPID      = treatmentBMP.TreatmentBMPID;
     this.TreatmentBMP        = treatmentBMP;
     treatmentBMP.MaintenanceRecords.Add(this);
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.MaintenanceRecords.Add(this);
     this.FieldVisitID = fieldVisit.FieldVisitID;
     this.FieldVisit   = fieldVisit;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public TreatmentBMPAssessment(TreatmentBMP treatmentBMP, TreatmentBMPType treatmentBMPType, FieldVisit fieldVisit, TreatmentBMPAssessmentType treatmentBMPAssessmentType, bool isAssessmentComplete) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.TreatmentBMPAssessmentID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TreatmentBMPID           = treatmentBMP.TreatmentBMPID;
     this.TreatmentBMP             = treatmentBMP;
     treatmentBMP.TreatmentBMPAssessments.Add(this);
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.TreatmentBMPAssessments.Add(this);
     this.FieldVisitID = fieldVisit.FieldVisitID;
     this.FieldVisit   = fieldVisit;
     fieldVisit.TreatmentBMPAssessments.Add(this);
     this.TreatmentBMPAssessmentTypeID = treatmentBMPAssessmentType.TreatmentBMPAssessmentTypeID;
     this.IsAssessmentComplete         = isAssessmentComplete;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public TreatmentBMP(string treatmentBMPName, TreatmentBMPType treatmentBMPType, StormwaterJurisdiction stormwaterJurisdiction, Organization ownerOrganization, bool inventoryIsVerified, TrashCaptureStatusType trashCaptureStatusType, SizingBasisType sizingBasisType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.TreatmentBMPID     = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TreatmentBMPName   = treatmentBMPName;
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.TreatmentBMPs.Add(this);
     this.StormwaterJurisdictionID = stormwaterJurisdiction.StormwaterJurisdictionID;
     this.StormwaterJurisdiction   = stormwaterJurisdiction;
     stormwaterJurisdiction.TreatmentBMPs.Add(this);
     this.OwnerOrganizationID = ownerOrganization.OrganizationID;
     this.OwnerOrganization   = ownerOrganization;
     ownerOrganization.TreatmentBMPsWhereYouAreTheOwnerOrganization.Add(this);
     this.InventoryIsVerified      = inventoryIsVerified;
     this.TrashCaptureStatusTypeID = trashCaptureStatusType.TrashCaptureStatusTypeID;
     this.SizingBasisTypeID        = sizingBasisType.SizingBasisTypeID;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static TreatmentBMP CreateNewBlank(TreatmentBMPType treatmentBMPType, StormwaterJurisdiction stormwaterJurisdiction, Organization ownerOrganization, TrashCaptureStatusType trashCaptureStatusType, SizingBasisType sizingBasisType)
 {
     return(new TreatmentBMP(default(string), treatmentBMPType, stormwaterJurisdiction, ownerOrganization, default(bool), trashCaptureStatusType, sizingBasisType));
 }
 public static void DeleteTreatmentBMPType(this IQueryable <TreatmentBMPType> treatmentBMPTypes, TreatmentBMPType treatmentBMPTypeToDelete)
 {
     DeleteTreatmentBMPType(treatmentBMPTypes, new List <TreatmentBMPType> {
         treatmentBMPTypeToDelete
     });
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Overload taking a TreatmentBMPType so it can access the Custom Attributes
        /// </summary>
        /// <param name="treatmentBMPs"></param>
        /// <param name="treatmentBMPType"></param>
        /// <returns></returns>
        public static FeatureCollection ToExportGeoJsonFeatureCollection(this IEnumerable <TreatmentBMP> treatmentBMPs, TreatmentBMPType treatmentBMPType)
        {
            var featureCollection = new FeatureCollection();

            featureCollection.Features.AddRange(treatmentBMPs.Select(treatmentBMP =>
            {
                var feature = DbGeometryToGeoJsonHelper.FromDbGeometryWithNoReproject(treatmentBMP.LocationPoint4326);
                AddAllCommonPropertiesToTreatmentBMPFeature(feature, treatmentBMP);
                foreach (var ca in treatmentBMPType.TreatmentBMPTypeCustomAttributeTypes.OrderBy(x => x.SortOrder))
                {
                    feature.Properties.Add(Ogr2OgrCommandLineRunner.SanitizeStringForGdb(ca.CustomAttributeType.CustomAttributeTypeName), treatmentBMP.GetCustomAttributeValueWithUnits(ca));
                }
                return(feature);
            }));
            return(featureCollection);
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static TreatmentBMPAssessment CreateNewBlank(TreatmentBMP treatmentBMP, TreatmentBMPType treatmentBMPType, FieldVisit fieldVisit, TreatmentBMPAssessmentType treatmentBMPAssessmentType)
 {
     return(new TreatmentBMPAssessment(treatmentBMP, treatmentBMPType, fieldVisit, treatmentBMPAssessmentType, default(bool)));
 }
Ejemplo n.º 11
0
 public static List <TreatmentBMPAssessmentObservationType> GetObservationTypesForTreatmentType(this IQueryable <TreatmentBMPTypeAssessmentObservationType> TreatmentBMPTypeAssessmentObservationTypes, TreatmentBMPType treatmentBMPType)
 {
     return(TreatmentBMPTypeAssessmentObservationTypes.Where(x => x.TreatmentBMPTypeID == treatmentBMPType.TreatmentBMPTypeID).ToList().Select(x => x.TreatmentBMPAssessmentObservationType).ToList());
 }
Ejemplo n.º 12
0
 public static HtmlString GetDisplayNameAsUrl(this TreatmentBMPType treatmentBMPType)
 {
     return(treatmentBMPType != null?UrlTemplate.MakeHrefString(treatmentBMPType.GetDetailUrl(), treatmentBMPType.TreatmentBMPTypeName) : new HtmlString(null));
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static TreatmentBMPBenchmarkAndThreshold CreateNewBlank(TreatmentBMP treatmentBMP, TreatmentBMPTypeAssessmentObservationType treatmentBMPTypeAssessmentObservationType, TreatmentBMPType treatmentBMPType, TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType)
 {
     return(new TreatmentBMPBenchmarkAndThreshold(treatmentBMP, treatmentBMPTypeAssessmentObservationType, treatmentBMPType, treatmentBMPAssessmentObservationType, default(double), default(double)));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static CustomAttribute CreateNewBlank(TreatmentBMP treatmentBMP, TreatmentBMPTypeCustomAttributeType treatmentBMPTypeCustomAttributeType, TreatmentBMPType treatmentBMPType, CustomAttributeType customAttributeType)
 {
     return(new CustomAttribute(treatmentBMP, treatmentBMPTypeCustomAttributeType, treatmentBMPType, customAttributeType));
 }
Ejemplo n.º 15
0
 public bool HasSettableBenchmarkAndThresholdValues()
 {
     return(TreatmentBMPType.GetObservationTypes().Any(x => x.GetHasBenchmarkAndThreshold()));
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static MaintenanceRecordObservation CreateNewBlank(MaintenanceRecord maintenanceRecord, TreatmentBMPTypeCustomAttributeType treatmentBMPTypeCustomAttributeType, TreatmentBMPType treatmentBMPType, CustomAttributeType customAttributeType)
 {
     return(new MaintenanceRecordObservation(maintenanceRecord, treatmentBMPTypeCustomAttributeType, treatmentBMPType, customAttributeType));
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public MaintenanceRecordObservation(MaintenanceRecord maintenanceRecord, TreatmentBMPTypeCustomAttributeType treatmentBMPTypeCustomAttributeType, TreatmentBMPType treatmentBMPType, CustomAttributeType customAttributeType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.MaintenanceRecordObservationID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.MaintenanceRecordID            = maintenanceRecord.MaintenanceRecordID;
     this.MaintenanceRecord = maintenanceRecord;
     maintenanceRecord.MaintenanceRecordObservations.Add(this);
     this.TreatmentBMPTypeCustomAttributeTypeID = treatmentBMPTypeCustomAttributeType.TreatmentBMPTypeCustomAttributeTypeID;
     this.TreatmentBMPTypeCustomAttributeType   = treatmentBMPTypeCustomAttributeType;
     treatmentBMPTypeCustomAttributeType.MaintenanceRecordObservations.Add(this);
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.MaintenanceRecordObservations.Add(this);
     this.CustomAttributeTypeID = customAttributeType.CustomAttributeTypeID;
     this.CustomAttributeType   = customAttributeType;
     customAttributeType.MaintenanceRecordObservations.Add(this);
 }
Ejemplo n.º 18
0
        public static TreatmentBMPTypeAssessmentObservationType GetTreatmentBMPTypeObservationTypeOrDefault(this TreatmentBMPType treatmentBMPType, TreatmentBMPAssessmentObservationType TreatmentBMPAssessmentObservationType)
        {
            var TreatmentBMPTypeAssessmentObservationType = HttpRequestStorage.DatabaseEntities.TreatmentBMPTypeAssessmentObservationTypes.SingleOrDefault(
                x => x.TreatmentBMPTypeID == treatmentBMPType.TreatmentBMPTypeID && x.TreatmentBMPAssessmentObservationTypeID == TreatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeID);

            return(TreatmentBMPTypeAssessmentObservationType);
        }
Ejemplo n.º 19
0
        public static TreatmentBMPTypeAssessmentObservationType GetTreatmentBMPTypeObservationType(this TreatmentBMPType treatmentBMPType, TreatmentBMPAssessmentObservationType TreatmentBMPAssessmentObservationType)
        {
            var TreatmentBMPTypeAssessmentObservationType = treatmentBMPType.GetTreatmentBMPTypeObservationTypeOrDefault(TreatmentBMPAssessmentObservationType);

            Check.Assert(TreatmentBMPTypeAssessmentObservationType != null,
                         $"The Observation Type '{TreatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeName}' is not applicable to the Treatment BMP Type '{treatmentBMPType.TreatmentBMPTypeName}'.");
            return(TreatmentBMPTypeAssessmentObservationType);
        }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public TreatmentBMPBenchmarkAndThreshold(TreatmentBMP treatmentBMP, TreatmentBMPTypeAssessmentObservationType treatmentBMPTypeAssessmentObservationType, TreatmentBMPType treatmentBMPType, TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType, double benchmarkValue, double thresholdValue) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.TreatmentBMPBenchmarkAndThresholdID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TreatmentBMPID = treatmentBMP.TreatmentBMPID;
     this.TreatmentBMP   = treatmentBMP;
     treatmentBMP.TreatmentBMPBenchmarkAndThresholds.Add(this);
     this.TreatmentBMPTypeAssessmentObservationTypeID = treatmentBMPTypeAssessmentObservationType.TreatmentBMPTypeAssessmentObservationTypeID;
     this.TreatmentBMPTypeAssessmentObservationType   = treatmentBMPTypeAssessmentObservationType;
     treatmentBMPTypeAssessmentObservationType.TreatmentBMPBenchmarkAndThresholds.Add(this);
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.TreatmentBMPBenchmarkAndThresholds.Add(this);
     this.TreatmentBMPAssessmentObservationTypeID = treatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeID;
     this.TreatmentBMPAssessmentObservationType   = treatmentBMPAssessmentObservationType;
     treatmentBMPAssessmentObservationType.TreatmentBMPBenchmarkAndThresholds.Add(this);
     this.BenchmarkValue = benchmarkValue;
     this.ThresholdValue = thresholdValue;
 }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public TreatmentBMPObservation(TreatmentBMPAssessment treatmentBMPAssessment, TreatmentBMPTypeAssessmentObservationType treatmentBMPTypeAssessmentObservationType, TreatmentBMPType treatmentBMPType, TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType, string observationData) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.TreatmentBMPObservationID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TreatmentBMPAssessmentID  = treatmentBMPAssessment.TreatmentBMPAssessmentID;
     this.TreatmentBMPAssessment    = treatmentBMPAssessment;
     treatmentBMPAssessment.TreatmentBMPObservations.Add(this);
     this.TreatmentBMPTypeAssessmentObservationTypeID = treatmentBMPTypeAssessmentObservationType.TreatmentBMPTypeAssessmentObservationTypeID;
     this.TreatmentBMPTypeAssessmentObservationType   = treatmentBMPTypeAssessmentObservationType;
     treatmentBMPTypeAssessmentObservationType.TreatmentBMPObservations.Add(this);
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.TreatmentBMPObservations.Add(this);
     this.TreatmentBMPAssessmentObservationTypeID = treatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeID;
     this.TreatmentBMPAssessmentObservationType   = treatmentBMPAssessmentObservationType;
     treatmentBMPAssessmentObservationType.TreatmentBMPObservations.Add(this);
     this.ObservationData = observationData;
 }
Ejemplo n.º 22
0
 public static string GetEditUrl(this TreatmentBMPType treatmentBMPType)
 {
     return(EditUrlTemplate.ParameterReplace(treatmentBMPType.TreatmentBMPTypeID));
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static MaintenanceRecord CreateNewBlank(TreatmentBMP treatmentBMP, TreatmentBMPType treatmentBMPType, FieldVisit fieldVisit)
 {
     return(new MaintenanceRecord(treatmentBMP, treatmentBMPType, fieldVisit));
 }
Ejemplo n.º 24
0
 public static string GetDetailUrl(this TreatmentBMPType treatmentBMPType)
 {
     return(treatmentBMPType == null ? "" : DetailUrlTemplate.ParameterReplace(treatmentBMPType.TreatmentBMPTypeID));
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static TreatmentBMPTypeAssessmentObservationType CreateNewBlank(TreatmentBMPType treatmentBMPType, TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType)
 {
     return(new TreatmentBMPTypeAssessmentObservationType(treatmentBMPType, treatmentBMPAssessmentObservationType, default(bool)));
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static TreatmentBMPObservation CreateNewBlank(TreatmentBMPAssessment treatmentBMPAssessment, TreatmentBMPTypeAssessmentObservationType treatmentBMPTypeAssessmentObservationType, TreatmentBMPType treatmentBMPType, TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType)
 {
     return(new TreatmentBMPObservation(treatmentBMPAssessment, treatmentBMPTypeAssessmentObservationType, treatmentBMPType, treatmentBMPAssessmentObservationType, default(string)));
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static QuickBMP CreateNewBlank(WaterQualityManagementPlan waterQualityManagementPlan, TreatmentBMPType treatmentBMPType)
 {
     return(new QuickBMP(waterQualityManagementPlan, treatmentBMPType, default(string)));
 }