Esempio n. 1
0
        private void switchToUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormUserInterface userForm = new FormUserInterface(AdminID);

            userForm.Show();
            this.Hide();
        }
Esempio n. 2
0
        private void switchToUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormUserInterface userForm = new FormUserInterface(AdminID);

            userForm.ShowDialog();
            this.Close();
            userForm.FormClosed += new FormClosedEventHandler(UserForm_FormClosed);
        }
Esempio n. 3
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;
            }
        }
Esempio n. 4
0
        // potrebne dorobit na sposob, ktorym by sa dalo ziskat user id
        private void switchToUserToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            FormUserInterface userForm = new FormUserInterface("1");

            userForm.Show();
        }