diff --git a/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs b/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs index 3c94370..3777878 100644 --- a/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs +++ b/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs @@ -1129,6 +1129,48 @@ namespace Louis__Pharmacy_CNSA212_FP } } + public static void UpdatePrescription( + string RxNum, + string Patient_id, + string Medication_id, + string Physician_name, + string Physician_id, + string Completed_refills, + string Max_refills) + { + try + { + myConn.Open(); + + cmdString.Parameters.Clear(); + + cmdString.Connection = myConn; + cmdString.CommandType = CommandType.StoredProcedure; + cmdString.CommandTimeout = 1500; + + cmdString.CommandText = "UpdatePrescription"; + + cmdString.Parameters.Add("@Medication_id", SqlDbType.VarChar, 7).Value = Medication_id; + cmdString.Parameters.Add("@numRefills", SqlDbType.VarChar, 60).Value = Completed_refills; + cmdString.Parameters.Add("@pastNumRefills", SqlDbType.VarChar, 30).Value = Max_refills; + cmdString.Parameters.Add("@PrescribedBy", SqlDbType.VarChar, 30).Value = Physician_name; + cmdString.Parameters.Add("@Physician_id", SqlDbType.VarChar, 30).Value = Physician_id; + cmdString.Parameters.Add("@Patient_id", SqlDbType.VarChar, 100).Value = Patient_id; + cmdString.Parameters.Add("@RxNum", SqlDbType.VarChar, 30).Value = RxNum; + + cmdString.ExecuteNonQuery(); + + } + catch (Exception ex) + { + throw new ArgumentException(ex.Message); + } + finally + { + myConn.Close(); + } + } + public static void FillComboBox(string table, string ValueMember, string displayMember, ComboBox myComboBox) { try