Added code to allow refill edit to modify prescription refill values successfully.

This commit is contained in:
Adam McCane 2024-02-22 22:19:12 -05:00
parent 9f8d567b3d
commit a1f2fd1fe2

View File

@ -15,6 +15,7 @@ namespace Louis__Pharmacy_CNSA212_FP
{
private static bool isAdd;
public DataSet ds = new DataSet();
public string currentID = "";
public frmRefillAdd(bool isNew)
{
@ -59,6 +60,8 @@ namespace Louis__Pharmacy_CNSA212_FP
txtPatientID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString();
txtMedicationID.Text = ds.Tables[0].Rows[0]["Medication_id"].ToString();
txtRxNumber.Text = ds.Tables[0].Rows[0]["RxNum_id"].ToString();
currentID = txtRxNumber.Text;
}
private void btnAdd_Click(object sender, EventArgs e)
@ -94,6 +97,13 @@ namespace Louis__Pharmacy_CNSA212_FP
frmRefill refill = new frmRefill(0);
PharmacyDataTier.UpdateRefill(refillID, date, patientID, medicationID, rxNum);
if (currentID != rxNum)
{
PharmacyDataTier.DecrementPastRefills(currentID);
PharmacyDataTier.PastRefills(rxNum);
}
refill.Controls.Clear();
refill.Activate();
}