Пример #1
0
        /// <summary>
        /// Instantiates a new Version object the supplied values
        /// </summary>
        /// <param name="Name">The name of the verison</param>
        /// <param name="Description">A description of the version</param>
        /// <param name="Version">The version number. This must be greater the latest version stored in the GroundFrame.SQL database</param>
        /// <param name="SQLConnector">A Connector to the GroundFrame.SQL Database</param>
        public Version(string Name, string Description, Decimal Version, GFSqlConnector SQLConnector)
        {
            CultureInfo culture = Globals.UserSettings.GetCultureInfo();

            //Validate Arguments
            ArgumentValidation.ValidateName(Name, culture);
            ArgumentValidation.ValidateSQLConnector(SQLConnector, culture);

            this._SQLConnector = new GFSqlConnector(SQLConnector); //Creates a copy of the object to prevent conflict with connectios, commands and readers
            this.Name          = Name;
            this.Description   = Description;
            this.VersionFrom   = Version;
            this.VersionTo     = null;
            this.Status        = VersionStatus.Development;
        }
Пример #2
0
        /// <summary>
        /// Instantiates a new Simulation object from the supplied arguements
        /// </summary>
        /// <param name="Name">The simulation name. This cannot be altered once set</param>
        /// <param name="Description">A description of the simulation</param>
        /// <param name="SimSigWikiLink">The URL to the simulation manula on the SimSig wiki</param>
        /// <param name="SimSigCode">The SimSig code for the simulation. This cannot be altered once set</param>
        /// <param name="SQLConnector">The GFSqlConnector to the GroundFrame.SQL database</param>
        public Simulation(string Name, string Description, string SimSigWikiLink, string SimSigCode, GFSqlConnector SQLConnector)
        {
            CultureInfo culture = Globals.UserSettings.GetCultureInfo();

            //Validate arguments
            ArgumentValidation.ValidateName(Name, culture);
            ArgumentValidation.ValidateSimSigCode(SimSigCode, culture);
            ArgumentValidation.ValidateSQLConnector(SQLConnector, culture);


            this._ID            = 0;
            this._Name          = Name;
            this.Description    = Description;
            this.SimSigWikiLink = SimSigWikiLink;
            this._SimSigCode    = SimSigCode;
            this._SQLConnector  = new GFSqlConnector(SQLConnector); //Instantiates a new copy of the SQLConnector object to stop conflicts between Connections, Commands and Readers
        }
Пример #3
0
        /// <summary>
        /// Instantiates a new Location object from the supplied arguements
        /// </summary>
        /// <param name="Simulation">The location to which the location belongs</param>
        /// <param name="Name">The location name</param>
        /// <param name="TIPLOC">The TIPLOC code for the location.</param>
        /// <param name="SimSigCode">The SimSig code for the location.</param>
        /// <param name="EntryPoint">Indicates whether the location is an entry point for the location</param>
        /// <param name="LocationType">Indicates the type of location</param>
        /// <param name="SQLConnector">The GFSqlConnector to the GroundFrame.SQL database</param>
        public Location(Simulation Simulation, string Name, string TIPLOC, string SimSigCode, bool EntryPoint, SimSigLocationType LocationType, GFSqlConnector SQLConnector)
        {
            CultureInfo Culture = Globals.UserSettings.GetCultureInfo();

            //Check Arguments
            ArgumentValidation.ValidateName(Name, Culture);
            ArgumentValidation.ValidateSimSigCode(SimSigCode, Culture, 16);
            ArgumentValidation.ValidateSQLConnector(SQLConnector, Culture);
            ArgumentValidation.ValidateSimulation(Simulation, Culture);

            if (Simulation.ID == 0)
            {
                throw new ArgumentException(ExceptionHelper.GetStaticException("CreateLocationUnsavedSimError", null, Culture));
            }

            this._ID           = 0;
            this._SimID        = Simulation.ID;
            this._Name         = Name;
            this.SimSigCode    = SimSigCode;
            this._SQLConnector = new GFSqlConnector(SQLConnector); //Instantiates a new copy of the SQLConnector object to stop conflicts between Connections, Commands and Readers
            this.TIPLOC        = TIPLOC;
            this.EntryPoint    = EntryPoint;
            this.LocationType  = LocationType;
        }