Made Physicician DOB format short

This commit is contained in:
caschick221 2024-02-21 13:10:30 -05:00
parent b90b660283
commit 748c6e08fb

View File

@ -1,7 +1,7 @@
using System; using System;
using System.ComponentModel;
using System.Data; using System.Data;
using System.Windows.Forms; using System.Windows.Forms;
using DateTime = System.DateTime;
namespace Louis__Pharmacy_CNSA212_FP namespace Louis__Pharmacy_CNSA212_FP
{ {
@ -119,8 +119,10 @@ namespace Louis__Pharmacy_CNSA212_FP
{ {
throw new Exception(); throw new Exception();
} }
else if (DOB > new DateTime(9999,1,1))
DOB = new DateTime(1753, 1, 1); {
throw new Exception();
}
} }
catch (Exception exception) catch (Exception exception)
{ {
@ -306,7 +308,8 @@ namespace Louis__Pharmacy_CNSA212_FP
txtFirstName.Text = ds.Tables[0].Rows[0]["FirstName"].ToString(); txtFirstName.Text = ds.Tables[0].Rows[0]["FirstName"].ToString();
txtLastName.Text = ds.Tables[0].Rows[0]["LastName"].ToString(); txtLastName.Text = ds.Tables[0].Rows[0]["LastName"].ToString();
txtMiddleInit.Text = ds.Tables[0].Rows[0]["MiddleIntials"].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(); txtGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString();
txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString(); txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString();
txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString(); txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString();