Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            name = textBox1.Text;
            pass = Encrypt(textBox3.Text);


            if (LogIn_user(name, pass))
            {
                if (IsStaff(name, pass))
                {
                    ChooseMovie chooseMovie = new ChooseMovie(name);
                    chooseMovie.ShowDialog();
                    this.Close();
                }
                else if (IsManager(name, pass))
                {
                    AdminPanel adminPanel = new AdminPanel();
                    adminPanel.ShowDialog();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Something wrong.");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            AdminPanel adminPanel = new AdminPanel();

            adminPanel.ShowDialog();
            this.Close();
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            name  = textBox1.Text;
            email = textBox2.Text;
            if (IsValidEmail(email))
            {
                if (textBox3.Text == textBox4.Text)
                {
                    pass = Encrypt(textBox3.Text);
                    if (radioButton1.Checked)
                    {
                        employee_type = radioButton1.Text;
                    }
                    else if (radioButton2.Checked)
                    {
                        employee_type = radioButton2.Text;
                    }

                    if (Register_user(name, email, pass, employee_type))
                    {
                        if (IsManager(name, pass))
                        {
                            AdminPanel adminPanel = new AdminPanel();
                            adminPanel.ShowDialog();
                            this.Close();
                        }
                        else if (IsStaff(name, pass))
                        {
                            ChooseMovie chooseMovie = new ChooseMovie(name);
                            chooseMovie.ShowDialog();
                            this.Close();
                        }
                    }
                    else
                    {
                        MessageBox.Show($"{name} has not been created.");
                    }
                }
                else if (textBox3.Text != textBox4.Text)
                {
                    MessageBox.Show("Password Doesn't Match");
                }
            }
            else
            {
                MessageBox.Show("Wrong Email Format");
            }
        }