diff --git a/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs b/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs index fb903b1..8619c23 100644 --- a/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs +++ b/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs @@ -787,5 +787,33 @@ namespace Louis__Pharmacy_CNSA212_FP } + public static void PastRefills(string rxNum) + { + try + { + myConn.Open(); + + cmdString.Parameters.Clear(); + + cmdString.Connection = myConn; + cmdString.CommandType = CommandType.StoredProcedure; + cmdString.CommandTimeout = 1500; + + cmdString.CommandText = "PastRefills"; + + cmdString.Parameters.Add("@Prescription_id", SqlDbType.VarChar, 11).Value = rxNum; + + cmdString.ExecuteNonQuery(); + } + catch (Exception ex) + { + throw new ArgumentException(ex.Message); + } + finally + { + myConn.Close(); + } + } + } } \ No newline at end of file diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs index 8d41aee..18574a8 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs @@ -77,6 +77,7 @@ namespace Louis__Pharmacy_CNSA212_FP rxNum = txtRxNumber.Text.Trim(); PharmacyDataTier.AddRefill(refillID, date, patientID, medicationID, rxNum); + PharmacyDataTier.PastRefills(rxNum); } else {