private void Window_Closed(object sender, EventArgs e) // pressing close button takes us back to student main window.
        {
            this.Close();
            Admin_Main_Page adminMainWindowobj = new Admin_Main_Page(txtUserName.Text);

            adminMainWindowobj.Show();
        }
Esempio n. 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            Admin_Main_Page form = new Admin_Main_Page(txtUserName.Text);

            form.Show();
        }
        private void btnHome_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            Admin_Main_Page frm2 = new Admin_Main_Page(txtUserName.Text);

            frm2.Show();
        }
Esempio n. 4
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     try
     {
         User guest = new User();
         guest.UserID   = txtUserName.Text.ToString();
         guest.Password = txtPassword.Password.ToString();
         AdminBL adminBL = new AdminBL();
         string  role    = adminBL.Login(guest);
         if (string.IsNullOrEmpty(role))
         {
             MessageBox.Show("Login Unsuccessfull....");
         }
         else
         {
             MessageBox.Show("Login Successful....");
             if (role.Equals("admin"))
             {
                 Admin_Main_Page adminHomePage = new Admin_Main_Page(txtUserName.Text);
                 adminHomePage.Show();
             }
             else if (role.Equals("teacher"))
             {
                 HomePage homePage = new HomePage(txtUserName.Text);
                 homePage.Show();
             }
             else if (role.Equals("student"))
             {
                 StudentMainWindow studentMainWindow = new StudentMainWindow(txtUserName.Text);
                 studentMainWindow.Show();
             }
             else
             {
                 MessageBox.Show("Failed to Login!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
             }
             this.Hide();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }