private void btnAdd_Click_1(object sender, EventArgs e) { if (txtAddPhysician.Text != string.Empty && txtAddMedication.Text != string.Empty) { bool addedEncounterDetails = encounter.EncounterAdded(txtAddPhysician.Text, txtAddMedication.Text, Int32.Parse(txtAddPersonId.Text)); if (addedEncounterDetails) { MessageBox.Show("Encounter Details Added!", "DataBase Update", MessageBoxButtons.OK, MessageBoxIcon.Information); ClearAll(); } else { MessageBox.Show("Failed to Add Details. Try again!", "DataBase Update", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { lblNoFieldEmpty_EncounterForm.Show(); } }
private void btnAdd_Click(object sender, EventArgs e) { if (txtAddFName.Text != string.Empty && txtAddLName.Text != string.Empty && cboAddsex.Text != string.Empty && txtAddBDate.Text != string.Empty && txtAddVoterID.Text != string.Empty && txtAddPhysicianName.Text != string.Empty && txtAddMedicationNames.Text != string.Empty) { bool addedPersonDetails = person.PersonAdded(txtAddFName.Text, txtAddLName.Text, cboAddsex.Text, txtAddBDate.Text, txtAddVoterID.Text); List <PersonVO> personList = new List <PersonVO>(); personList = person.SetPersonData(txtAddFName.Text, txtAddLName.Text, cboAddsex.Text, txtAddBDate.Text, txtAddVoterID.Text); PersonVO personObject = personList[personList.Count - 1]; bool addedEncounterDetails = encounter.EncounterAdded(txtAddPhysicianName.Text, txtAddMedicationNames.Text, personObject.PersonID); if (addedPersonDetails == true && addedEncounterDetails == true) { MessageBox.Show("Details Added!", "DataBase Update", MessageBoxButtons.OK, MessageBoxIcon.Information); ClearAll(); } else { MessageBox.Show("Failed to Add Details. Try again!", "DataBase Update", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { lblNoFieldEmpty_PersonEncounterForm.Show(); } }