diff --git a/Louis'-Pharmacy_CNSA212-FP/frmInfo.cs b/Louis'-Pharmacy_CNSA212-FP/frmInfo.cs index 93ce7b8..2bcef16 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmInfo.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmInfo.cs @@ -941,7 +941,7 @@ namespace Louis__Pharmacy_CNSA212_FP string rxNumString = (row.Cells[0].Value).ToString(); Int32 rxNum = Int32.Parse(rxNumString); - frmRefill refill = new frmRefill(rxNum); + frmRefill refill = new frmRefill(rxNum, this); refill.MdiParent = MdiParent; refill.StartPosition = FormStartPosition.CenterScreen; refill.Show(); diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs index 2e69b6d..d76422e 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs @@ -19,9 +19,12 @@ namespace Louis__Pharmacy_CNSA212_FP { public DataSet ds = new DataSet(); private int rxNum = 0; - - public frmRefill(int thisRxID) + private frmInfo SourceForm = new frmInfo(); + public frmRefill(int thisRxID, frmInfo SenderForm) { + + SourceForm = SenderForm; + InitializeComponent(); rxNum = thisRxID; frmRefill_Load(null, null); @@ -44,6 +47,19 @@ namespace Louis__Pharmacy_CNSA212_FP dgvRefills.DataSource = ds.Tables[0]; } + + private void frmRefill_reLoad(object sender, EventArgs e) + { + int rxID = 0; + + DataGridViewRow row = new DataGridViewRow(); + rxID = rxNum; + + DataSet ds = new DataSet(); + ds = PharmacyDataTier.GetRefill(rxID.ToString()); + + dgvRefills.DataSource = ds.Tables[0]; + } private void editToolStripMenuItem_Click(object sender, EventArgs e) { @@ -80,6 +96,9 @@ namespace Louis__Pharmacy_CNSA212_FP PharmacyDataTier.DeleteRefill(refillID); PharmacyDataTier.DecrementPastRefills(rxID); + + frmRefill_reLoad(sender, e); + SourceForm.btnPrescriptionSearch_Click(sender,e); } public void refreshrefills(object sender, EventArgs e) diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs index 0e69812..1991014 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs @@ -94,7 +94,7 @@ namespace Louis__Pharmacy_CNSA212_FP medicationID = txtMedicationID.Text.Trim(); rxNum = txtRxNumber.Text.Trim(); - frmRefill refill = new frmRefill(0); + // frmRefill refill = new frmRefill(0, this); PharmacyDataTier.UpdateRefill(refillID, date, patientID, medicationID, rxNum);