コード例 #1
0
ファイル: frmMain.cs プロジェクト: BGCX067/ez-soft-svn-to-git
        public frmLoginServer showKetNoiCSDL()
        {
            frmLoginServer F = new frmLoginServer();

            F.ShowDialog();
            F.Activate();
            return(null);
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: BGCX067/ez-soft-svn-to-git
 private void frmMain_Load(object sender, EventArgs e)
 {
     try
     {
         clsConnection.ReadKeys();
         if (clsConnection.ServerName == null || clsConnection.Databasename == null || clsConnection.LoginName == null || clsConnection.LoginPassword == null)
         {
             frmLoginServer F = new frmLoginServer();
             F.ShowDialog();
             if (frmLoginServer.isConnect == false)
             {
                 Application.Exit();
             }
             else
             {
                 DangNhapHeThong();
             }
         }
         else
         {
             if (clsConnection.IsCheckConnect(clsConnection.ServerName, clsConnection.Databasename, clsConnection.LoginName, clsConnection.LoginPassword) == false)
             {
                 frmLoginServer F = new frmLoginServer();
                 F.ShowDialog();
                 if (frmLoginServer.isConnect == false)
                 {
                     Application.Exit();
                 }
                 else
                 {
                     DangNhapHeThong();
                 }
             }
             else
             {
                 DangNhapHeThong();
             }
         }
     }
     catch (Exception Loi)
     {
         MessageBox.Show("Lỗi kết nối cơ sở dữ liệu", "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }