Added some code for refill view in info form.

This commit is contained in:
Adam McCane 2024-02-20 21:42:40 -05:00
parent 19f1fd4cc0
commit 75f9001937
5 changed files with 171 additions and 195 deletions

View File

@ -285,7 +285,22 @@ namespace Louis__Pharmacy_CNSA212_FP
this.dgvPatient.AllowUserToAddRows = false; this.dgvPatient.AllowUserToAddRows = false;
this.dgvPatient.AllowUserToDeleteRows = false; this.dgvPatient.AllowUserToDeleteRows = false;
this.dgvPatient.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvPatient.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPatient.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.pat_id, this.FirstName, this.LastName, this.MiddleInitials, this.City, this.UsState, this.Zip, this.Ibs, this.Height_feet, this.Height_inches, this.Ailment, this.DOB, this.PhoneNumber, this.Gender, this.Medications }); this.dgvPatient.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.pat_id,
this.FirstName,
this.LastName,
this.MiddleInitials,
this.City,
this.UsState,
this.Zip,
this.Ibs,
this.Height_feet,
this.Height_inches,
this.Ailment,
this.DOB,
this.PhoneNumber,
this.Gender,
this.Medications});
this.dgvPatient.ContextMenuStrip = this.cmuPatient; this.dgvPatient.ContextMenuStrip = this.cmuPatient;
this.dgvPatient.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgvPatient.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dgvPatient.Location = new System.Drawing.Point(0, 0); this.dgvPatient.Location = new System.Drawing.Point(0, 0);
@ -439,7 +454,10 @@ namespace Louis__Pharmacy_CNSA212_FP
// cmuPatient // cmuPatient
// //
this.cmuPatient.ImageScalingSize = new System.Drawing.Size(20, 20); this.cmuPatient.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmuPatient.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmuPatientNew, this.cmuPatientEdit, this.cmuPatientDelete }); this.cmuPatient.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmuPatientNew,
this.cmuPatientEdit,
this.cmuPatientDelete});
this.cmuPatient.Name = "contextMenuStrip1"; this.cmuPatient.Name = "contextMenuStrip1";
this.cmuPatient.Size = new System.Drawing.Size(108, 70); this.cmuPatient.Size = new System.Drawing.Size(108, 70);
// //
@ -544,7 +562,14 @@ namespace Louis__Pharmacy_CNSA212_FP
this.dgvPrescription.AllowUserToAddRows = false; this.dgvPrescription.AllowUserToAddRows = false;
this.dgvPrescription.AllowUserToDeleteRows = false; this.dgvPrescription.AllowUserToDeleteRows = false;
this.dgvPrescription.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvPrescription.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPrescription.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Medication_id, this.MedicationName, this.IntakeMethod, this.Frequency, this.Dosage, this.Purpose, this.RxNum }); this.dgvPrescription.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Medication_id,
this.MedicationName,
this.IntakeMethod,
this.Frequency,
this.Dosage,
this.Purpose,
this.RxNum});
this.dgvPrescription.ContextMenuStrip = this.cmuMedication; this.dgvPrescription.ContextMenuStrip = this.cmuMedication;
this.dgvPrescription.Location = new System.Drawing.Point(3, 3); this.dgvPrescription.Location = new System.Drawing.Point(3, 3);
this.dgvPrescription.Name = "dgvPrescription"; this.dgvPrescription.Name = "dgvPrescription";
@ -620,7 +645,10 @@ namespace Louis__Pharmacy_CNSA212_FP
// cmuMedication // cmuMedication
// //
this.cmuMedication.ImageScalingSize = new System.Drawing.Size(20, 20); this.cmuMedication.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmuMedication.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmuMedicationNew, this.cmuMedicationEdit, this.cmuMedicationDelete }); this.cmuMedication.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmuMedicationNew,
this.cmuMedicationEdit,
this.cmuMedicationDelete});
this.cmuMedication.Name = "cmuMedication"; this.cmuMedication.Name = "cmuMedication";
this.cmuMedication.Size = new System.Drawing.Size(108, 70); this.cmuMedication.Size = new System.Drawing.Size(108, 70);
// //
@ -729,7 +757,18 @@ namespace Louis__Pharmacy_CNSA212_FP
this.dgvPhysician.AllowUserToAddRows = false; this.dgvPhysician.AllowUserToAddRows = false;
this.dgvPhysician.AllowUserToDeleteRows = false; this.dgvPhysician.AllowUserToDeleteRows = false;
this.dgvPhysician.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvPhysician.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPhysician.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Phys_id, this.namefirst, this.namelast, this.initialsmiddle, this.cit, this.state, this.zipp, this.dobb, this.numberphone, this.gennder, this.Specialty }); this.dgvPhysician.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Phys_id,
this.namefirst,
this.namelast,
this.initialsmiddle,
this.cit,
this.state,
this.zipp,
this.dobb,
this.numberphone,
this.gennder,
this.Specialty});
this.dgvPhysician.ContextMenuStrip = this.cmuPhysician; this.dgvPhysician.ContextMenuStrip = this.cmuPhysician;
this.dgvPhysician.Location = new System.Drawing.Point(0, 3); this.dgvPhysician.Location = new System.Drawing.Point(0, 3);
this.dgvPhysician.Name = "dgvPhysician"; this.dgvPhysician.Name = "dgvPhysician";
@ -845,7 +884,10 @@ namespace Louis__Pharmacy_CNSA212_FP
// cmuPhysician // cmuPhysician
// //
this.cmuPhysician.ImageScalingSize = new System.Drawing.Size(20, 20); this.cmuPhysician.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmuPhysician.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmuPhysicianNew, this.cmuPhysicianEdit, this.cmuPhysicianDelete }); this.cmuPhysician.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmuPhysicianNew,
this.cmuPhysicianEdit,
this.cmuPhysicianDelete});
this.cmuPhysician.Name = "cmuPhysician"; this.cmuPhysician.Name = "cmuPhysician";
this.cmuPhysician.Size = new System.Drawing.Size(108, 70); this.cmuPhysician.Size = new System.Drawing.Size(108, 70);
// //
@ -981,9 +1023,14 @@ namespace Louis__Pharmacy_CNSA212_FP
// cmuPrescription // cmuPrescription
// //
this.cmuPrescription.ImageScalingSize = new System.Drawing.Size(20, 20); this.cmuPrescription.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmuPrescription.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmuPrescriptionNew, this.cmuPrescriptionEdit, this.cmuPrescriptionDelete, this.cmuPrescriptionRefillThis, this.cmuPrescriptionViewRefills }); this.cmuPrescription.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmuPrescriptionNew,
this.cmuPrescriptionEdit,
this.cmuPrescriptionDelete,
this.cmuPrescriptionRefillThis,
this.cmuPrescriptionViewRefills});
this.cmuPrescription.Name = "cmuPrescription"; this.cmuPrescription.Name = "cmuPrescription";
this.cmuPrescription.Size = new System.Drawing.Size(244, 114); this.cmuPrescription.Size = new System.Drawing.Size(244, 136);
// //
// cmuPrescriptionNew // cmuPrescriptionNew
// //
@ -1018,6 +1065,7 @@ namespace Louis__Pharmacy_CNSA212_FP
this.cmuPrescriptionViewRefills.Name = "cmuPrescriptionViewRefills"; this.cmuPrescriptionViewRefills.Name = "cmuPrescriptionViewRefills";
this.cmuPrescriptionViewRefills.Size = new System.Drawing.Size(243, 22); this.cmuPrescriptionViewRefills.Size = new System.Drawing.Size(243, 22);
this.cmuPrescriptionViewRefills.Text = "View Refills For This Prescription"; this.cmuPrescriptionViewRefills.Text = "View Refills For This Prescription";
this.cmuPrescriptionViewRefills.Click += new System.EventHandler(this.cmuPrescriptionViewRefills_Click);
// //
// frmInfo // frmInfo
// //
@ -1060,6 +1108,7 @@ namespace Louis__Pharmacy_CNSA212_FP
((System.ComponentModel.ISupportInitialize)(this.dgvRx)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvRx)).EndInit();
this.cmuPrescription.ResumeLayout(false); this.cmuPrescription.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionViewRefills; private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionViewRefills;

