private void Add_BT_Click(object sender, EventArgs e) { if (traineeIsEmt()) { MessageBox.Show("Provide information at unassigned box(es)"); TrainerID_TB.Focus(); } else if (TRAINEEID.Text.Substring(0, 1) == "0") { MessageBox.Show("invalid ID input"); TrainerID_TB.Focus(); } else { TRCl trainee = new TRCl(TRAINEEID.Text.ToString(), TRAINEENAME.Text.ToString(), TRAINEEEDU.Text.ToString(), TRAINEEDOB.Value.Date, TRAINEEPROG.Text.ToString(), TRAINEETOEIC.Text.ToString(), TRAINEEEXP.Text.ToString(), TRAINEEDEPT.Text.ToString(), TRAINEECOURSEID.Text.ToString()); if (trainee.Add() != 0) { MessageBox.Show("Success"); ClearTB(); this.Close(); } else { MessageBox.Show("Assign the god damn Course beyotch"); } } }
public TR_PopupForm() { InitializeComponent(); Trainer_GB.Hide(); Trainee_GB.BringToFront(); TRCl tr_Class = new TRCl(); TRAINEECOURSEID.DataSource = tr_Class.IDretrieve(); if (Staff.Action.ToString() == "Add") { Update_BT.Hide(); Delete_BT.Hide(); } }