From a1f2fd1fe2c6067094d509b1a4a60cc49b1790eb Mon Sep 17 00:00:00 2001 From: Adam McCane Date: Thu, 22 Feb 2024 22:19:12 -0500 Subject: [PATCH] Added code to allow refill edit to modify prescription refill values successfully. --- Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs index 1a6954f..c29e32a 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs @@ -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(); }