View File

@ -4,6 +4,7 @@ using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
@ -822,6 +823,16 @@ namespace Louis__Pharmacy_CNSA212_FP
} }
} private void cmuPrescriptionViewRefills_Click(object sender, EventArgs e)
} {
string rxID = "";
rxID = ds.Tables[0].Rows[0]["RxNum_id"].ToString();
frmRefill refill = new frmRefill();
}
}
}

View File

@ -44,28 +44,18 @@ namespace Louis__Pharmacy_CNSA212_FP
this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton(); this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton();
this.bindingNavigatorSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.bindingNavigatorSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.rEFILLSBindingNavigatorSaveItem = new System.Windows.Forms.ToolStripButton(); this.rEFILLSBindingNavigatorSaveItem = new System.Windows.Forms.ToolStripButton();
this.dgvRefills = new System.Windows.Forms.DataGridView();
this.cmuRefill = new System.Windows.Forms.ContextMenuStrip(this.components); this.cmuRefill = new System.Windows.Forms.ContextMenuStrip(this.components);
this.cmuAdd = new System.Windows.Forms.ToolStripMenuItem(); this.cmuAdd = new System.Windows.Forms.ToolStripMenuItem();
this.cmuUpdate = new System.Windows.Forms.ToolStripMenuItem(); this.cmuUpdate = new System.Windows.Forms.ToolStripMenuItem();
this.cmuDelete = new System.Windows.Forms.ToolStripMenuItem(); this.cmuDelete = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.dgvRefills = new System.Windows.Forms.DataGridView();
this.txtPatientID = new System.Windows.Forms.TextBox();
this.txtDate = new System.Windows.Forms.TextBox();
this.btnSearch = new System.Windows.Forms.Button();
this.lblPatientID = new System.Windows.Forms.Label();
this.lblDate = new System.Windows.Forms.Label();
this.refillid = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.refillid = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.refilldate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.refilldate = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.patientid = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.patientid = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.medicationid = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.medicationid = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.rxnumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.rxnumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.dgvRefills)).BeginInit();
this.cmuRefill.SuspendLayout(); this.cmuRefill.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvRefills)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// bindingNavigatorAddNewItem // bindingNavigatorAddNewItem
@ -129,24 +119,6 @@ namespace Louis__Pharmacy_CNSA212_FP
this.rEFILLSBindingNavigatorSaveItem.Name = "rEFILLSBindingNavigatorSaveItem"; this.rEFILLSBindingNavigatorSaveItem.Name = "rEFILLSBindingNavigatorSaveItem";
this.rEFILLSBindingNavigatorSaveItem.Size = new System.Drawing.Size(23, 23); this.rEFILLSBindingNavigatorSaveItem.Size = new System.Drawing.Size(23, 23);
// //
// dgvRefills
//
this.dgvRefills.AllowUserToAddRows = false;
this.dgvRefills.AllowUserToDeleteRows = false;
this.dgvRefills.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvRefills.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.refillid,
this.refilldate,
this.patientid,
this.medicationid,
this.rxnumber});
this.dgvRefills.ContextMenuStrip = this.cmuRefill;
this.dgvRefills.Location = new System.Drawing.Point(3, 3);
this.dgvRefills.Name = "dgvRefills";
this.dgvRefills.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvRefills.Size = new System.Drawing.Size(625, 239);
this.dgvRefills.TabIndex = 0;
//
// cmuRefill // cmuRefill
// //
this.cmuRefill.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmuRefill.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -161,84 +133,39 @@ namespace Louis__Pharmacy_CNSA212_FP
this.cmuAdd.Name = "cmuAdd"; this.cmuAdd.Name = "cmuAdd";
this.cmuAdd.Size = new System.Drawing.Size(112, 22); this.cmuAdd.Size = new System.Drawing.Size(112, 22);
this.cmuAdd.Text = "Add"; this.cmuAdd.Text = "Add";
this.cmuAdd.Click += new System.EventHandler(this.cmuAdd_Click); //this.cmuAdd.Click += new System.EventHandler(this.cmuAdd_Click);
// //
// cmuUpdate // cmuUpdate
// //
this.cmuUpdate.Name = "cmuUpdate"; this.cmuUpdate.Name = "cmuUpdate";
this.cmuUpdate.Size = new System.Drawing.Size(112, 22); this.cmuUpdate.Size = new System.Drawing.Size(112, 22);
this.cmuUpdate.Text = "Update"; this.cmuUpdate.Text = "Update";
this.cmuUpdate.Click += new System.EventHandler(this.cmuUpdate_Click); //this.cmuUpdate.Click += new System.EventHandler(this.cmuUpdate_Click);
// //
// cmuDelete // cmuDelete
// //
this.cmuDelete.Name = "cmuDelete"; this.cmuDelete.Name = "cmuDelete";
this.cmuDelete.Size = new System.Drawing.Size(112, 22); this.cmuDelete.Size = new System.Drawing.Size(112, 22);
this.cmuDelete.Text = "Delete"; this.cmuDelete.Text = "Delete";
this.cmuDelete.Click += new System.EventHandler(this.cmuDelete_Click); //this.cmuDelete.Click += new System.EventHandler(this.cmuDelete_Click);
// //
// splitContainer1 // dgvRefills
// //
this.splitContainer1.Location = new System.Drawing.Point(12, 12); this.dgvRefills.AllowUserToAddRows = false;
this.splitContainer1.Name = "splitContainer1"; this.dgvRefills.AllowUserToDeleteRows = false;
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; this.dgvRefills.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
// this.dgvRefills.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
// splitContainer1.Panel1 this.refillid,
// this.refilldate,
this.splitContainer1.Panel1.Controls.Add(this.txtPatientID); this.patientid,
this.splitContainer1.Panel1.Controls.Add(this.txtDate); this.medicationid,
this.splitContainer1.Panel1.Controls.Add(this.btnSearch); this.rxnumber});
this.splitContainer1.Panel1.Controls.Add(this.lblPatientID); this.dgvRefills.ContextMenuStrip = this.cmuRefill;
this.splitContainer1.Panel1.Controls.Add(this.lblDate); this.dgvRefills.Location = new System.Drawing.Point(12, 12);
// this.dgvRefills.Name = "dgvRefills";
// splitContainer1.Panel2 this.dgvRefills.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
// this.dgvRefills.Size = new System.Drawing.Size(613, 298);
this.splitContainer1.Panel2.Controls.Add(this.dgvRefills); this.dgvRefills.TabIndex = 1;
this.splitContainer1.Size = new System.Drawing.Size(631, 498);
this.splitContainer1.SplitterDistance = 249;
this.splitContainer1.TabIndex = 1;
//
// txtPatientID
//
this.txtPatientID.Location = new System.Drawing.Point(203, 120);
this.txtPatientID.Name = "txtPatientID";
this.txtPatientID.Size = new System.Drawing.Size(100, 20);
this.txtPatientID.TabIndex = 4;
//
// txtDate
//
this.txtDate.Location = new System.Drawing.Point(203, 51);
this.txtDate.Name = "txtDate";
this.txtDate.Size = new System.Drawing.Size(100, 20);
this.txtDate.TabIndex = 3;
//
// btnSearch
//
this.btnSearch.Location = new System.Drawing.Point(106, 190);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(75, 23);
this.btnSearch.TabIndex = 2;
this.btnSearch.Text = "Search";
this.btnSearch.UseVisualStyleBackColor = true;
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
//
// lblPatientID
//
this.lblPatientID.AutoSize = true;
this.lblPatientID.Location = new System.Drawing.Point(62, 120);
this.lblPatientID.Name = "lblPatientID";
this.lblPatientID.Size = new System.Drawing.Size(57, 13);
this.lblPatientID.TabIndex = 1;
this.lblPatientID.Text = "Patient ID:";
//
// lblDate
//
this.lblDate.AutoSize = true;
this.lblDate.Location = new System.Drawing.Point(59, 51);
this.lblDate.Name = "lblDate";
this.lblDate.Size = new System.Drawing.Size(71, 13);
this.lblDate.TabIndex = 0;
this.lblDate.Text = "Date of Refill:";
// //
// refillid // refillid
// //
@ -277,20 +204,15 @@ namespace Louis__Pharmacy_CNSA212_FP
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(655, 522); this.ClientSize = new System.Drawing.Size(637, 322);
this.Controls.Add(this.splitContainer1); this.Controls.Add(this.dgvRefills);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2); this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmRefill"; this.Name = "frmRefill";
this.Text = "Louis\' Pharmacy - Prescription Refill"; this.Text = "Louis\' Pharmacy - Prescription Refill";
this.Load += new System.EventHandler(this.frmRefill_Load); //this.Load += new System.EventHandler(this.frmRefill_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvRefills)).EndInit();
this.cmuRefill.ResumeLayout(false); this.cmuRefill.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dgvRefills)).EndInit();
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -323,17 +245,11 @@ namespace Louis__Pharmacy_CNSA212_FP
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn14; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;
private System.Windows.Forms.DataGridView dgvRefills;
private System.Windows.Forms.ContextMenuStrip cmuRefill; private System.Windows.Forms.ContextMenuStrip cmuRefill;
private System.Windows.Forms.ToolStripMenuItem cmuAdd; private System.Windows.Forms.ToolStripMenuItem cmuAdd;
private System.Windows.Forms.ToolStripMenuItem cmuUpdate; private System.Windows.Forms.ToolStripMenuItem cmuUpdate;
private System.Windows.Forms.ToolStripMenuItem cmuDelete; private System.Windows.Forms.ToolStripMenuItem cmuDelete;
private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.DataGridView dgvRefills;
private System.Windows.Forms.TextBox txtPatientID;
private System.Windows.Forms.TextBox txtDate;
private System.Windows.Forms.Button btnSearch;
private System.Windows.Forms.Label lblPatientID;
private System.Windows.Forms.Label lblDate;
private System.Windows.Forms.DataGridViewTextBoxColumn refillid; private System.Windows.Forms.DataGridViewTextBoxColumn refillid;
private System.Windows.Forms.DataGridViewTextBoxColumn refilldate; private System.Windows.Forms.DataGridViewTextBoxColumn refilldate;
private System.Windows.Forms.DataGridViewTextBoxColumn patientid; private System.Windows.Forms.DataGridViewTextBoxColumn patientid;

