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