Пример #1
0
 private void PWD_MotDePasse_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         BTN_Connexion.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
     }
 }
Пример #2
0
        private void SeConnecter()
        {
            try
            {
                string dsource = "(DESCRIPTION="
                                 + "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)"
                                 + "(HOST=mercure.clg.qc.ca)(PORT=1521)))"
                                 + "(CONNECT_DATA=(SERVICE_NAME=ORCL.clg.qc.ca)))";

                // Déclaration de la chaine de connection //
                string ChaineDeConnection = "Data Source = " + dsource + "; User Id = Bertrand; password = ORACLE1";
                mOracleConnection.ConnectionString = ChaineDeConnection;
                mOracleConnection.Open();

                BTN_Connexion.Hide();

                FBTN_Etoiles.Enabled          = true;
                DGV_Monuments.Enabled         = true;
                FBTN_Ville.Enabled            = true;
                CBB_Monument.Enabled          = true;
                FBTN_Prix.Enabled             = true;
                FBTN_AfficherMonument.Enabled = true;
                FBTN_AfficherCircuit.Enabled  = true;
                FBTN_MeilleurCircuit.Enabled  = true;
                EstConnect = true;
                mDB_Images = new DB_Images("BaboucheQc", "9952");
            }
            catch (Exception sqlmOracleConnection)
            {
                MessageBox.Show(sqlmOracleConnection.Message.ToString());
            }

            RemplirCBB_Monument();
        }