예제 #1
0
        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;
        }