private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (txtStaffID.Text == string.Empty)
                {
                    MessageBox.Show("Please enter a valid Staff ID!");
                }
                else if (Connector.CheckLogIn(txtStaffID.Text) >= 0)
                {
                    if (Connector.CheckAdminStatus(txtStaffID.Text))
                    {
                        Main adminWindow = new Main(true, Convert.ToInt32(txtStaffID.Text), Connector);
                        adminWindow.Show();
                        this.Close();
                    }
                    else
                    {
                        Main homeWindow = new Main(false, Convert.ToInt32(txtStaffID.Text), Connector);
                        homeWindow.Show();
                        this.Close();
                    }
                }
                else if (Connector.CheckLogIn(txtStaffID.Text) <= 0)
                {
                    MessageBox.Show("Unable to connect to Database. Contact your administrator.");
                }
                else
                {

                }
            } catch (NullReferenceException ex)
            {
                Console.WriteLine(ex.Message);
                MessageBox.Show("Have you entered server information?");
            }
        }
示例#2
0
 /// <summary>
 /// Constructor for the Database Management Window
 /// </summary>
 /// <param name="sourceWindow">The window from which this window was accessed</param>
 public WinDBM(Main sourceWindow)
 {
     InitializeComponent();
     this.HomeWindow = sourceWindow;
 }
示例#3
0
 private void btnNonAdmin_Click(object sender, RoutedEventArgs e)
 {
     Main home = new Main(false, 123, new DBConnector("192.168.1.9","capstone","application","java see sharp myess queue ell"));
     home.Show();
 }
 internal insertTreatment(Main main)
 {
     InitializeComponent();
 }
 public PatientHome(Main sourceWindow)
 {
     InitializeComponent();
     this.HomeWindow = sourceWindow;
 }