add CreatePrescription solution in PharmacyDataTier.cs
This commit is contained in:
parent
a08b3065c8
commit
a48b9a895a
@ -1087,6 +1087,48 @@ namespace Louis__Pharmacy_CNSA212_FP
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreatePrescription(
|
||||
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 = "CreatePrescription";
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user