Ejemplo n.º 1
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public SourceControlBMP(WaterQualityManagementPlan waterQualityManagementPlan, SourceControlBMPAttribute sourceControlBMPAttribute) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.SourceControlBMPID           = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.WaterQualityManagementPlanID = waterQualityManagementPlan.WaterQualityManagementPlanID;
     this.WaterQualityManagementPlan   = waterQualityManagementPlan;
     waterQualityManagementPlan.SourceControlBMPs.Add(this);
     this.SourceControlBMPAttributeID = sourceControlBMPAttribute.SourceControlBMPAttributeID;
     this.SourceControlBMPAttribute   = sourceControlBMPAttribute;
     sourceControlBMPAttribute.SourceControlBMPs.Add(this);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public WaterQualityManagementPlanParcel(WaterQualityManagementPlan waterQualityManagementPlan, Parcel parcel) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.WaterQualityManagementPlanParcelID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.WaterQualityManagementPlanID       = waterQualityManagementPlan.WaterQualityManagementPlanID;
     this.WaterQualityManagementPlan         = waterQualityManagementPlan;
     waterQualityManagementPlan.WaterQualityManagementPlanParcels.Add(this);
     this.ParcelID = parcel.ParcelID;
     this.Parcel   = parcel;
     parcel.WaterQualityManagementPlanParcels.Add(this);
 }
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 WaterQualityManagementPlanDocument(WaterQualityManagementPlan waterQualityManagementPlan, FileResource fileResource, string displayName, DateTime uploadDate, WaterQualityManagementPlanDocumentType waterQualityManagementPlanDocumentType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.WaterQualityManagementPlanDocumentID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.WaterQualityManagementPlanID         = waterQualityManagementPlan.WaterQualityManagementPlanID;
     this.WaterQualityManagementPlan           = waterQualityManagementPlan;
     waterQualityManagementPlan.WaterQualityManagementPlanDocuments.Add(this);
     this.FileResourceID = fileResource.FileResourceID;
     this.FileResource   = fileResource;
     fileResource.WaterQualityManagementPlanDocuments.Add(this);
     this.DisplayName = displayName;
     this.UploadDate  = uploadDate;
     this.WaterQualityManagementPlanDocumentTypeID = waterQualityManagementPlanDocumentType.WaterQualityManagementPlanDocumentTypeID;
 }
