2024-02-16 20:13:30 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
2024-02-19 10:47:16 -05:00
|
|
|
|
using System.Data;
|
2024-02-16 19:41:26 -05:00
|
|
|
|
|
|
|
|
|
namespace Louis__Pharmacy_CNSA212_FP
|
|
|
|
|
{
|
|
|
|
|
public partial class frmPhysician : Form
|
|
|
|
|
{
|
2024-02-16 20:13:30 -05:00
|
|
|
|
|
|
|
|
|
private bool isAdd;
|
|
|
|
|
private frmInfo SourceForm;
|
|
|
|
|
|
|
|
|
|
public frmPhysician(frmInfo sourceForm, bool isNew)
|
2024-02-16 19:41:26 -05:00
|
|
|
|
{
|
2024-02-16 20:13:30 -05:00
|
|
|
|
|
|
|
|
|
SourceForm = sourceForm;
|
|
|
|
|
|
|
|
|
|
isAdd = isNew;
|
2024-02-16 19:41:26 -05:00
|
|
|
|
InitializeComponent();
|
2024-02-16 20:13:30 -05:00
|
|
|
|
|
|
|
|
|
txtState.MaxLength = 2;
|
|
|
|
|
|
|
|
|
|
if (isNew)
|
|
|
|
|
{
|
2024-02-19 10:47:16 -05:00
|
|
|
|
lblDisPurpose.Text = "Add Physician";
|
|
|
|
|
btnGO.Text = "Create";
|
2024-02-16 20:13:30 -05:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-02-19 10:47:16 -05:00
|
|
|
|
lblDisPurpose.Text = "Edit Physician";
|
|
|
|
|
btnGO.Text = "Update";
|
2024-02-16 20:13:30 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnClose_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnGO_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
2024-02-16 19:41:26 -05:00
|
|
|
|
}
|
2024-02-19 10:47:16 -05:00
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-16 19:41:26 -05:00
|
|
|
|
}
|
|
|
|
|
}
|