/// <summary>
        /// Returns the singleton instance - warning, this is not thread safe
        /// </summary>
        /// <returns></returns>
        public static StaticDataManager GetStaticDataManager()
        {
            if (_instance == null)
            {
                _instance = new StaticDataManager();
            }

            return(_instance);
        }
Example #2
0
        /// <summary>
        ///     Verifying if it is possible to connect with given username and password; otherwise throw exception
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public bool Connect(string User, string Pass)
        {
            var connName   = _dataBaseCombo.SelectionBoxItem.ToString();
            var connString = GetConfig(connName, User, Pass);

            try
            {
                var con = new MySqlConnection(connString);
                con.Open();

                var staticDataMgr = StaticDataManager.GetStaticDataManager();
                staticDataMgr.DBConnection = con;

                return(true);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
                return(false);
            }
        }
Example #3
0
 public Interest_rate()
 {
     InitializeComponent();
     _db = StaticDataManager.GetStaticDataManager().DBConnection;
 }
Example #4
0
 public Bond()
 {
     InitializeComponent();
     _db = StaticDataManager.GetStaticDataManager().DBConnection;
 }
Example #5
0
 public After_login()
 {
     InitializeComponent();
     _db = StaticDataManager.GetStaticDataManager().DBConnection;
 }
Example #6
0
 public FX()
 {
     InitializeComponent();
     _db = StaticDataManager.GetStaticDataManager().DBConnection;
     GetData();
 }