Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            MainMenuForm form3 = new MainMenuForm();

            form3.Show(this);
            this.Hide();
        }
Exemple #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            MainMenuForm mmF = new MainMenuForm();

            mmF.Show(this);
            this.Hide();
        }
Exemple #3
0
        private void loggedin_Click(object sender, EventArgs e)     // checks if the user has given correct credentials
        {
            try
            {
                conn = new OleDbConnection(connectionstring);
                conn.Open();

                String       query = "Select id,username from login where username='******'  and password='******'";
                OleDbCommand cmd   = new OleDbCommand(query, conn);

                OleDbDataReader rdr = cmd.ExecuteReader();
                if (rdr.Read())
                {
                    current_user_id = rdr.GetValue(1).ToString();  //saves the username to the public variable current_user_id.This is now the active user
                    MainMenuForm home = new MainMenuForm();        //sends the user to the main menu of the app
                    home.Show();
                    Hide();
                }
                else
                {
                    MessageBox.Show("Δεν βρέθηκε χρήστης. Προσπαθήστε ξανά !");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Φαίνεται ότι παρουσιάστηκε κάποιο σφάλμα. Δοκιμάστε ξανά !");
            }
            finally
            {
                conn.Close();
            }
        }
Exemple #4
0
        private void guest_Click(object sender, EventArgs e) //allow the user to enter the app as a guest.
        {
            current_user_id = "guest";                       //guest is now the active user
            MainMenuForm home = new MainMenuForm();

            home.Show();
            Hide();
        }