CNSA-212-FP/Louis'-Pharmacy_CNSA212-FP/frmPatientAdd.cs

75 lines
2.2 KiB
C#
Raw Normal View History

using System;
using System.Windows.Forms;
2024-02-15 09:04:26 -08:00
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";
2024-02-15 09:04:26 -08:00
btnGO.Text = "Create";
}
else
{
lblDisPurpose.Text = "Edit Patient";
2024-02-15 09:04:26 -08:00
btnGO.Text = "Update";
}
}
private void label1_Click(object sender, EventArgs e)
{
}
private void frmPatientAdd_Load(object sender, EventArgs e)
{
txtPatientID.Enabled = false;
if (isAdd)
{
2024-02-15 09:04:26 -08:00
double nextID = PharmacyDataTier.GetNextPatientID();
txtPatientID.Text = nextID.ToString();
}
else
{
2024-02-16 07:12:36 -08:00
}
2024-02-15 09:04:26 -08:00
}
2024-02-15 09:04:26 -08:00
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();
2024-02-16 08:32:00 -08:00
txtMidInit.Text = ds.Tables[0].Rows[0]["MiddleIntials"].ToString();
2024-02-15 09:04:26 -08:00
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();
}
}
}