From 748c6e08fbedcf8c862383032bf748c66c8c8cfb Mon Sep 17 00:00:00 2001 From: caschick221 Date: Wed, 21 Feb 2024 13:10:30 -0500 Subject: [PATCH] Made Physicician DOB format short --- Louis'-Pharmacy_CNSA212-FP/frmPhysician.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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();