Example #1
0
        public VegSampleDTO(CompoundIdentity siteId, DateTime when, Point2 <double> location, float minElev, float maxElev)
        {
            MethodContract.Assert(!siteId.IsNullOrEmpty() || location != null, "siteId | location");
            when = VegUtils.FixDate(when);
            MethodContract.Assert(DateTime.UtcNow >= when, nameof(when));

            this.SiteId         = siteId;
            this.When           = when;
            this.Location       = location;
            this.ElevationRange = VegUtils.Create(minElev, maxElev);
        }
Example #2
0
        public VegSample(Guid id, CompoundIdentity vegSurveyId, CompoundIdentity siteId, DateTime when, Point2 <double> location, float minElevation, float maxElevation)
        {
            MethodContract.Assert(!Guid.Empty.Equals(id), nameof(id));
            MethodContract.NotNullOrEmpty(vegSurveyId, nameof(vegSurveyId));
            MethodContract.Assert(!siteId.IsNullOrEmpty() || location != null, "siteId | location");
            MethodContract.Assert(DateTime.UtcNow > when.ToUniversalTime(), nameof(when));

            this.Identity       = id;
            this.VegSurveyId    = vegSurveyId;
            this.SiteId         = siteId;
            this.When           = when;
            this.Location       = location;
            this.ElevationRange = VegUtils.Create(minElevation, maxElevation);
        }
Example #3
0
        public VegSurvey(CompoundIdentity id, CompoundIdentity sampleEventId, CompoundIdentity siteId, CompoundIdentity plotTypeId, Point2 <double> location, float area, float minElev, float maxElev, string description, bool isPrivate)
        {
            MethodContract.NotNullOrEmpty(id, nameof(id));
            MethodContract.NotNullOrEmpty(sampleEventId, nameof(sampleEventId));
            MethodContract.NotNullOrEmpty(siteId, nameof(siteId));
            MethodContract.NotNullOrEmpty(plotTypeId, nameof(plotTypeId));

            this.Identity       = id;
            this.sampleEventId  = sampleEventId;
            this.siteId         = siteId;
            this.plotTypeId     = plotTypeId;
            this.Location       = location;
            this.Area           = area;
            this.ElevationRange = VegUtils.Create(minElev, maxElev);
            this.Description    = description;
            this.IsPrivate      = isPrivate;
        }