Пример #1
0
        private void authButton_Click(object sender, EventArgs e)
        {
            String login = loginTextBox.Text;
            String pass  = passTextBox.Text;
            User   user  = null;

            if (login.Equals("admin"))
            {
                user          = new Admin();
                user.login    = login;
                user.password = pass;
            }
            else
            {
                user          = new Manager();
                user.login    = login;
                user.password = pass;
            }
            if (db.authorisation(login, pass, user) != null)
            {
                user = db.authorisation(login, pass, user);
                new RentCar(user).Show();
                db.close();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Error! Not correct data");
                loginTextBox.Text = "";
                passTextBox.Text  = "";
            }
        }
Пример #2
0
 private void closeButton_Click(object sender, EventArgs e)
 {
     db.close();
     Environment.Exit(0);
 }