Created delete functionality for view refill form.

This commit is contained in:
Adam McCane 2024-02-21 15:51:39 -05:00
parent d40a4b0acb
commit 03e7185225

View File

@ -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)