Ejemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (UserService.isLoginCorrect(txtUsername.Text, txtPassword.Text))
            {
                SessionManager.ActiveUser = UserService.FindByUsername(txtUsername.Text);
                SessionManager.SetInfo();

                if (SessionManager.CurrentUserRole == Role.Admin)
                {
                    AdminPanel adminpanel = new AdminPanel(this);
                    adminpanel.Show();
                }
                else
                {
                    UserPanel userpanel = new UserPanel(this);
                    userpanel.Show();
                }
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı adı veya şifre hatalı!");
            }
        }
Ejemplo n.º 2
0
 private void BuyProduct_FormClosing(object sender, FormClosingEventArgs e)
 {
     lastform.Show();
 }