Пример #1
0
 private DateRange(DateTime?start, DateTime?end)
 {
     if (start.HasValue)
     {
         this.StartDate = WQUtils.FixDate(start.Value);
     }
     if (end.HasValue)
     {
         this.EndDate = WQUtils.FixDate(end.Value);
     }
 }
Пример #2
0
        public WaterQualityMeasurementDTO(DateTime sampleDate, double?surfaceElevation, double?temperature, double?ph, double?dissolvedOxygen, double?conductivity, double?salinity, double?velocity)
        {
            MethodContract.Assert(sampleDate <DateTime.UtcNow && sampleDate> WQUtils.GlobalMinDate, nameof(sampleDate));
            MethodContract.Assert(surfaceElevation.HasValue || temperature.HasValue || ph.HasValue || dissolvedOxygen.HasValue || conductivity.HasValue || salinity.HasValue || velocity.HasValue, "values");

            this.SampleDate       = WQUtils.FixDate(sampleDate);
            this.SurfaceElevation = surfaceElevation;
            this.Temperature      = temperature;
            this.pH = ph;
            this.DissolvedOxygen = dissolvedOxygen;
            this.Conductivity    = conductivity;
            this.Salinity        = salinity;
            this.Velocity        = velocity;
        }