예제 #1
0
        private void buttonLogIn_Click(object sender, EventArgs e)
        {
            string user     = textBoxUsername.Text;
            string password = textBoxPassword.Text;
            var    userDTO  = uc.logIn(user, password);

            if (userDTO != null)
            {
                if (!userDTO.Admin)
                {
                    Landing l = new Landing(uc, userDTO);
                    l.Show();
                    this.Hide();
                }
                else
                {
                    LandingAdmin l = new LandingAdmin(uc, userDTO);
                    l.Show();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Invalid credentials");
            }
        }
예제 #2
0
        private void buttonSwitch_Click(object sender, EventArgs e)
        {
            LandingAdmin window = new LandingAdmin(this.ctrl, this.user);

            window.Show();
            this.Close();
        }