예제 #1
0
        private void Login_Btn_Click(object sender, EventArgs e)
        {
            LoginRepo lr       = new LoginRepo();
            string    id       = UserTB.Text;
            string    password = PassTB.Text;

            Login l = lr.GetUser(id, password);

            if (l != null)
            {
                if (l.Role == 0)
                { //MessageBox.Show("Valid");
                    AdminHomepage hp = new AdminHomepage(l);
                    this.Visible = false;
                    hp.Visible   = true;
                }
                if (l.Role == 1)
                {
                    EmployeeHomepage ep = new EmployeeHomepage();
                    this.Visible = false;
                    ep.Visible   = true;
                }
            }
            else
            {
                MessageBox.Show("Invalid User");
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Login         l  = new Login();
            AdminHomepage ah = new AdminHomepage(l);

            this.Visible = false;
            ah.Visible   = true;
        }