예제 #1
0
 private void saveNewYouthToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (AddYouthFirstNameTextBox.Text == "" || AddYouthLastNameTextBox.Text == "")
     {
         MessageBox.Show("Please enter a first and last name.");
     }
     else
     {
         if (Globals.GlobalYouth.Exists(y => y.FullName == AddYouthLastNameTextBox.Text + ", " + AddYouthFirstNameTextBox.Text))
         {
             MessageBox.Show(string.Format("The youth '{0}' already exists in the database.", AddYouthLastNameTextBox.Text + ", " + AddYouthFirstNameTextBox.Text));
         }
         else
         {
             if (DBCommunication.AddNewYouth(AddYouthFirstNameTextBox.Text, AddYouthLastNameTextBox.Text))
             {
                 this.Close();
                 AddYouthForm _addYouthForm = new AddYouthForm();
                 _addYouthForm.Show();
             }
         }
     }
 }
예제 #2
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     AddYouthForm _addYouthForm = new AddYouthForm();
     _addYouthForm.ShowDialog();
 }