Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                //obtains all the necessary information from the user inputs
                string   fName = txtFName.Text.Trim();
                string   lName = txtLName.Text.Trim();
                string   mInit = txtMInit.Text.Trim();
                DateTime DOB   = dtpDOB.Value;

                string gender  = cboGender.Text.Trim();
                string street1 = txtStreet1.Text.Trim();
                string street2 = txtStreet2.Text.Trim();
                string city    = txtCity.Text.Trim();

                string state     = cboState.SelectedValue.ToString();
                string zip       = txtZip.Text.Trim();
                string homePhone = txtHomePhone.Text.Trim();
                string workPhone = txtWorkPhone.Text.Trim();

                string cellPhone = txtCellPhone.Text.Trim();
                string email     = txtEmail.Text.Trim();

                //sends the information to the datatier
                PharmacyDataTier bPharm = new PharmacyDataTier();
                DataSet          ds1    = new DataSet();
                ds1 = bPharm.AddPatient(fName, lName, mInit, DOB, gender, street1, street2, city, state, zip, homePhone, workPhone, cellPhone, email);
                MessageBox.Show("Patient succesfully added.", "Completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }