CNSA-212-FP/Louis'-Pharmacy_CNSA212-FP/frmPatientAdd.cs
2024-02-16 11:32:00 -05:00

75 lines
2.2 KiB
C#

using System;
using System.Windows.Forms;
using System.Data;
namespace Louis__Pharmacy_CNSA212_FP
{
public partial class frmPatientAdd : Form
{
private static bool isAdd;
public frmPatientAdd(bool isNew)
{
isAdd = isNew;
InitializeComponent();
if (isNew)
{
lblDisPurpose.Text = "Add Patient";
btnGO.Text = "Create";
}
else
{
lblDisPurpose.Text = "Edit Patient";
btnGO.Text = "Update";
}
}
private void label1_Click(object sender, EventArgs e)
{
}
private void frmPatientAdd_Load(object sender, EventArgs e)
{
txtPatientID.Enabled = false;
if (isAdd)
{
double nextID = PharmacyDataTier.GetNextPatientID();
txtPatientID.Text = nextID.ToString();
}
else
{
}
}
public void FillPatient(string patID)
{
DataSet ds = new DataSet();
PharmacyDataTier data = new PharmacyDataTier();
ds = PharmacyDataTier.PatientInfoSearch(patID);
txtPatientID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString();
txtFname.Text = ds.Tables[0].Rows[0]["FirstName"].ToString();
txtLname.Text = ds.Tables[0].Rows[0]["LastName"].ToString();
txtMidInit.Text = ds.Tables[0].Rows[0]["MiddleIntials"].ToString();
txtWeight.Text = ds.Tables[0].Rows[0]["lbs"].ToString();
txtHeightFt.Text = ds.Tables[0].Rows[0]["Height_feet"].ToString();
txtHeightIn.Text = ds.Tables[0].Rows[0]["Height_inches"].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();
}
}
}