Beispiel #1
0
        private void lblHome_Click(object sender, EventArgs e)
        {
            AdminHomeForm home = new AdminHomeForm(userTable);

            home.Show();
            this.Hide();
        }
Beispiel #2
0
        // validates user credentials and routes to appropriate home page
        private void LoginFormLoginButton_Click(object sender, EventArgs e)
        {
            UserClass ucUser = BusinessLogicClass.QueryDatabaseForUser(LoginFormUserTextBox.Text, LoginFormPassTextBox.Text);

            if (ucUser != null)
            {
                switch (ucUser.m_chrUserType[0])
                {
                case 'A':     // route to admin home
                    AdminHomeForm oAdminHomeForm = new AdminHomeForm(LoginFormUserTextBox.Text, LoginFormPassTextBox.Text);
                    oAdminHomeForm.Show();
                    this.Visible            = false;
                    childSignUpForm.Visible = false;
                    break;

                case 'P':     // route to patient home
                    PatientHomeForm oCustomerHomeForm = new PatientHomeForm(LoginFormUserTextBox.Text, LoginFormPassTextBox.Text);
                    oCustomerHomeForm.Show();
                    this.Visible            = false;
                    childSignUpForm.Visible = false;
                    break;

                case 'D':     // route to dentist home
                    DoctorHomeForm oDoctorHomeForm = new DoctorHomeForm(LoginFormUserTextBox.Text, LoginFormPassTextBox.Text);
                    oDoctorHomeForm.Show();
                    this.Visible            = false;
                    childSignUpForm.Visible = false;
                    break;

                case 'H':     // route to hygeinist home
                    HygienistHomeForm oHygenistHomeForm = new HygienistHomeForm(LoginFormUserTextBox.Text, LoginFormPassTextBox.Text);
                    oHygenistHomeForm.Show();
                    this.Visible            = false;
                    childSignUpForm.Visible = false;
                    break;

                default:
                    LoginFormErrorLabel.Visible = true;
                    break;
                }
            }
            else
            {
                DisplayError();
            }
        }