Пример #1
0
 /********************************************************************************************
 * Button Click that calls the insert function for allergies and adds new rows to the database
 * based upon the current patient. It then closes this form.
 * ******************************************************************************************/
 private void updateAllergyButton_Click(object sender, EventArgs e)
 {
     if (AllergicTo.Text == "" || Reaction.Text == "")
     {
         MessageBox.Show("Something must be entered for each field. If patient is not applicable for a certain field enter 'N/A'.", "Attention", MessageBoxButtons.OK);
         return;
     }
     if (editing == false)
     {
         string insertedRows = InsertFunctions.InsertIntoAllergyInfo(PatientID, AllergicTo.Text, Reaction.Text);
         MessageBox.Show(insertedRows);
         AllergicTo.Clear();
         Reaction.Clear();
     }
     else if (editing == true)
     {
         UpdateFunctions.UpdateAllergyInfo(PatientID, AllergicTo.Text, Reaction.Text, editAllergicTo, editReaction);
         AllergicTo.Clear();
         Reaction.Clear();
         this.Close();
     }
 }