예제 #1
0
        /// </summary>
        /// Load the main applicaiton. If the database was present and the tables existed, create the main application with a valid database connection.
        /// <summary>
        public void loadMainThread()
        {
            if (CurrentAppStatus == LoadStatus.Complete)
            {
                if (!settingsCreated)
                {
                    try
                    {
                        // Load the report settings
                        reportSettings.Load();

                        // Get the updated report settings after loading
                        reportSettings = Settings.ReportSettings.Instance;

                        // Run the Main application
                        Application.Run(new KPA_KPI_UI(reportSettings));
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
                else
                {
                    // Run the main application
                    Application.Run(new KPA_KPI_UI());
                }
            }
        }
예제 #2
0
        /// <summary>
        /// The custom constructor of the main user interface. This constructor takes a database conenection that will be used
        /// to connect to and read data from.
        /// </summary>
        /// <param name="conn">The database connection that was established in the splash screen.</param>
        public KPA_KPI_UI(Settings.ReportSettings settingsData)
        {
            InitializeComponent();

            // Set the settings file for the application.
            reportSettings = settingsData;
        }