Added past refills number incrementation into the refill add form.

This commit is contained in:
Adam McCane 2024-02-19 21:47:48 -05:00
parent 464bd14c0a
commit 211a19602f
2 changed files with 29 additions and 0 deletions

View File

@ -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();
}
}
} }
} }

View File

@ -77,6 +77,7 @@ namespace Louis__Pharmacy_CNSA212_FP
rxNum = txtRxNumber.Text.Trim(); rxNum = txtRxNumber.Text.Trim();
PharmacyDataTier.AddRefill(refillID, date, patientID, medicationID, rxNum); PharmacyDataTier.AddRefill(refillID, date, patientID, medicationID, rxNum);
PharmacyDataTier.PastRefills(rxNum);
} }
else else
{ {