pushing between work and lab

This commit is contained in:
caschick221 2024-02-19 16:27:27 -05:00
parent 9748456039
commit 464bd14c0a
9 changed files with 506 additions and 1684 deletions

View File

@ -65,6 +65,12 @@
<Compile Include="frmMain.Designer.cs">
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="frmMedication.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmMedication.Designer.cs">
<DependentUpon>frmMedication.cs</DependentUpon>
</Compile>
<Compile Include="frmPatient.cs">
<SubType>Form</SubType>
</Compile>
@ -83,12 +89,6 @@
<Compile Include="frmPhysician.Designer.cs">
<DependentUpon>frmPhysician.cs</DependentUpon>
</Compile>
<Compile Include="frmPrescription.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmPrescription.Designer.cs">
<DependentUpon>frmPrescription.cs</DependentUpon>
</Compile>
<Compile Include="frmRefill.cs">
<SubType>Form</SubType>
</Compile>
@ -119,6 +119,9 @@
<EmbeddedResource Include="frmMain.resx">
<DependentUpon>frmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmMedication.resx">
<DependentUpon>frmMedication.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmPatient.resx">
<DependentUpon>frmPatient.cs</DependentUpon>
</EmbeddedResource>
@ -128,9 +131,6 @@
<EmbeddedResource Include="frmPhysician.resx">
<DependentUpon>frmPhysician.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmPrescription.resx">
<DependentUpon>frmPrescription.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmRefill.resx">
<DependentUpon>frmRefill.cs</DependentUpon>
</EmbeddedResource>

View File

