private void ButtonSubmit_Click(object sender, EventArgs e) { ConnectDB EMRDatabase = new ConnectDB(); Boolean patientExists = EMRDatabase.PatientExists(SSN); //if the SSN is already in the DB if (patientExists == true) { Console.WriteLine("patient already exists!"); EMRDatabase.UpdatePatient(SSN, Fname, Lname, Address, Email, Phone, Sex, Birthday, BloodType, PrimaryPhysician, InsProvider, InsNum); EMRDatabase.AddAllergiesExisting(SSN, Allergy, AllergyDate); } else { Console.WriteLine("patient doesn't exist, adding to DB..."); EMRDatabase.InsertPatient(SSN, Fname, Lname, Address, Email, Phone, Sex, Birthday, BloodType, PrimaryPhysician, InsProvider, InsNum); EMRDatabase.AddAllergies(SSN, Allergy, AllergyDate); } confirmationBox.Visible = false; labelConfirm.Visible = false; buttonCancel.Visible = false; buttonSubmit.Visible = false; button2.Visible = true; button3.Visible = true; }
private void button2_Click(object sender, EventArgs e) { ConnectDB EMRDatabase = new ConnectDB(); Boolean patientExists = EMRDatabase.PatientExists(SSN); EMRDatabase.AddAllergies(SSN, Allergy, AllergyDate); }
private void button3_Click(object sender, EventArgs e) { ConnectDB EMRDatabase = new ConnectDB(); Boolean patientExists = EMRDatabase.PatientExists(SSN); //if the SSN is already in the DB if (patientExists == true) { MedicalHistory medHistory = new MedicalHistory(SSN); medHistory.Show(); } else { } }
//SSN private void textSetSSN_TextChanged(object sender, EventArgs e) { SSN = textSetSSN.Text; ConnectDB EMRDatabase = new ConnectDB(); Boolean patientExists = EMRDatabase.PatientExists(SSN); if (patientExists == true) { button1.Text = "Update Patient"; } else { button1.Text = "Create Patient Record"; button2.Visible = false; button3.Visible = false; } }