Ejemplo n.º 5
0
 // technically this isn't "fully" parameteried, it's just "parameterized enough to have results", which is basically the same damn thing.
 public static bool IsFullyParameterized(this WaterQualityManagementPlan waterQualityManagementPlan)
 {
     if (waterQualityManagementPlan.WaterQualityManagementPlanModelingApproachID ==
         WaterQualityManagementPlanModelingApproach.Detailed.WaterQualityManagementPlanModelingApproachID)
     {
         return(waterQualityManagementPlan.TreatmentBMPs.Any() &&
                waterQualityManagementPlan.TreatmentBMPs.Any(x => x.IsFullyParameterized()));
     }
     else
     {
         return(waterQualityManagementPlan.QuickBMPs.Any() &&
                waterQualityManagementPlan.QuickBMPs.Any(x => x.IsFullyParameterized()));
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public WaterQualityManagementPlanVerify(WaterQualityManagementPlan waterQualityManagementPlan, WaterQualityManagementPlanVerifyType waterQualityManagementPlanVerifyType, WaterQualityManagementPlanVisitStatus waterQualityManagementPlanVisitStatus, Person lastEditedByPerson, DateTime lastEditedDate, bool isDraft, DateTime verificationDate) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.WaterQualityManagementPlanVerifyID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.WaterQualityManagementPlanID       = waterQualityManagementPlan.WaterQualityManagementPlanID;
     this.WaterQualityManagementPlan         = waterQualityManagementPlan;
     waterQualityManagementPlan.WaterQualityManagementPlanVerifies.Add(this);
     this.WaterQualityManagementPlanVerifyTypeID = waterQualityManagementPlanVerifyType.WaterQualityManagementPlanVerifyTypeID;
     this.WaterQualityManagementPlanVerifyType   = waterQualityManagementPlanVerifyType;
     waterQualityManagementPlanVerifyType.WaterQualityManagementPlanVerifies.Add(this);
     this.WaterQualityManagementPlanVisitStatusID = waterQualityManagementPlanVisitStatus.WaterQualityManagementPlanVisitStatusID;
     this.WaterQualityManagementPlanVisitStatus   = waterQualityManagementPlanVisitStatus;
     waterQualityManagementPlanVisitStatus.WaterQualityManagementPlanVerifies.Add(this);
     this.LastEditedByPersonID = lastEditedByPerson.PersonID;
     this.LastEditedByPerson   = lastEditedByPerson;
     lastEditedByPerson.WaterQualityManagementPlanVerifiesWhereYouAreTheLastEditedByPerson.Add(this);
     this.LastEditedDate   = lastEditedDate;
     this.IsDraft          = isDraft;
     this.VerificationDate = verificationDate;
 }
 public ModeledPerformanceResultSimple(WaterQualityManagementPlan waterQualityManagementPlan)
 {
     IsWQMPResult = true;
     if (waterQualityManagementPlan.WaterQualityManagementPlanModelingApproachID ==
         WaterQualityManagementPlanModelingApproach.Detailed.WaterQualityManagementPlanModelingApproachID)
     {
         IsSimplifiedWQMPResult = false;
         var nereidResults = ExtractResults(waterQualityManagementPlan.TreatmentBMPs.ToList().Where(x => x.Delineation?.IsVerified ?? false).ToList(), out var lastDeltaQueue);
         SetDatesAndScalarValues(nereidResults, lastDeltaQueue);
     }
     else
     {
         IsSimplifiedWQMPResult = true;
         var nereidResults = HttpRequestStorage.DatabaseEntities.NereidResults.Where(x =>
                                                                                     x.WaterQualityManagementPlanID == waterQualityManagementPlan.WaterQualityManagementPlanID && !x.IsBaselineCondition);
         var lastDeltaQueue = HttpRequestStorage.DatabaseEntities.DirtyModelNodes.FirstOrDefault(x =>
                                                                                                 x.WaterQualityManagementPlanID == waterQualityManagementPlan.WaterQualityManagementPlanID)?.CreateDate;
         SetDatesAndScalarValues(nereidResults.ToList(), lastDeltaQueue);
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static SourceControlBMP CreateNewBlank(WaterQualityManagementPlan waterQualityManagementPlan, SourceControlBMPAttribute sourceControlBMPAttribute)
 {
     return(new SourceControlBMP(waterQualityManagementPlan, sourceControlBMPAttribute));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static WaterQualityManagementPlanVerify CreateNewBlank(WaterQualityManagementPlan waterQualityManagementPlan, WaterQualityManagementPlanVerifyType waterQualityManagementPlanVerifyType, WaterQualityManagementPlanVisitStatus waterQualityManagementPlanVisitStatus, Person lastEditedByPerson)
 {
     return(new WaterQualityManagementPlanVerify(waterQualityManagementPlan, waterQualityManagementPlanVerifyType, waterQualityManagementPlanVisitStatus, lastEditedByPerson, default(DateTime), default(bool), default(DateTime)));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static WaterQualityManagementPlanDocument CreateNewBlank(WaterQualityManagementPlan waterQualityManagementPlan, FileResource fileResource, WaterQualityManagementPlanDocumentType waterQualityManagementPlanDocumentType)
 {
     return(new WaterQualityManagementPlanDocument(waterQualityManagementPlan, fileResource, default(string), default(DateTime), waterQualityManagementPlanDocumentType));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static WaterQualityManagementPlanParcel CreateNewBlank(WaterQualityManagementPlan waterQualityManagementPlan, Parcel parcel)
 {
     return(new WaterQualityManagementPlanParcel(waterQualityManagementPlan, parcel));
 }
Ejemplo n.º 12
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)));
 }
 public static void DeleteWaterQualityManagementPlan(this IQueryable <WaterQualityManagementPlan> waterQualityManagementPlans, WaterQualityManagementPlan waterQualityManagementPlanToDelete)
 {
     DeleteWaterQualityManagementPlan(waterQualityManagementPlans, new List <WaterQualityManagementPlan> {
         waterQualityManagementPlanToDelete
     });
 }