Exemple #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            prograsbarLogin.Value = 50;

            Connector      databaseConnection = new MYSQLDatabaseConnection();
            DatabaseColumn databaseColumn     = new DatabaseColumn();

            databaseColumn.user_name = txtUserName.Text.ToString();
            databaseColumn.password  = txtPassword.Text.ToString();

            databaseConnection.SetData(databaseColumn);

            prograsbarLogin.Value = 80;

            if (databaseConnection.establish() == true)
            {
                if (databaseConnection.CheckLogin() == true)
                {
                    prograsbarLogin.Value = 100;
                    MainWindow mainWindow = new MainWindow();

                    this.Hide();
                    mainWindow.Show();
                }
                else
                {
                    prograsbarLogin.Value = 100;
                    MessageBox.Show("wrong Password!");
                }
            }
            else
            {
                ServerConfiguration serverConfiguration = new ServerConfiguration();
                serverConfiguration.Show();
            }
        }