コード例 #1
0
        private void btnRegister_Click(object sender, RoutedEventArgs e)
        {
            uname        = txtUname.Text;
            name         = txtName.Text;
            pword        = txtPword.Password;
            confirmPword = txtConfirmPword.Password;

            if (pword != confirmPword)
            {
                notification.MessageDialog(this, "Error", "Passwords do not match");
            }
            else
            {
                Administrator tempAdmin = new Administrator(uname, name, pword);
                name = controller.addAdmin(tempAdmin);

                if (name != null)
                {
                    notification.successNotifier(uname + " has Successfully Registered");

                    AdminMainDashBoard adminBoard = new AdminMainDashBoard();
                    adminBoard.status += uname;
                    this.Hide();
                    adminBoard.Show();
                }
                else
                {
                    notification.MessageDialog(this, "Error", "Username already exists");
                }
            }
        }
コード例 #2
0
        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            AdminMainDashBoard obj = new AdminMainDashBoard();

            this.Hide();
            obj.Show();
        }
コード例 #3
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            uname       = txtuname.Text;
            pword       = txtpword.Password;
            returnValue = controller.adminAuthenticator(uname, pword);

            if (returnValue != uname)
            {
                notification.errorNotifier(returnValue);
            }
            else
            {
                AdminMainDashBoard dashboard1 = new AdminMainDashBoard();
                notification.successNotifier(uname + " has Logged In Successfully");
                dashboard1.status += uname;
                this.Hide();
                dashboard1.ShowDialog();
            }
        }