Refresh funtionality added to cmu of view refill form.

This commit is contained in:
Adam McCane 2024-02-23 02:23:31 -05:00
parent a1f2fd1fe2
commit 5622be21fd
4 changed files with 29 additions and 4 deletions

View File

@ -53,6 +53,7 @@ namespace Louis__Pharmacy_CNSA212_FP
this.cmuRefill = new System.Windows.Forms.ContextMenuStrip(this.components); this.cmuRefill = new System.Windows.Forms.ContextMenuStrip(this.components);
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteToolStripMenuItem = 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(); ((System.ComponentModel.ISupportInitialize)(this.dgvRefills)).BeginInit();
this.cmuRefill.SuspendLayout(); this.cmuRefill.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@ -180,9 +181,10 @@ namespace Louis__Pharmacy_CNSA212_FP
// //
this.cmuRefill.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmuRefill.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.editToolStripMenuItem, this.editToolStripMenuItem,
this.deleteToolStripMenuItem}); this.deleteToolStripMenuItem,
this.cmuRefresh});
this.cmuRefill.Name = "cmuRefill"; this.cmuRefill.Name = "cmuRefill";
this.cmuRefill.Size = new System.Drawing.Size(181, 70); this.cmuRefill.Size = new System.Drawing.Size(181, 92);
// //
// editToolStripMenuItem // editToolStripMenuItem
// //
@ -198,6 +200,13 @@ namespace Louis__Pharmacy_CNSA212_FP
this.deleteToolStripMenuItem.Text = "Delete"; this.deleteToolStripMenuItem.Text = "Delete";
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); 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 // frmRefill
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 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.ContextMenuStrip cmuRefill;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem cmuRefresh;
} }
} }

View File

@ -82,6 +82,21 @@ namespace Louis__Pharmacy_CNSA212_FP
PharmacyDataTier.DecrementPastRefills(rxID); 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) //private void btnSearch_Click(object sender, EventArgs e)
//{ //{
// string patientID = ""; // string patientID = "";

View File

@ -160,6 +160,7 @@
this.Controls.Add(this.lblRefillID); this.Controls.Add(this.lblRefillID);
this.Name = "frmRefillAdd"; this.Name = "frmRefillAdd";
this.Text = "frmRefillAdd"; this.Text = "frmRefillAdd";
//this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmRefillAdd_FormClosed);
this.Load += new System.EventHandler(this.frmRefillAdd_Load); this.Load += new System.EventHandler(this.frmRefillAdd_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

@ -104,8 +104,7 @@ namespace Louis__Pharmacy_CNSA212_FP
PharmacyDataTier.PastRefills(rxNum); PharmacyDataTier.PastRefills(rxNum);
} }
refill.Controls.Clear();
refill.Activate();
} }
else else
{ {