From 5622be21fd52a3792cf3fd964e4a9999dbb8233f Mon Sep 17 00:00:00 2001 From: Adam McCane Date: Fri, 23 Feb 2024 02:23:31 -0500 Subject: [PATCH] Refresh funtionality added to cmu of view refill form. --- Louis'-Pharmacy_CNSA212-FP/frmRefill.Designer.cs | 14 ++++++++++++-- Louis'-Pharmacy_CNSA212-FP/frmRefill.cs | 15 +++++++++++++++ .../frmRefillAdd.Designer.cs | 1 + Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs | 3 +-- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefill.Designer.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefill.Designer.cs index 5a985e2..ff10e53 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefill.Designer.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefill.Designer.cs @@ -53,6 +53,7 @@ namespace Louis__Pharmacy_CNSA212_FP this.cmuRefill = new System.Windows.Forms.ContextMenuStrip(this.components); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cmuRefresh = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.dgvRefills)).BeginInit(); this.cmuRefill.SuspendLayout(); this.SuspendLayout(); @@ -180,9 +181,10 @@ namespace Louis__Pharmacy_CNSA212_FP // this.cmuRefill.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.editToolStripMenuItem, - this.deleteToolStripMenuItem}); + this.deleteToolStripMenuItem, + this.cmuRefresh}); this.cmuRefill.Name = "cmuRefill"; - this.cmuRefill.Size = new System.Drawing.Size(181, 70); + this.cmuRefill.Size = new System.Drawing.Size(181, 92); // // editToolStripMenuItem // @@ -198,6 +200,13 @@ namespace Louis__Pharmacy_CNSA212_FP this.deleteToolStripMenuItem.Text = "Delete"; this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); // + // cmuRefresh + // + this.cmuRefresh.Name = "cmuRefresh"; + this.cmuRefresh.Size = new System.Drawing.Size(180, 22); + this.cmuRefresh.Text = "Refresh"; + this.cmuRefresh.Click += new System.EventHandler(this.cmuRefresh_Click); + // // frmRefill // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -251,5 +260,6 @@ namespace Louis__Pharmacy_CNSA212_FP private System.Windows.Forms.ContextMenuStrip cmuRefill; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem cmuRefresh; } } \ No newline at end of file diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs index 44050f5..2e69b6d 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefill.cs @@ -82,6 +82,21 @@ namespace Louis__Pharmacy_CNSA212_FP PharmacyDataTier.DecrementPastRefills(rxID); } + public void refreshrefills(object sender, EventArgs e) + { + DataGridViewRow row = new DataGridViewRow(); + row = dgvRefills.SelectedRows[0]; + string rxNumString = (row.Cells[4].Value).ToString(); + Int32 rxNum = Int32.Parse(rxNumString); + + frmRefill_Load(null, null); + } + + private void cmuRefresh_Click(object sender, EventArgs e) + { + refreshrefills(sender, e); + } + //private void btnSearch_Click(object sender, EventArgs e) //{ // string patientID = ""; diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.Designer.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.Designer.cs index d510f44..a205ad3 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.Designer.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.Designer.cs @@ -160,6 +160,7 @@ this.Controls.Add(this.lblRefillID); this.Name = "frmRefillAdd"; this.Text = "frmRefillAdd"; + //this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmRefillAdd_FormClosed); this.Load += new System.EventHandler(this.frmRefillAdd_Load); this.ResumeLayout(false); this.PerformLayout(); diff --git a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs index c29e32a..0e69812 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmRefillAdd.cs @@ -104,8 +104,7 @@ namespace Louis__Pharmacy_CNSA212_FP PharmacyDataTier.PastRefills(rxNum); } - refill.Controls.Clear(); - refill.Activate(); + } else {