Пример #1
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            if (metroComboBox1.Text == "Admin")
            {
                AdminData ad = new AdminData();

                if (ad.checkAdmin(metroTextBox1.Text, metroTextBox2.Text) == true)
                {
                    adminForm af = new adminForm(metroTextBox1.Text);
                    af.Show(this);
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Check ID and Password again.", "Error");
                }
            }
            if (metroComboBox1.Text == "Manager")
            {
                ManagerData md = new ManagerData();

                if (md.checkManager(metroTextBox1.Text, metroTextBox2.Text) == true)
                {
                    managerForm mf = new managerForm(metroTextBox1.Text);
                    mf.Show(this);
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Check ID and Password again.", "Error");
                }
            }
            if (metroComboBox1.Text == "Employee")
            {
                EmployeeData ed = new EmployeeData();

                if (ed.checkEmployee(metroTextBox1.Text, metroTextBox2.Text) == true)
                {
                    employeeForm ef = new employeeForm(metroTextBox1.Text);
                    ef.Show(this);
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Check ID and Password again.", "Error");
                }
            }
            if (metroComboBox1.Text == "")
            {
                MessageBox.Show("Please Select An User Type", "Error");
            }
        }
Пример #2
0
        private void bunifuThinButton21_Click(object sender, EventArgs e)
        {
            if (metroComboBox1.Text == "Admin")
            {
                AdminData ad = new AdminData();

                if (ad.checkAdmin(metroTextBox1.Text, metroTextBox2.Text) == true)
                {
                    adminForm af = new adminForm(metroTextBox1.Text);


                    af.Show(this);


                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Check ID and Password again.", "Error");
                }
            }



            else if (metroComboBox1.Text == "Manager")
            {
                ManagerData md = new ManagerData();

                if (md.checkManager(metroTextBox1.Text, metroTextBox2.Text) == true)
                {
                    ManagerForm mf = new ManagerForm(metroTextBox1.Text);
                    mf.Show(this);
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Check ID and Password again.", "Error");
                }
            }
        }