Ejemplo n.º 1
0
        private void barButtonItemCauHinhKetNoi_ItemClick(object sender, ItemClickEventArgs e)
        {
            CloseAll_TabPages();
            var frm = new FrmAddConnection();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                MsgboxUtil.Success("Đã lưu cấu hình của chương trình!");
                //  + "\nChương trình sẽ khởi động lại để cập nhật dữ liệu!");
                // Application.Restart();
            }
        }
        protected ConnectData()
        {
            _strConnect = Settings.Default.ConnectString;
            // Nếu không kết nối được
            if (!FrmAddConnection.TestConnect())
            {
                if (FrmAddConnection.Show() == DialogResult.OK)
                    _strConnect = Settings.Default.ConnectString;
                else
                    Environment.Exit(1);
            }

            Connect();
        }