@ -65,13 +65,13 @@ namespace Louis__Pharmacy_CNSA212_FP
this.cmuPatientNew = new System.Windows.Forms.ToolStripMenuItem();
this.cmuPatientEdit = new System.Windows.Forms.ToolStripMenuItem();
this.cmuPatientDelete = new System.Windows.Forms.ToolStripMenuItem();
this.tbpPrescription = new System.Windows.Forms.TabPage();
this.tbpMedication = new System.Windows.Forms.TabPage();
this.splcPrescription = new System.Windows.Forms.SplitContainer();
this.btnPrescriptionSearch = new System.Windows.Forms.Button();
this.btnMedicationSearch = new System.Windows.Forms.Button();
this.txtPrescriptionPatID = new System.Windows.Forms.TextBox();
this.txtRxNumber = new System.Windows.Forms.TextBox();
this.lblPrescriptionPatID = new System.Windows.Forms.Label();
this.lblRxNumber = new System.Windows.Forms.Label();
this.lblDisMedicationNum = new System.Windows.Forms.Label();
this.dgvPrescription = new System.Windows.Forms.DataGridView();
this.RxNum_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.numRefills = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -119,7 +119,7 @@ namespace Louis__Pharmacy_CNSA212_FP
this.splcPatient.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvPatient)).BeginInit();
this.cmuPatient.SuspendLayout();
this.tbpPrescription.SuspendLayout();
this.tbpMedication.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splcPrescription)).BeginInit();
this.splcPrescription.Panel1.SuspendLayout();
this.splcPrescription.Panel2.SuspendLayout();
@ -178,7 +178,7 @@ namespace Louis__Pharmacy_CNSA212_FP
// tbcInfo
//
this.tbcInfo.Controls.Add(this.tbpPatient);
this.tbcInfo.Controls.Add(this.tbpPrescription);
this.tbcInfo.Controls.Add(this.tbpMedication);
this.tbcInfo.Controls.Add(this.tbpPhysician);
this.tbcInfo.Location = new System.Drawing.Point(18, 18);
this.tbcInfo.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
@ -195,7 +195,7 @@ namespace Louis__Pharmacy_CNSA212_FP
this.tbpPatient.Name = "tbpPatient";
this.tbpPatient.Size = new System.Drawing.Size(1103, 752);
this.tbpPatient.TabIndex = 3;
this.tbpPatient.Text = "Patient Info";
this.tbpPatient.Text = "Patients";
this.tbpPatient.UseVisualStyleBackColor = true;
//
// splcPatient
@ -457,16 +457,16 @@ namespace Louis__Pharmacy_CNSA212_FP
this.cmuPatientDelete.Text = "Delete";
this.cmuPatientDelete.Click += new System.EventHandler(this.cmuPatientDelete_Click);
//
// tbpPrescription
// tbpMedication
//
this.tbpPrescription.Controls.Add(this.splcPrescription);
this.tbpPrescription.Location = new System.Drawing.Point(4, 29);
this.tbpPrescription.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tbpPrescription.Name = "tbpPrescription";
this.tbpPrescription.Size = new System.Drawing.Size(1103, 752);
this.tbpPrescription.TabIndex = 4;
this.tbpPrescription.Text = "Prescription Info";
this.tbpPrescription.UseVisualStyleBackColor = true;
this.tbpMedication.Controls.Add(this.splcPrescription);
this.tbpMedication.Location = new System.Drawing.Point(4, 29);
this.tbpMedication.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tbpMedication.Name = "tbpMedication";
this.tbpMedication.Size = new System.Drawing.Size(1103, 752);
this.tbpMedication.TabIndex = 4;
this.tbpMedication.Text = "Medications";
this.tbpMedication.UseVisualStyleBackColor = true;
//
// splcPrescription
//
@ -478,11 +478,11 @@ namespace Louis__Pharmacy_CNSA212_FP
//
// splcPrescription.Panel1
//
this.splcPrescription.Panel1.Controls.Add(this.btnPrescriptionSearch);
this.splcPrescription.Panel1.Controls.Add(this.btnMedicationSearch);
this.splcPrescription.Panel1.Controls.Add(this.txtPrescriptionPatID);
this.splcPrescription.Panel1.Controls.Add(this.txtRxNumber);
this.splcPrescription.Panel1.Controls.Add(this.lblPrescriptionPatID);
this.splcPrescription.Panel1.Controls.Add(this.lblRxNumber);
this.splcPrescription.Panel1.Controls.Add(this.lblDisMedicationNum);
//
// splcPrescription.Panel2
//
@ -492,16 +492,16 @@ namespace Louis__Pharmacy_CNSA212_FP
this.splcPrescription.SplitterWidth = 6;
this.splcPrescription.TabIndex = 0;
//
// btnPrescriptionSearch
// btnMedicationSearch
//
this.btnPrescriptionSearch.Location = new System.Drawing.Point(96, 180);
this.btnPrescriptionSearch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.btnPrescriptionSearch.Name = "btnPrescriptionSearch";
this.btnPrescriptionSearch.Size = new System.Drawing.Size(112, 35);
this.btnPrescriptionSearch.TabIndex = 4;
this.btnPrescriptionSearch.Text = "Search";
this.btnPrescriptionSearch.UseVisualStyleBackColor = true;
this.btnPrescriptionSearch.Click += new System.EventHandler(this.btnPrescriptionSearch_Click);
this.btnMedicationSearch.Location = new System.Drawing.Point(96, 180);
this.btnMedicationSearch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.btnMedicationSearch.Name = "btnMedicationSearch";
this.btnMedicationSearch.Size = new System.Drawing.Size(112, 35);
this.btnMedicationSearch.TabIndex = 4;
this.btnMedicationSearch.Text = "Search";
this.btnMedicationSearch.UseVisualStyleBackColor = true;
this.btnMedicationSearch.Click += new System.EventHandler(this.btnPrescriptionSearch_Click);
//
// txtPrescriptionPatID
//
@ -513,7 +513,7 @@ namespace Louis__Pharmacy_CNSA212_FP
//
// txtRxNumber
//
this.txtRxNumber.Location = new System.Drawing.Point(276, 38);
this.txtRxNumber.Location = new System.Drawing.Point(276, 78);
this.txtRxNumber.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txtRxNumber.Name = "txtRxNumber";
this.txtRxNumber.Size = new System.Drawing.Size(148, 26);
@ -529,14 +529,14 @@ namespace Louis__Pharmacy_CNSA212_FP
this.lblPrescriptionPatID.TabIndex = 1;
this.lblPrescriptionPatID.Text = "Patient ID:";
//
// lblRxNumber
// lblDisMedicationNum
//
this.lblRxNumber.AutoSize = true;
this.lblRxNumber.Location = new System.Drawing.Point(92, 38);
this.lblRxNumber.Name = "lblRxNumber";
this.lblRxNumber.Size = new System.Drawing.Size(92, 20);
this.lblRxNumber.TabIndex = 0;
this.lblRxNumber.Text = "Rx Number:";
this.lblDisMedicationNum.AutoSize = true;
this.lblDisMedicationNum.Location = new System.Drawing.Point(92, 78);
this.lblDisMedicationNum.Name = "lblDisMedicationNum";
this.lblDisMedicationNum.Size = new System.Drawing.Size(150, 20);
this.lblDisMedicationNum.TabIndex = 0;
this.lblDisMedicationNum.Text = "Medication Number:";
//
// dgvPrescription
//
@ -549,7 +549,8 @@ namespace Louis__Pharmacy_CNSA212_FP
this.dgvPrescription.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.dgvPrescription.Name = "dgvPrescription";
this.dgvPrescription.RowHeadersWidth = 51;
this.dgvPrescription.Size = new System.Drawing.Size(978, 300);
this.dgvPrescription.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvPrescription.Size = new System.Drawing.Size(1095, 365);
this.dgvPrescription.TabIndex = 0;
//
// RxNum_id
@ -620,18 +621,21 @@ namespace Louis__Pharmacy_CNSA212_FP
this.cmuRxNew.Name = "cmuRxNew";
this.cmuRxNew.Size = new System.Drawing.Size(134, 30);
this.cmuRxNew.Text = "New";
this.cmuRxNew.Click += new System.EventHandler(this.cmuRxNew_Click);
//
// cmuRxEdit
//
this.cmuRxEdit.Name = "cmuRxEdit";
this.cmuRxEdit.Size = new System.Drawing.Size(134, 30);
this.cmuRxEdit.Text = "Edit";
this.cmuRxEdit.Click += new System.EventHandler(this.cmuRxEdit_Click);
//
// cmuRxDelete
//
this.cmuRxDelete.Name = "cmuRxDelete";
this.cmuRxDelete.Size = new System.Drawing.Size(134, 30);
this.cmuRxDelete.Text = "Delete";
this.cmuRxDelete.Click += new System.EventHandler(this.cmuRxDelete_Click);
//
// tbpPhysician
//
@ -642,7 +646,7 @@ namespace Louis__Pharmacy_CNSA212_FP
this.tbpPhysician.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tbpPhysician.Size = new System.Drawing.Size(1103, 752);
this.tbpPhysician.TabIndex = 2;
this.tbpPhysician.Text = "Physician Info";
this.tbpPhysician.Text = "Physicians";
this.tbpPhysician.UseVisualStyleBackColor = true;
//
// splcPhysician
@ -885,7 +889,7 @@ namespace Louis__Pharmacy_CNSA212_FP
this.splcPatient.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvPatient)).EndInit();
this.cmuPatient.ResumeLayout(false);
this.tbpPrescription.ResumeLayout(false);
this.tbpMedication.ResumeLayout(false);
this.splcPrescription.Panel1.ResumeLayout(false);
this.splcPrescription.Panel1.PerformLayout();
this.splcPrescription.Panel2.ResumeLayout(false);
@ -923,15 +927,15 @@ namespace Louis__Pharmacy_CNSA212_FP
private System.Windows.Forms.TabPage tbpPhysician;
private System.Windows.Forms.SplitContainer splcPhysician;
private System.Windows.Forms.TabPage tbpPatient;
private System.Windows.Forms.TabPage tbpPrescription;
private System.Windows.Forms.TabPage tbpMedication;
private System.Windows.Forms.SplitContainer splcPatient;
private System.Windows.Forms.SplitContainer splcPrescription;
private System.Windows.Forms.Button btnPatientSearch;
private System.Windows.Forms.TextBox txtRxNumber;
private System.Windows.Forms.Label lblPrescriptionPatID;
private System.Windows.Forms.Label lblRxNumber;
private System.Windows.Forms.Label lblDisMedicationNum;
private System.Windows.Forms.TextBox txtPrescriptionPatID;
private System.Windows.Forms.Button btnPrescriptionSearch;
private System.Windows.Forms.Button btnMedicationSearch;
private System.Windows.Forms.Button btnPhysicianSearch;
private System.Windows.Forms.TextBox txtPatientLast;
private System.Windows.Forms.TextBox txtPatientFirst;

