diff --git a/Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs b/Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs index 64c80fc..94e8805 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs @@ -1,7 +1,7 @@ using System; +using System.ComponentModel; using System.Data; using System.Windows.Forms; -using DateTime = System.DateTime; namespace Louis__Pharmacy_CNSA212_FP { @@ -119,8 +119,10 @@ namespace Louis__Pharmacy_CNSA212_FP { throw new Exception(); } - else - DOB = new DateTime(1753, 1, 1); + if (DOB > new DateTime(9999,1,1)) + { + throw new Exception(); + } } catch (Exception exception) { @@ -306,7 +308,8 @@ namespace Louis__Pharmacy_CNSA212_FP txtFirstName.Text = ds.Tables[0].Rows[0]["FirstName"].ToString(); txtLastName.Text = ds.Tables[0].Rows[0]["LastName"].ToString(); txtMiddleInit.Text = ds.Tables[0].Rows[0]["MiddleIntials"].ToString(); - txtDOB.Text = ds.Tables[0].Rows[0]["DOB"].ToString(); + DateTime date = DateTime.Parse(ds.Tables[0].Rows[0]["DOB"].ToString()); + txtDOB.Text = date.ToString("d"); txtGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString(); txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString(); txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString();