using System; using System.Windows.Forms; using System.Data; namespace Louis__Pharmacy_CNSA212_FP { public partial class frmPhysician : Form { private bool isAdd; private frmInfo SourceForm; public frmPhysician(frmInfo sourceForm, bool isNew) { SourceForm = sourceForm; isAdd = isNew; InitializeComponent(); txtState.MaxLength = 2; if (isNew) { lblDisPurpose.Text = "Add Physician"; btnGO.Text = "Create"; } else { lblDisPurpose.Text = "Edit Physician"; btnGO.Text = "Update"; } } private void btnClose_Click(object sender, EventArgs e) { Close(); } private void btnGO_Click(object sender, EventArgs e) { } private void frmPhysician_Load(object sender, EventArgs e) { txtPhyID.Enabled = false; if (isAdd) { var nextID = PharmacyDataTier.GetNextPhysicianID(); txtPhyID.Text = nextID.ToString(); } } public void FillPhysician(string phyID) { var ds = new DataSet(); var data = new PharmacyDataTier(); ds = PharmacyDataTier.PhysicianInfoSearch(phyID); txtPhyID.Text = ds.Tables[0].Rows[0]["Physician_id"].ToString(); 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(); 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(); txtState.Text = ds.Tables[0].Rows[0]["UsState"].ToString(); txtPhone.Text = ds.Tables[0].Rows[0]["PhoneNumber"].ToString(); txtSpeciality.Text = ds.Tables[0].Rows[0]["Specialty"].ToString(); } } }