Exemplo n.º 1
0
        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            if (txtFirstName.Text != String.Empty && txtLastName.Text != String.Empty && txtPhone.Text != String.Empty)
            {
                string firstName = txtFirstName.Text;
                string lastName  = txtLastName.Text;
                string phone     = txtPhone.Text;
                string admin;

                if (Convert.ToBoolean(chkAdmin.IsChecked))
                {
                    admin = "1";
                }
                else
                {
                    admin = "0";
                }

                DBConnector.Staff newStaff = new DBConnector.Staff(admin, firstName, lastName, phone);
                MainWindow.Connector.Insert(newStaff);
            }
            else
            {
                MessageBox.Show("Please make sure all of teh information is filled out. Stop trying to break things.");
            }
        }
Exemplo n.º 2
0
 private void btnInsertStaff_Click(object sender, RoutedEventArgs e)
 {
     DBConnector.Staff staff = new DBConnector.Staff("0", "Testy", "Testosterone", "5555555557");
     if (connector.Insert(staff))
     {
         labInsertTest.Content = "Staff Insertion Test Successful! :)";
     }
     else
     {
         labInsertTest.Content = "Staff  Insertion Test Unsuccessful! :(";
     }
 }
Exemplo n.º 3
0
 private void btnInsertStaff_Click(object sender, RoutedEventArgs e)
 {
     DBConnector.Staff staff = new DBConnector.Staff("0", "Testy", "Testosterone", "5555555557");
     if (connector.Insert(staff))
     {
         labInsertTest.Content = "Staff Insertion Test Successful! :)";
     }
     else
     {
         labInsertTest.Content = "Staff  InsertionTest Unsuccessful! :(";
     }
 }