View File

@ -24,6 +24,7 @@ namespace Louis__Pharmacy_CNSA212_FP
dgvPatient.DoubleClick += cmuPatientEdit_Click;
dgvPhysician.DoubleClick += cmuPhysicianEdit_Click;
dgvPrescription.DoubleClick += cmuRxEdit_Click;
tbcInfo.SelectedIndexChanged += frmInfoTabChange;
@ -45,8 +46,9 @@ namespace Louis__Pharmacy_CNSA212_FP
}
private bool physicianIsActive = false;
private bool patientIsActive = false;
private bool physicianIsActive;
private bool patientIsActive;
private bool medicationIsActive;
private void frmInfoTabChange(object sender, EventArgs e)
{
@ -54,11 +56,18 @@ namespace Louis__Pharmacy_CNSA212_FP
patientIsActive = false;
physicianIsActive = false;
medicationIsActive = false;
if (tbcInfo.SelectedIndex == 0)
{
patientIsActive = true;
}else if (tbcInfo.SelectedIndex == 2)
}
else if (tbcInfo.SelectedIndex == 1)
{
medicationIsActive = true;
}
else if (tbcInfo.SelectedIndex == 2)
{
physicianIsActive = true;
}
@ -67,11 +76,13 @@ namespace Louis__Pharmacy_CNSA212_FP
private void frmInfo_KeyDown(object sender, KeyEventArgs e)
{
// if data grid view is not focused, run the search function
if (e.KeyCode == Keys.Escape)
{this.Close();
}
// if data grid view is not focused, run the search function
if (e.KeyCode == Keys.Enter && physicianIsActive && !dgvPhysician.Focused){
btnPhysicianSearch_Click(sender, e);
}
@ -81,6 +92,8 @@ namespace Louis__Pharmacy_CNSA212_FP
cmuPhysicianEdit_Click(sender, e);
}
// if data grid view is not focused, run the search function
if (e.KeyCode == Keys.Enter && patientIsActive && !dgvPatient.Focused)
{
@ -94,6 +107,19 @@ namespace Louis__Pharmacy_CNSA212_FP
// if data grid view is not focused, run the search function
if (e.KeyCode == Keys.Enter && medicationIsActive && !dgvPrescription.Focused)
{
btnPrescriptionSearch_Click(sender,e);
}
// if data grid view is focused, run the edit function
else if (e.KeyCode == Keys.Enter && medicationIsActive && dgvPrescription.Focused)
{
cmuRxEdit_Click(sender,e);
}
}
private void addUpdatePatientAndPhysicianToolStripMenuItem_Click(object sender, EventArgs e)
@ -247,7 +273,7 @@ namespace Louis__Pharmacy_CNSA212_FP
catch (Exception exception)
{
ep1.SetError(btnPrescriptionSearch, "Error Searching");
ep1.SetError(btnMedicationSearch, "Error Searching");
}
@ -474,5 +500,38 @@ namespace Louis__Pharmacy_CNSA212_FP
private void dgvPhysician_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
{
}
private void cmuRxNew_Click(object sender, EventArgs e)
{
frmMedication medicationAdd = new frmMedication(this, true);
medicationAdd.MdiParent = MdiParent;
medicationAdd.StartPosition = FormStartPosition.CenterScreen;
medicationAdd.Show();
medicationAdd.Focus();
}
private void cmuRxEdit_Click(object sender, EventArgs e)
{
if (dgvPhysician.Rows.Count > 0)
{
dgvPrescription.DataSource = ds.Tables[0];
DataGridViewRow row = new DataGridViewRow();
row = dgvPrescription.SelectedRows[0];
string rxID = "";
rxID = (row.Cells[0].Value).ToString();
frmMedication prescriptionAdd = new frmMedication(this, false);
prescriptionAdd.MdiParent = MdiParent;
prescriptionAdd.StartPosition = FormStartPosition.CenterScreen;
prescriptionAdd.Show();
prescriptionAdd.Focus();
prescriptionAdd.FillMedication(rxID);
}
}
private void cmuRxDelete_Click(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,241 @@
using System.ComponentModel;
namespace Louis__Pharmacy_CNSA212_FP
{
partial class frmMedication
{
/// <summary>
/// Required designer variable.
/// </summary>
private IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.btnGO = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label8 = new System.Windows.Forms.Label();
this.txtMedID = new System.Windows.Forms.TextBox();
this.txtName = new System.Windows.Forms.TextBox();
this.txtIntake = new System.Windows.Forms.TextBox();
this.txtFrequency = new System.Windows.Forms.TextBox();
this.txtDosage = new System.Windows.Forms.TextBox();
this.txtPurpose = new System.Windows.Forms.TextBox();
this.txtRxNum = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(333, 157);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(163, 43);
this.label1.TabIndex = 0;
this.label1.Text = "Medication ID:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label2
//
this.label2.Location = new System.Drawing.Point(333, 200);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(163, 43);
this.label2.TabIndex = 1;
this.label2.Text = "Name:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label3
//
this.label3.Location = new System.Drawing.Point(333, 243);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(163, 43);
this.label3.TabIndex = 2;
this.label3.Text = "Intake Method:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label4
//
this.label4.Location = new System.Drawing.Point(333, 286);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(163, 43);
this.label4.TabIndex = 3;
this.label4.Text = "Frequency:";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label5
//
this.label5.Location = new System.Drawing.Point(333, 329);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(163, 43);
this.label5.TabIndex = 4;
this.label5.Text = "Dosage:";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label6
//
this.label6.Location = new System.Drawing.Point(333, 372);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(163, 43);
this.label6.TabIndex = 5;
this.label6.Text = "Purpose:";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label7
//
this.label7.Location = new System.Drawing.Point(333, 415);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(163, 43);
this.label7.TabIndex = 6;
this.label7.Text = "Rx Number:";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnGO
//
this.btnGO.Location = new System.Drawing.Point(767, 567);
this.btnGO.Name = "btnGO";
this.btnGO.Size = new System.Drawing.Size(101, 36);
this.btnGO.TabIndex = 7;
this.btnGO.UseVisualStyleBackColor = true;
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(896, 567);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(101, 36);
this.btnCancel.TabIndex = 8;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// label8
//
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label8.Location = new System.Drawing.Point(176, 30);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(691, 72);
this.label8.TabIndex = 9;
this.label8.Text = "Medication";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// txtMedID
//
this.txtMedID.Location = new System.Drawing.Point(502, 165);
this.txtMedID.Name = "txtMedID";
this.txtMedID.Size = new System.Drawing.Size(182, 26);
this.txtMedID.TabIndex = 10;
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(502, 208);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(182, 26);
this.txtName.TabIndex = 11;
//
// txtIntake
//
this.txtIntake.Location = new System.Drawing.Point(502, 251);
this.txtIntake.Name = "txtIntake";
this.txtIntake.Size = new System.Drawing.Size(182, 26);
this.txtIntake.TabIndex = 12;
//
// txtFrequency
//
this.txtFrequency.Location = new System.Drawing.Point(502, 294);
this.txtFrequency.Name = "txtFrequency";
this.txtFrequency.Size = new System.Drawing.Size(182, 26);
this.txtFrequency.TabIndex = 13;
//
// txtDosage
//
this.txtDosage.Location = new System.Drawing.Point(502, 337);
this.txtDosage.Name = "txtDosage";
this.txtDosage.Size = new System.Drawing.Size(182, 26);
this.txtDosage.TabIndex = 14;
//
// txtPurpose
//
this.txtPurpose.Location = new System.Drawing.Point(502, 380);
this.txtPurpose.Name = "txtPurpose";
this.txtPurpose.Size = new System.Drawing.Size(182, 26);
this.txtPurpose.TabIndex = 15;
//
// txtRxNum
//
this.txtRxNum.Location = new System.Drawing.Point(502, 423);
this.txtRxNum.Name = "txtRxNum";
this.txtRxNum.Size = new System.Drawing.Size(182, 26);
this.txtRxNum.TabIndex = 16;
//
// frmMedication
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1041, 649);
this.Controls.Add(this.txtRxNum);
this.Controls.Add(this.txtPurpose);
this.Controls.Add(this.txtDosage);
this.Controls.Add(this.txtFrequency);
this.Controls.Add(this.txtIntake);
this.Controls.Add(this.txtName);
this.Controls.Add(this.txtMedID);
this.Controls.Add(this.label8);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnGO);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "frmMedication";
this.Text = "frmMedication";
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.TextBox txtMedID;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.TextBox txtIntake;
private System.Windows.Forms.TextBox txtFrequency;
private System.Windows.Forms.TextBox txtDosage;
private System.Windows.Forms.TextBox txtPurpose;
private System.Windows.Forms.TextBox txtRxNum;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button btnGO;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label8;
#endregion
}
}

