/// <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); }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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 }); }
/// <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); }
/// <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))); }
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()); }
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))); }
/// <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)); }
public bool HasSettableBenchmarkAndThresholdValues() { return(TreatmentBMPType.GetObservationTypes().Any(x => x.GetHasBenchmarkAndThreshold())); }
/// <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)); }
/// <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); }
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); }
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; }
public static string GetEditUrl(this TreatmentBMPType treatmentBMPType) { return(EditUrlTemplate.ParameterReplace(treatmentBMPType.TreatmentBMPTypeID)); }
/// <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)); }
public static string GetDetailUrl(this TreatmentBMPType treatmentBMPType) { return(treatmentBMPType == null ? "" : DetailUrlTemplate.ParameterReplace(treatmentBMPType.TreatmentBMPTypeID)); }
/// <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))); }
/// <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))); }