View File

@ -24,93 +24,93 @@ namespace Louis__Pharmacy_CNSA212_FP
InitializeComponent(); InitializeComponent();
} }
private void rEFILLSBindingNavigatorSaveItem_Click(object sender, EventArgs e) //private void rEFILLSBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{ //{
} //}
private void frmRefill_Load(object sender, EventArgs e) //private void frmRefill_Load(object sender, EventArgs e)
{ //{
dgvRefills.Visible = false; // dgvRefills.Visible = false;
} //}
private void btnSearch_Click(object sender, EventArgs e) //private void btnSearch_Click(object sender, EventArgs e)
{ //{
string patientID = ""; // string patientID = "";
DateTime date = new DateTime(); // DateTime date = new DateTime();
try // try
{ // {
DataSet ds = new DataSet(); //DataSet ds = new DataSet();
//PharmacyDataTier phaDT = new PharmacyDataTier(); //PharmacyDataTier phaDT = new PharmacyDataTier();
patientID = txtPatientID.Text.Trim(); //patientID = txtPatientID.Text.Trim();
if (txtDate.Text.Trim().Length > 0) //if (txtDate.Text.Trim().Length > 0)
{ //{
date = DateTime.Parse(txtDate.Text.Trim()); //date = DateTime.Parse(txtDate.Text.Trim());
} //}
ds = PharmacyDataTier.RefillSearch(date, patientID); // ds = PharmacyDataTier.RefillSearch(date, patientID);
if (ds.Tables[0].Rows.Count > 0 ) // if (ds.Tables[0].Rows.Count > 0 )
{ // {
dgvRefills.Visible = true; // dgvRefills.Visible = true;
dgvRefills.DataSource = ds.Tables[0]; // dgvRefills.DataSource = ds.Tables[0];
dgvRefills.AlternatingRowsDefaultCellStyle.BackColor = Color.Black; // dgvRefills.AlternatingRowsDefaultCellStyle.BackColor = Color.Black;
dgvRefills.AlternatingRowsDefaultCellStyle.ForeColor = Color.White; // dgvRefills.AlternatingRowsDefaultCellStyle.ForeColor = Color.White;
} // }
else // else
{ // {
dgvRefills.Visible = false; // dgvRefills.Visible = false;
MessageBox.Show("No records found"); // MessageBox.Show("No records found");
} // }
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
} // }
} //}
private void cmuAdd_Click(object sender, EventArgs e) //private void cmuAdd_Click(object sender, EventArgs e)
{ //{
frmRefillAdd refillAdd = new frmRefillAdd(true); // frmRefillAdd refillAdd = new frmRefillAdd(true);
refillAdd.MdiParent = MdiParent; // refillAdd.MdiParent = MdiParent;
refillAdd.StartPosition = FormStartPosition.CenterScreen; // refillAdd.StartPosition = FormStartPosition.CenterScreen;
refillAdd.Show(); // refillAdd.Show();
refillAdd.Focus(); // refillAdd.Focus();
} //}
private void cmuUpdate_Click(object sender, EventArgs e) //private void cmuUpdate_Click(object sender, EventArgs e)
{ //{
string refillID = ""; // string refillID = "";
if (dgvRefills.Rows.Count > 0) // if (dgvRefills.Rows.Count > 0)
{ // {
//dgvRefills.DataSource = ds.Tables[0]; // //dgvRefills.DataSource = ds.Tables[0];
DataGridViewRow row = new DataGridViewRow(); // DataGridViewRow row = new DataGridViewRow();
row = dgvRefills.SelectedRows[0]; // row = dgvRefills.SelectedRows[0];
refillID = (row.Cells[0].Value).ToString(); // refillID = (row.Cells[0].Value).ToString();
frmRefillAdd refillUpdate = new frmRefillAdd(false); // frmRefillAdd refillUpdate = new frmRefillAdd(false);
refillUpdate.MdiParent = MdiParent; // refillUpdate.MdiParent = MdiParent;
refillUpdate.StartPosition = FormStartPosition.CenterScreen; // refillUpdate.StartPosition = FormStartPosition.CenterScreen;
refillUpdate.Show(); // refillUpdate.Show();
refillUpdate.Focus(); // refillUpdate.Focus();
refillUpdate.FillRefill(refillID); // refillUpdate.FillRefill(refillID);
} // }
} //}
private void cmuDelete_Click(object sender, EventArgs e) //private void cmuDelete_Click(object sender, EventArgs e)
{ //{
string refillID = ""; // string refillID = "";
//dgvRefills.DataSource = ds.Tables[0]; // //dgvRefills.DataSource = ds.Tables[0];
DataGridViewRow row = new DataGridViewRow(); // DataGridViewRow row = new DataGridViewRow();
row = dgvRefills.SelectedRows[0]; // row = dgvRefills.SelectedRows[0];
refillID = (row.Cells[0].Value).ToString(); // refillID = (row.Cells[0].Value).ToString();
PharmacyDataTier.DeleteRefill(refillID); // PharmacyDataTier.DeleteRefill(refillID);
btnSearch_Click(sender, e); // btnSearch_Click(sender, e);
} //}
} }
} }

View File

@ -117,6 +117,9 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="cmuRefill.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="refillid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="refillid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
@ -132,9 +135,6 @@
<metadata name="rxnumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="rxnumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="cmuRefill.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>