View File

@ -0,0 +1,28 @@
using System.Windows.Forms;
using System.Data;
namespace Louis__Pharmacy_CNSA212_FP
{
public partial class frmMedication : Form
{
public frmMedication(frmInfo sourceForm, bool isNew)
{
InitializeComponent();
}
public void FillMedication(string rxID)
{
var ds = new DataSet();
var data = new PharmacyDataTier();
ds = PharmacyDataTier.MedicationInfoSearch(rxID);
txtMedID.Text = ds.Tables[0].Rows[0]["Medication_id"].ToString();
txtName.Text = ds.Tables[0].Rows[0]["MedicationName"].ToString();
txtIntake.Text = ds.Tables[0].Rows[0]["IntakeMethod"].ToString();
txtFrequency.Text = ds.Tables[0].Rows[0]["Frequency"].ToString();
txtDosage.Text = ds.Tables[0].Rows[0]["Dosage"].ToString();
txtPurpose.Text = ds.Tables[0].Rows[0]["Purpose"].ToString();
txtRxNum.Text = ds.Tables[0].Rows[0]["RxNum"].ToString();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,217 +0,0 @@

namespace Louis__Pharmacy_CNSA212_FP
{
partial class frmPrescription
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmPrescription));
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.dgvPrescriptions = new System.Windows.Forms.DataGridView();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnSearch = new System.Windows.Forms.Button();
this.lblLastName = new System.Windows.Forms.Label();
this.lblRxNumber = new System.Windows.Forms.Label();
this.lblFirstName = new System.Windows.Forms.Label();
this.txtPatientRx = new System.Windows.Forms.TextBox();
this.txtPatientLast = new System.Windows.Forms.TextBox();
this.txtPatientFirst = new System.Windows.Forms.TextBox();
this.ep1 = new System.Windows.Forms.ErrorProvider(this.components);
this.cmuPrescriptionEdit = new System.Windows.Forms.ToolStripMenuItem();
this.cmuPrescriptionDelete = new System.Windows.Forms.ToolStripMenuItem();
this.cmuPrescriptionAdd = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvPrescriptions)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ep1)).BeginInit();
this.SuspendLayout();
//
// contextMenuStrip1
//
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmuPrescriptionAdd,
this.cmuPrescriptionEdit,
this.cmuPrescriptionDelete});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(123, 76);
//
// dgvPrescriptions
//
this.dgvPrescriptions.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPrescriptions.Location = new System.Drawing.Point(0, 3);
this.dgvPrescriptions.Name = "dgvPrescriptions";
this.dgvPrescriptions.RowHeadersWidth = 51;
this.dgvPrescriptions.RowTemplate.Height = 24;
this.dgvPrescriptions.Size = new System.Drawing.Size(878, 263);
this.dgvPrescriptions.TabIndex = 2;
//
// splitContainer1
//
this.splitContainer1.Location = new System.Drawing.Point(13, 12);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnSearch);
this.splitContainer1.Panel1.Controls.Add(this.lblLastName);
this.splitContainer1.Panel1.Controls.Add(this.lblRxNumber);
this.splitContainer1.Panel1.Controls.Add(this.lblFirstName);
this.splitContainer1.Panel1.Controls.Add(this.txtPatientRx);
this.splitContainer1.Panel1.Controls.Add(this.txtPatientLast);
this.splitContainer1.Panel1.Controls.Add(this.txtPatientFirst);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.dgvPrescriptions);
this.splitContainer1.Size = new System.Drawing.Size(881, 546);
this.splitContainer1.SplitterDistance = 273;
this.splitContainer1.TabIndex = 3;
//
// btnSearch
//
this.btnSearch.Location = new System.Drawing.Point(35, 213);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(93, 28);
this.btnSearch.TabIndex = 6;
this.btnSearch.Text = "Search";
this.btnSearch.UseVisualStyleBackColor = true;
//
// lblLastName
//
this.lblLastName.Location = new System.Drawing.Point(16, 101);
this.lblLastName.Name = "lblLastName";
this.lblLastName.Size = new System.Drawing.Size(100, 23);
this.lblLastName.TabIndex = 5;
this.lblLastName.Text = "Last Name:";
this.lblLastName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblRxNumber
//
this.lblRxNumber.Location = new System.Drawing.Point(16, 154);
this.lblRxNumber.Name = "lblRxNumber";
this.lblRxNumber.Size = new System.Drawing.Size(100, 23);
this.lblRxNumber.TabIndex = 4;
this.lblRxNumber.Text = "Rx Number:";
this.lblRxNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblFirstName
//
this.lblFirstName.Location = new System.Drawing.Point(16, 55);
this.lblFirstName.Name = "lblFirstName";
this.lblFirstName.Size = new System.Drawing.Size(100, 23);
this.lblFirstName.TabIndex = 3;
this.lblFirstName.Text = "First Name:";
this.lblFirstName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtPatientRx
//
this.txtPatientRx.Location = new System.Drawing.Point(122, 154);
this.txtPatientRx.Name = "txtPatientRx";
this.txtPatientRx.Size = new System.Drawing.Size(148, 22);
this.txtPatientRx.TabIndex = 2;
//
// txtPatientLast
//
this.txtPatientLast.Location = new System.Drawing.Point(122, 101);
this.txtPatientLast.Name = "txtPatientLast";
this.txtPatientLast.Size = new System.Drawing.Size(148, 22);
this.txtPatientLast.TabIndex = 1;
//
// txtPatientFirst
//
this.txtPatientFirst.Location = new System.Drawing.Point(122, 56);
this.txtPatientFirst.Name = "txtPatientFirst";
this.txtPatientFirst.Size = new System.Drawing.Size(148, 22);
this.txtPatientFirst.TabIndex = 0;
//
// ep1
//
this.ep1.ContainerControl = this;
//
// cmuPrescriptionEdit
//
this.cmuPrescriptionEdit.Name = "cmuPrescriptionEdit";
this.cmuPrescriptionEdit.Size = new System.Drawing.Size(122, 24);
this.cmuPrescriptionEdit.Text = "Edit";
//
// cmuPrescriptionDelete
//
this.cmuPrescriptionDelete.Name = "cmuPrescriptionDelete";
this.cmuPrescriptionDelete.Size = new System.Drawing.Size(122, 24);
this.cmuPrescriptionDelete.Text = "Delete";
//
// cmuPrescriptionAdd
//
this.cmuPrescriptionAdd.Name = "cmuPrescriptionAdd";
this.cmuPrescriptionAdd.Size = new System.Drawing.Size(122, 24);
this.cmuPrescriptionAdd.Text = "Add";
//
// frmPrescription
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(981, 570);
this.Controls.Add(this.splitContainer1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "frmPrescription";
this.Text = "Louis\' Pharmacy - Add / Update Prescription";
this.Load += new System.EventHandler(this.frmPrescription_Load);
this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvPrescriptions)).EndInit();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ep1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.DataGridView dgvPrescriptions;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TextBox txtPatientFirst;
private System.Windows.Forms.TextBox txtPatientRx;
private System.Windows.Forms.TextBox txtPatientLast;
private System.Windows.Forms.Label lblFirstName;
private System.Windows.Forms.Label lblLastName;
private System.Windows.Forms.Label lblRxNumber;
private System.Windows.Forms.Button btnSearch;
private System.Windows.Forms.ErrorProvider ep1;
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionEdit;
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionDelete;
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionAdd;
}
}

