Add UpdatePrescription solution in PharmacyDataTier.cs

This commit is contained in:
Noah 2024-02-20 12:55:54 -05:00
parent a48b9a895a
commit a7aad8153f

View File

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