Exemplo n.º 1
0
        private void back_btn_Click(object sender, RoutedEventArgs e)
        {
            adminPanel a = new adminPanel();

            this.Hide();
            a.Show();
        }
Exemplo n.º 2
0
        private void loginHandler_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.txt_username.Text) || string.IsNullOrWhiteSpace(this.txt_password.Password.ToString()))
            {
                if (string.IsNullOrWhiteSpace(this.txt_username.Text))
                {
                    txt_username.Background = Brushes.Red;
                }
                if (string.IsNullOrWhiteSpace(this.txt_password.Password.ToString()))
                {
                    txt_password.Background = Brushes.Red;
                }
                MessageBox.Show("Validate");

                return;
            }
            loginBLL aBLL = new loginBLL();
            loginBO  lBO  = new loginBO();

            lBO.Username = this.txt_username.Text;
            lBO.Password = this.txt_password.Password.ToString();
            int rv;

            rv = aBLL.login(lBO);

            if (rv == 1)
            {
                //MessageBox.Show("Loged in");
                //this.Show(adminPanel.x);
                adminPanel a = new adminPanel();
                this.Hide();
                a.Show();
            }
            else if (rv == 2)
            {
                //MessageBox.Show("User Panael");
                global.user = this.txt_username.Text;
                userPanel u = new userPanel();
                this.Hide();
                u.Show();
            }
            else if (rv == 3)
            {
                MessageBox.Show("User Do Not Exist");
            }
            else if (rv == 4)
            {
                MessageBox.Show("Invalid Username/Password");
            }
        }