Пример #1
0
        private void loginButtonMainForm_Click(object sender, EventArgs e)
        {
            if (userNameTextBoxMainForm.Text != string.Empty && passwordTextBoxMainForm.Text != string.Empty)
            {
                loggedInUserInfo = toAccessLogin.UserLogin(userNameTextBoxMainForm.Text, passwordTextBoxMainForm.Text, loggedInUserInfo);

                if (loggedInUserInfo.UserRole == 1)
                {
                    this.Hide();
                    AdminForm newAdminForm = new AdminForm(loggedInUserInfo);
                    newAdminForm.Show(this);
                }

                else if (loggedInUserInfo.UserRole == 2)
                {
                    this.Hide();
                    UserHomePageForm newUserHomepage = new UserHomePageForm(loggedInUserInfo);
                    newUserHomepage.Show(this);
                }
                else
                {
                    MetroMessageBox.Show(this, "Your User Name or Password was incorrect", "Try Again", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                }
            }
            else
            {
                MetroMessageBox.Show(this, "Please Fill Up All The Required Fields To Login", "Sorry", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #2
0
        private void backButtonRequestForm_Click(object sender, EventArgs e)
        {
            var UserHomepageForm = new UserHomePageForm(loggedInUserInfo);

            UserHomepageForm.Show();
            this.Close();
        }