Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            AdminPanel ob = new AdminPanel();

            this.Hide();
            ob.ShowDialog();
            this.Close();
        }
Ejemplo n.º 2
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            string userType = typeComboBox.SelectedItem.ToString();
            int    id       = Convert.ToInt32(((UpDownBase)numericUpDownId).Text);
            string password = textBoxPassword.Text;



            LoginDAO loginDAO     = new LoginDAO();
            bool     verification = loginDAO.verifyLogin(new LoginDTO(userType, id, password));

            // MessageBox.Show(""+verification);

            if (verification == true)
            {
                //MessageBox.Show("Ok");
                if (userType == "ADMIN")
                {
                    AdminPanel adminPanel = new AdminPanel();
                    this.Hide();
                    adminPanel.ShowDialog();
                    this.Close();
                }
                else if (userType == "MEMBER")
                {
                    MemberPanel memberPanel = new MemberPanel(id);
                    this.Hide();
                    memberPanel.ShowDialog();
                    this.Close();
                }
                else if (userType == "EMPLOYEE")
                {
                    EmployeePanel employeePanel = new EmployeePanel(id);
                    this.Hide();
                    employeePanel.ShowDialog();
                    this.Close();
                }
            }
            else if (verification == false)
            {
                MessageBox.Show("Login failed");
            }
        }