protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
     modelBuilder.HasDefaultSchema("efcore");
     MemberConfiguration.Configure(modelBuilder.Entity <Member>());
     FacilityConfiguration.Configure(modelBuilder.Entity <Facility>());
     BookingConfiguration.Configure(modelBuilder.Entity <Booking>());
     base.OnModelCreating(modelBuilder);
 }
예제 #2
0
        /// <summary>
        /// Constructs a new Facility object of the specified Type and Configuration, located within
        /// the specified Catchment
        /// </summary>
        /// <param name="type">The type of facility</param>
        /// <param name="configuration">The plumbed facility configuration</param>
        /// <param name="catchment">The Catchment containing the facility</param>
        public Facility(FacilityType type, FacilityConfiguration configuration, Catchment catchment)
        {
            _type          = type;
            _configuration = configuration;
            _catchment     = catchment;

            ConfigureFacility();
        }
예제 #3
0
        private void ShowSlopedFacilityWS()
        {
            double                storageDepth2        = Convert.ToDouble(txtStorageDepth2.Text);
            double                storageDepth3        = Convert.ToDouble(txtStorageDepth3.Text);
            double                growingMediumDepth   = Convert.ToDouble(txtGrowingMediumDepth.Text);
            double                freeboardDepth       = Convert.ToDouble(txtFreeboardDepth.Text);
            double                rockStorageDepth     = Convert.ToDouble(txtRockStorageDepth.Text);
            double                rockStorageVoidRatio = Convert.ToDouble(txtRockVoidRatio.Text);
            FacilityShape         shape  = GetFacilityShape(cmbFacilityShape.Text);
            FacilityConfiguration config = (FacilityConfiguration)cmbFacilityConfiguration.Text[0];
            FacilityType          type   = GetFacilityType(cmbFacilityType.Text);

            List <SlopedFacilitySegment> segments = new List <SlopedFacilitySegment>();

            SlopedFacility facility = new SlopedFacility(type, config, new Catchment("test catchment"), segments)
            {
                StorageDepth2In      = storageDepth2,
                StorageDepth3In      = storageDepth3,
                GrowingMediumDepthIn = growingMediumDepth,
                FreeboardIn          = freeboardDepth,
                RockStorageDepthIn   = rockStorageDepth,
                RockVoidRatio        = rockStorageVoidRatio,
                Shape = shape
            };

            if (_sfws == null || _sfws.Disposing)
            {
                _sfws = new SlopedFacilityWorksheet(facility);
            }
            else
            {
                facility.Segments = _sfws.Segments; // connect new facility object to existing segments.
                _sfws.Facility    = facility;       // change worksheet object to new facility object.
            }


            try
            {
                _sfws.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #4
0
 /// <summary>
 /// Constructor for a sloped facility
 /// </summary>
 /// <param name="type">The FacilityType; should be Swale or SlopedPlanter</param>
 /// <param name="configuration">The Configuration of the facility</param>
 /// <param name="catchment">The catchment for the facility</param>
 /// <param name="segments">A list of Segments to load the facility with</param>
 public SlopedFacility(FacilityType type, FacilityConfiguration configuration, Catchment catchment, List<SlopedFacilitySegment> segments)
     : base(type, configuration, catchment)
 {
     _segments = segments;
       SlopedFacility._this = this;
 }
예제 #5
0
        /// <summary>
        /// Constructs a new Facility object of the specified Type and Configuration, located within
        /// the specified Catchment
        /// </summary>
        /// <param name="type">The type of facility</param>
        /// <param name="configuration">The plumbed facility configuration</param>
        /// <param name="catchment">The Catchment containing the facility</param>
        public Facility(FacilityType type, FacilityConfiguration configuration, Catchment catchment)
        {
            _type = type;
              _configuration = configuration;
              _catchment = catchment;

              ConfigureFacility();
        }
예제 #6
0
 /// <summary>
 /// Constructor for a sloped facility
 /// </summary>
 /// <param name="type">The FacilityType; should be Swale or SlopedPlanter</param>
 /// <param name="configuration">The Configuration of the facility</param>
 /// <param name="catchment">The catchment for the facility</param>
 /// <param name="segments">A list of Segments to load the facility with</param>
 public SlopedFacility(FacilityType type, FacilityConfiguration configuration, Catchment catchment, List <SlopedFacilitySegment> segments)
     : base(type, configuration, catchment)
 {
     _segments            = segments;
     SlopedFacility._this = this;
 }