Exemplo n.º 1
0
        private void homeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormAdminInterface home = new FormAdminInterface(AdminID);

            home.Show();
            this.Close();
        }
Exemplo n.º 2
0
        //primary amdin login, that will be changed later
        private void Login_Click(object sender, EventArgs e)
        {
            Connect2DB con = new Connect2DB();

            if (con.isUserRegistered(Username.Text, Password.Text))
            {
                if (con.isUserBlocked(Username.Text))
                {
                    ErrorMessage.Text    = "Your account is blocked.\nPlease contact your library.";
                    ErrorMessage.Visible = true;
                }
                else
                {
                    if (con.isUserAdmin(Username.Text) == "admin")
                    {
                        FormAdminInterface admin = new FormAdminInterface(Username.Text, Password.Text);
                        admin.Show();
                        this.Hide();
                        admin.FormClosed += new FormClosedEventHandler(Form1_FormClosed);
                    }
                    else if (con.isUserAdmin(Username.Text) == "user")
                    {
                        FormUserInterface userForm = new FormUserInterface();
                        userForm.Show();
                        this.Hide();
                        userForm.FormClosed += new FormClosedEventHandler(Form1_FormClosed);
                    }
                    else
                    {
                        ErrorMessage.Text    = "Your registration request is treated!";
                        ErrorMessage.Visible = true;
                    }
                }
            }
            else
            {
                ErrorMessage.Text    = "Invalid email or password!";
                ErrorMessage.Visible = true;
            }
        }
Exemplo n.º 3
0
        private void registrationReguestToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormAdminInterface admin = new FormAdminInterface(AdminID);

            admin.Show();
        }