View File

@ -1,151 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Louis__Pharmacy_CNSA212_FP
{
public partial class frmPrescription : Form
{
public frmPrescription()
{
InitializeComponent();
}
private void btnPatientSearch_Click(object sender, EventArgs e)
{
string fname = "";
string lname = "";
string id = "";
DataSet ds = new DataSet();
if (txtPatientFirst.Text.Length + txtPatientLast.Text.Length + txtPatientRx.Text.Length > 0)
{
try
{
fname = txtPatientFirst.Text;
try
{
lname = txtPatientLast.Text;
try
{
id = txtPatientRx.Text;
try
{
ds = PharmacyDataTier.PatientInfoSearch(id, lname, fname);
if (ds.Tables[0].Rows.Count > 0) // There is a record.
{
dgvPrescriptions.Visible = true;
// Get data source.
dgvPrescriptions.DataSource = ds.Tables[0];
dgvPrescriptions.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen;
// Set the row and column header styles.
dgvPrescriptions.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
dgvPrescriptions.ColumnHeadersDefaultCellStyle.BackColor = Color.Green;
}
else
{
dgvPrescriptions.Visible = false; // Hide the DataGridView if no results are found.
MessageBox.Show("No records found.");
}
}
catch (Exception exception)
{
ep1.SetError(btnSearch, "Error Searching");
}
}
catch (Exception exception)
{
ep1.SetError(txtPatientRx, "Invalid Value");
}
}
catch (Exception exception)
{
ep1.SetError(txtPatientLast, "Invalid Value");
}
}
catch (Exception exception)
{
ep1.SetError(txtPatientFirst, "Invalid Value");
}
}
cmuPrescriptionEdit.Enabled = dgvPrescriptions.Rows.Count > 0;
cmuPrescriptionDelete.Enabled = dgvPrescriptions.Rows.Count > 0;
}
private void btnPrescriptionSearch_Click(object sender, EventArgs e)
{
}
private void btnPhysicianSearch_Click(object sender, EventArgs e)
{
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void frmPrescription_Load(object sender, EventArgs e)
{
}
private void frmPrescription_KeyDown(object sender, KeyEventArgs e)
{
// esc not funtional
if (e.KeyCode == Keys.Escape) // Check if the pressed key is Escape
{
this.Close(); // Close the form
}
if (e.KeyCode == Keys.Enter)
{
btnPatientSearch_Click(sender, e);
}
}
private void addToolStripMenuItem_Click(object sender, EventArgs e)
{
}
}
}

File diff suppressed because it is too large Load Diff