From 03e71852251e67782223b5c750203ab1c36aef98 Mon Sep 17 00:00:00 2001 From: Adam McCane Date: Wed, 21 Feb 2024 15:51:39 -0500 Subject: [PATCH] Created delete functionality for view refill form. --- Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs | 36 ++++++++++++---------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs index d765f73..1a6954f 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs @@ -91,27 +91,31 @@ namespace Louis__Pharmacy_CNSA212_FP medicationID = txtMedicationID.Text.Trim(); rxNum = txtRxNumber.Text.Trim(); + frmRefill refill = new frmRefill(0); + PharmacyDataTier.UpdateRefill(refillID, date, patientID, medicationID, rxNum); + refill.Controls.Clear(); + refill.Activate(); } else { - if (numRefills == pastNumRefills) - { - MessageBox.Show("This prescription has reached the maximum number of refills.", "Max Refill", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - else - { - if (isAdd) - { - refillID = txtRefillID.Text.Trim(); - date = DateTime.Parse(txtRefillDate.Text.Trim()); - patientID = txtPatientID.Text.Trim(); - medicationID = txtMedicationID.Text.Trim(); + //if (numRefills == pastNumRefills) + //{ + // MessageBox.Show("This prescription has reached the maximum number of refills.", "Max Refill", MessageBoxButtons.OK, MessageBoxIcon.Error); + //} + //else + //{ + // if (isAdd) + // { + // refillID = txtRefillID.Text.Trim(); + // date = DateTime.Parse(txtRefillDate.Text.Trim()); + // patientID = txtPatientID.Text.Trim(); + // medicationID = txtMedicationID.Text.Trim(); - PharmacyDataTier.AddRefill(refillID, date, patientID, medicationID, rxNum); - PharmacyDataTier.PastRefills(rxNum); - } - } + // PharmacyDataTier.AddRefill(refillID, date, patientID, medicationID, rxNum); + // PharmacyDataTier.PastRefills(rxNum); + // } + //} } } catch (Exception exception)