I think I have all 4 tabs working with add, update, and delete
This commit is contained in:
parent
9bb5379c29
commit
0f0255a5f6
@ -1205,8 +1205,8 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
string Medication_id,
|
string Medication_id,
|
||||||
string Physician_name,
|
string Physician_name,
|
||||||
string Physician_id,
|
string Physician_id,
|
||||||
string Completed_refills,
|
int Completed_refills,
|
||||||
string Max_refills)
|
int Max_refills)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -1221,12 +1221,12 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
cmdString.CommandText = "CreatePrescription";
|
cmdString.CommandText = "CreatePrescription";
|
||||||
|
|
||||||
cmdString.Parameters.Add("@Medication_id", SqlDbType.VarChar, 7).Value = Medication_id;
|
cmdString.Parameters.Add("@Medication_id", SqlDbType.VarChar, 7).Value = Medication_id;
|
||||||
cmdString.Parameters.Add("@numRefills", SqlDbType.VarChar, 60).Value = Completed_refills;
|
cmdString.Parameters.Add("@numRefills", SqlDbType.Int).Value = Completed_refills;
|
||||||
cmdString.Parameters.Add("@pastNumRefills", SqlDbType.VarChar, 30).Value = Max_refills;
|
cmdString.Parameters.Add("@pastNumRefills", SqlDbType.Int).Value = Max_refills;
|
||||||
cmdString.Parameters.Add("@PrescribedBy", SqlDbType.VarChar, 30).Value = Physician_name;
|
cmdString.Parameters.Add("@PrescribedBy", SqlDbType.VarChar, 30).Value = Physician_name;
|
||||||
cmdString.Parameters.Add("@Physician_id", SqlDbType.VarChar, 30).Value = Physician_id;
|
cmdString.Parameters.Add("@Physician_id", SqlDbType.VarChar, 8).Value = Physician_id;
|
||||||
cmdString.Parameters.Add("@Patient_id", SqlDbType.VarChar, 100).Value = Patient_id;
|
cmdString.Parameters.Add("@Patient_id", SqlDbType.VarChar, 8).Value = Patient_id;
|
||||||
cmdString.Parameters.Add("@RxNum", SqlDbType.VarChar, 30).Value = RxNum;
|
cmdString.Parameters.Add("@RxNum", SqlDbType.VarChar, 11).Value = RxNum;
|
||||||
|
|
||||||
cmdString.ExecuteNonQuery();
|
cmdString.ExecuteNonQuery();
|
||||||
|
|
||||||
@ -1247,8 +1247,8 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
string Medication_id,
|
string Medication_id,
|
||||||
string Physician_name,
|
string Physician_name,
|
||||||
string Physician_id,
|
string Physician_id,
|
||||||
string Completed_refills,
|
int Completed_refills,
|
||||||
string Max_refills)
|
int Max_refills)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
111
Louis'-Pharmacy_CNSA212-FP/frmInfo.Designer.cs
generated
111
Louis'-Pharmacy_CNSA212-FP/frmInfo.Designer.cs
generated
@ -117,7 +117,14 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.label2 = new System.Windows.Forms.Label();
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.btnRxSearch = new System.Windows.Forms.Button();
|
this.btnRxSearch = new System.Windows.Forms.Button();
|
||||||
this.dgvRx = new System.Windows.Forms.DataGridView();
|
this.dgvPrescription = new System.Windows.Forms.DataGridView();
|
||||||
|
this.RxNum_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.numRefills = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.pastNumRefills = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.PrescribedBy = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.Physician_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.Medicationid = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.Patientid = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.cmuPrescription = new System.Windows.Forms.ContextMenuStrip(this.components);
|
this.cmuPrescription = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
this.cmuPrescriptionNew = new System.Windows.Forms.ToolStripMenuItem();
|
this.cmuPrescriptionNew = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.cmuPrescriptionEdit = new System.Windows.Forms.ToolStripMenuItem();
|
this.cmuPrescriptionEdit = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
@ -151,7 +158,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
((System.ComponentModel.ISupportInitialize)(this.dgvPhysician)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dgvPhysician)).BeginInit();
|
||||||
this.cmuPhysician.SuspendLayout();
|
this.cmuPhysician.SuspendLayout();
|
||||||
this.tbcInfoPrescriptions.SuspendLayout();
|
this.tbcInfoPrescriptions.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dgvRx)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dgvPrescription)).BeginInit();
|
||||||
this.cmuPrescription.SuspendLayout();
|
this.cmuPrescription.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
@ -222,6 +229,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
//
|
//
|
||||||
// splcPatient.Panel1
|
// splcPatient.Panel1
|
||||||
//
|
//
|
||||||
|
this.splcPatient.Panel1.ContextMenuStrip = this.cmuPatient;
|
||||||
this.splcPatient.Panel1.Controls.Add(this.txtPatientID);
|
this.splcPatient.Panel1.Controls.Add(this.txtPatientID);
|
||||||
this.splcPatient.Panel1.Controls.Add(this.lblPatientID);
|
this.splcPatient.Panel1.Controls.Add(this.lblPatientID);
|
||||||
this.splcPatient.Panel1.Controls.Add(lblPatientLast);
|
this.splcPatient.Panel1.Controls.Add(lblPatientLast);
|
||||||
@ -483,6 +491,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
//
|
//
|
||||||
// splcPrescription.Panel1
|
// splcPrescription.Panel1
|
||||||
//
|
//
|
||||||
|
this.splcPrescription.Panel1.ContextMenuStrip = this.cmuMedication;
|
||||||
this.splcPrescription.Panel1.Controls.Add(this.btnMedicationSearch);
|
this.splcPrescription.Panel1.Controls.Add(this.btnMedicationSearch);
|
||||||
this.splcPrescription.Panel1.Controls.Add(this.txtMedicationName);
|
this.splcPrescription.Panel1.Controls.Add(this.txtMedicationName);
|
||||||
this.splcPrescription.Panel1.Controls.Add(this.txtMedicationNumber);
|
this.splcPrescription.Panel1.Controls.Add(this.txtMedicationNumber);
|
||||||
@ -506,14 +515,14 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.btnMedicationSearch.UseVisualStyleBackColor = true;
|
this.btnMedicationSearch.UseVisualStyleBackColor = true;
|
||||||
this.btnMedicationSearch.Click += new System.EventHandler(this.btnMedicationSearch_Click);
|
this.btnMedicationSearch.Click += new System.EventHandler(this.btnMedicationSearch_Click);
|
||||||
//
|
//
|
||||||
// txtPrescriptionPatID
|
// txtMedicationName
|
||||||
//
|
//
|
||||||
this.txtMedicationName.Location = new System.Drawing.Point(184, 74);
|
this.txtMedicationName.Location = new System.Drawing.Point(184, 74);
|
||||||
this.txtMedicationName.Name = "txtMedicationName";
|
this.txtMedicationName.Name = "txtMedicationName";
|
||||||
this.txtMedicationName.Size = new System.Drawing.Size(100, 20);
|
this.txtMedicationName.Size = new System.Drawing.Size(100, 20);
|
||||||
this.txtMedicationName.TabIndex = 3;
|
this.txtMedicationName.TabIndex = 3;
|
||||||
//
|
//
|
||||||
// txtRxNumber
|
// txtMedicationNumber
|
||||||
//
|
//
|
||||||
this.txtMedicationNumber.Location = new System.Drawing.Point(184, 51);
|
this.txtMedicationNumber.Location = new System.Drawing.Point(184, 51);
|
||||||
this.txtMedicationNumber.Name = "txtMedicationNumber";
|
this.txtMedicationNumber.Name = "txtMedicationNumber";
|
||||||
@ -540,7 +549,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.lblDisMedicationNum.Text = "Medication ID:";
|
this.lblDisMedicationNum.Text = "Medication ID:";
|
||||||
this.lblDisMedicationNum.Click += new System.EventHandler(this.lblDisMedicationNum_Click);
|
this.lblDisMedicationNum.Click += new System.EventHandler(this.lblDisMedicationNum_Click);
|
||||||
//
|
//
|
||||||
// dgvPrescription
|
// dgvMedication
|
||||||
//
|
//
|
||||||
this.dgvMedication.AllowUserToAddRows = false;
|
this.dgvMedication.AllowUserToAddRows = false;
|
||||||
this.dgvMedication.AllowUserToDeleteRows = false;
|
this.dgvMedication.AllowUserToDeleteRows = false;
|
||||||
@ -667,6 +676,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
// splcPhysician.Panel1
|
// splcPhysician.Panel1
|
||||||
//
|
//
|
||||||
this.splcPhysician.Panel1.AutoScroll = true;
|
this.splcPhysician.Panel1.AutoScroll = true;
|
||||||
|
this.splcPhysician.Panel1.ContextMenuStrip = this.cmuPhysician;
|
||||||
this.splcPhysician.Panel1.Controls.Add(this.txtPhysicianID);
|
this.splcPhysician.Panel1.Controls.Add(this.txtPhysicianID);
|
||||||
this.splcPhysician.Panel1.Controls.Add(this.lblPhysicianID);
|
this.splcPhysician.Panel1.Controls.Add(this.lblPhysicianID);
|
||||||
this.splcPhysician.Panel1.Controls.Add(lblPhysicianLast);
|
this.splcPhysician.Panel1.Controls.Add(lblPhysicianLast);
|
||||||
@ -873,6 +883,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
//
|
//
|
||||||
// tbcInfoPrescriptions
|
// tbcInfoPrescriptions
|
||||||
//
|
//
|
||||||
|
this.tbcInfoPrescriptions.ContextMenuStrip = this.cmuPrescription;
|
||||||
this.tbcInfoPrescriptions.Controls.Add(this.txtRxPatientID);
|
this.tbcInfoPrescriptions.Controls.Add(this.txtRxPatientID);
|
||||||
this.tbcInfoPrescriptions.Controls.Add(this.txtRxMedicationID);
|
this.tbcInfoPrescriptions.Controls.Add(this.txtRxMedicationID);
|
||||||
this.tbcInfoPrescriptions.Controls.Add(this.txtRxPhysicianID);
|
this.tbcInfoPrescriptions.Controls.Add(this.txtRxPhysicianID);
|
||||||
@ -882,7 +893,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.tbcInfoPrescriptions.Controls.Add(this.label2);
|
this.tbcInfoPrescriptions.Controls.Add(this.label2);
|
||||||
this.tbcInfoPrescriptions.Controls.Add(this.label1);
|
this.tbcInfoPrescriptions.Controls.Add(this.label1);
|
||||||
this.tbcInfoPrescriptions.Controls.Add(this.btnRxSearch);
|
this.tbcInfoPrescriptions.Controls.Add(this.btnRxSearch);
|
||||||
this.tbcInfoPrescriptions.Controls.Add(this.dgvRx);
|
this.tbcInfoPrescriptions.Controls.Add(this.dgvPrescription);
|
||||||
this.tbcInfoPrescriptions.Location = new System.Drawing.Point(4, 22);
|
this.tbcInfoPrescriptions.Location = new System.Drawing.Point(4, 22);
|
||||||
this.tbcInfoPrescriptions.Name = "tbcInfoPrescriptions";
|
this.tbcInfoPrescriptions.Name = "tbcInfoPrescriptions";
|
||||||
this.tbcInfoPrescriptions.Padding = new System.Windows.Forms.Padding(3);
|
this.tbcInfoPrescriptions.Padding = new System.Windows.Forms.Padding(3);
|
||||||
@ -964,20 +975,70 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.btnRxSearch.TabIndex = 1;
|
this.btnRxSearch.TabIndex = 1;
|
||||||
this.btnRxSearch.Text = "Search";
|
this.btnRxSearch.Text = "Search";
|
||||||
this.btnRxSearch.UseVisualStyleBackColor = true;
|
this.btnRxSearch.UseVisualStyleBackColor = true;
|
||||||
this.btnRxSearch.Click += new System.EventHandler(this.btnRxSearch_Click);
|
this.btnRxSearch.Click += new System.EventHandler(this.btnPrescriptionSearch_Click);
|
||||||
//
|
//
|
||||||
// dgvRx
|
// dgvPrescription
|
||||||
//
|
//
|
||||||
this.dgvRx.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dgvPrescription.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dgvRx.ContextMenuStrip = this.cmuPrescription;
|
this.dgvPrescription.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.RxNum_id, this.numRefills, this.pastNumRefills, this.PrescribedBy, this.Physician_id, this.Medicationid, this.Patientid });
|
||||||
this.dgvRx.Location = new System.Drawing.Point(0, 236);
|
this.dgvPrescription.ContextMenuStrip = this.cmuPrescription;
|
||||||
this.dgvRx.Name = "dgvRx";
|
this.dgvPrescription.Location = new System.Drawing.Point(0, 236);
|
||||||
this.dgvRx.ReadOnly = true;
|
this.dgvPrescription.Name = "dgvPrescription";
|
||||||
this.dgvRx.RowHeadersWidth = 51;
|
this.dgvPrescription.ReadOnly = true;
|
||||||
this.dgvRx.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
this.dgvPrescription.RowHeadersWidth = 51;
|
||||||
this.dgvRx.Size = new System.Drawing.Size(730, 248);
|
this.dgvPrescription.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||||
this.dgvRx.TabIndex = 0;
|
this.dgvPrescription.Size = new System.Drawing.Size(730, 248);
|
||||||
this.dgvRx.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvRx_CellContentClick);
|
this.dgvPrescription.TabIndex = 0;
|
||||||
|
this.dgvPrescription.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvRx_CellContentClick);
|
||||||
|
//
|
||||||
|
// RxNum_id
|
||||||
|
//
|
||||||
|
this.RxNum_id.DataPropertyName = "RxNum_id";
|
||||||
|
this.RxNum_id.HeaderText = "Prescription ID";
|
||||||
|
this.RxNum_id.Name = "RxNum_id";
|
||||||
|
this.RxNum_id.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// numRefills
|
||||||
|
//
|
||||||
|
this.numRefills.DataPropertyName = "numRefills";
|
||||||
|
this.numRefills.HeaderText = "Allowed Refills";
|
||||||
|
this.numRefills.Name = "numRefills";
|
||||||
|
this.numRefills.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// pastNumRefills
|
||||||
|
//
|
||||||
|
this.pastNumRefills.DataPropertyName = "pastNumRefills";
|
||||||
|
this.pastNumRefills.HeaderText = "Refills Used";
|
||||||
|
this.pastNumRefills.Name = "pastNumRefills";
|
||||||
|
this.pastNumRefills.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// PrescribedBy
|
||||||
|
//
|
||||||
|
this.PrescribedBy.DataPropertyName = "PrescribedBy";
|
||||||
|
this.PrescribedBy.HeaderText = "Prescribed By";
|
||||||
|
this.PrescribedBy.Name = "PrescribedBy";
|
||||||
|
this.PrescribedBy.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// Physician_id
|
||||||
|
//
|
||||||
|
this.Physician_id.DataPropertyName = "Physician_id";
|
||||||
|
this.Physician_id.HeaderText = "Physician ID";
|
||||||
|
this.Physician_id.Name = "Physician_id";
|
||||||
|
this.Physician_id.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// Medicationid
|
||||||
|
//
|
||||||
|
this.Medicationid.DataPropertyName = "Medication_id";
|
||||||
|
this.Medicationid.HeaderText = "Medication ID";
|
||||||
|
this.Medicationid.Name = "Medicationid";
|
||||||
|
this.Medicationid.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// Patientid
|
||||||
|
//
|
||||||
|
this.Patientid.DataPropertyName = "Patient_id";
|
||||||
|
this.Patientid.HeaderText = "Patient ID";
|
||||||
|
this.Patientid.Name = "Patientid";
|
||||||
|
this.Patientid.ReadOnly = true;
|
||||||
//
|
//
|
||||||
// cmuPrescription
|
// cmuPrescription
|
||||||
//
|
//
|
||||||
@ -1058,11 +1119,19 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.cmuPhysician.ResumeLayout(false);
|
this.cmuPhysician.ResumeLayout(false);
|
||||||
this.tbcInfoPrescriptions.ResumeLayout(false);
|
this.tbcInfoPrescriptions.ResumeLayout(false);
|
||||||
this.tbcInfoPrescriptions.PerformLayout();
|
this.tbcInfoPrescriptions.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dgvRx)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.dgvPrescription)).EndInit();
|
||||||
this.cmuPrescription.ResumeLayout(false);
|
this.cmuPrescription.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn RxNum_id;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn numRefills;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn pastNumRefills;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn PrescribedBy;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn Physician_id;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn Medicationid;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn Patientid;
|
||||||
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionViewRefills;
|
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionViewRefills;
|
||||||
|
|
||||||
private System.Windows.Forms.TextBox txtRxPhysicianID;
|
private System.Windows.Forms.TextBox txtRxPhysicianID;
|
||||||
@ -1070,7 +1139,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
private System.Windows.Forms.TextBox txtRxPatientID;
|
private System.Windows.Forms.TextBox txtRxPatientID;
|
||||||
private System.Windows.Forms.Button btnRxSearch;
|
private System.Windows.Forms.Button btnRxSearch;
|
||||||
|
|
||||||
private System.Windows.Forms.DataGridView dgvRx;
|
private System.Windows.Forms.DataGridView dgvPrescription;
|
||||||
|
|
||||||
private System.Windows.Forms.ContextMenuStrip cmuPrescription;
|
private System.Windows.Forms.ContextMenuStrip cmuPrescription;
|
||||||
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionNew;
|
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionNew;
|
||||||
@ -1157,7 +1226,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
System.Windows.Forms.Label label2 = new System.Windows.Forms.Label();
|
System.Windows.Forms.Label label2 = new System.Windows.Forms.Label();
|
||||||
System.Windows.Forms.Label label3 = new System.Windows.Forms.Label();
|
System.Windows.Forms.Label label3 = new System.Windows.Forms.Label();
|
||||||
System.Windows.Forms.Label label4 = new System.Windows.Forms.Label();
|
System.Windows.Forms.Label label4 = new System.Windows.Forms.Label();
|
||||||
System.Windows.Forms.TextBox txtRxPrescriptionID = new System.Windows.Forms.TextBox();
|
public System.Windows.Forms.TextBox txtRxPrescriptionID;
|
||||||
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionRefillThis;
|
private System.Windows.Forms.ToolStripMenuItem cmuPrescriptionRefillThis;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -24,7 +24,8 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
|
|
||||||
dgvPatient.DoubleClick += cmuPatientEdit_Click;
|
dgvPatient.DoubleClick += cmuPatientEdit_Click;
|
||||||
dgvPhysician.DoubleClick += cmuPhysicianEdit_Click;
|
dgvPhysician.DoubleClick += cmuPhysicianEdit_Click;
|
||||||
dgvRx.DoubleClick += cmuMedicationEdit_Click;
|
dgvPrescription.DoubleClick += cmuPrescriptionEdit_Click;
|
||||||
|
dgvMedication.DoubleClick += cmuMedicationEdit_Click;
|
||||||
|
|
||||||
tbcInfo.SelectedIndexChanged += frmInfoTabChange;
|
tbcInfo.SelectedIndexChanged += frmInfoTabChange;
|
||||||
|
|
||||||
@ -42,6 +43,13 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
cmuPhysicianDelete.Enabled = false;
|
cmuPhysicianDelete.Enabled = false;
|
||||||
cmuMedicationEdit.Enabled = false;
|
cmuMedicationEdit.Enabled = false;
|
||||||
cmuMedicationDelete.Enabled = false;
|
cmuMedicationDelete.Enabled = false;
|
||||||
|
cmuPrescriptionEdit.Enabled = false;
|
||||||
|
cmuPrescriptionDelete.Enabled = false;
|
||||||
|
|
||||||
|
dgvMedication.Visible = false;
|
||||||
|
dgvPatient.Visible = false;
|
||||||
|
dgvPhysician.Visible = false;
|
||||||
|
dgvPrescription.Visible = false;
|
||||||
|
|
||||||
|
|
||||||
txtPatientFirst.Focus();
|
txtPatientFirst.Focus();
|
||||||
@ -134,12 +142,12 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if data grid view is not focused, run the search function
|
// if data grid view is not focused, run the search function
|
||||||
if (e.KeyCode == Keys.Enter && prescriptionIsActive && !dgvMedication.Focused)
|
if (e.KeyCode == Keys.Enter && prescriptionIsActive && !dgvPrescription.Focused)
|
||||||
{
|
{
|
||||||
btnRxSearch_Click(sender,e);
|
btnPrescriptionSearch_Click(sender,e);
|
||||||
}
|
}
|
||||||
// if data grid view is focused, run the edit function
|
// if data grid view is focused, run the edit function
|
||||||
else if (e.KeyCode == Keys.Enter && prescriptionIsActive && dgvMedication.Focused)
|
else if (e.KeyCode == Keys.Enter && prescriptionIsActive && dgvPrescription.Focused)
|
||||||
{
|
{
|
||||||
cmuPrescriptionEdit_Click(sender,e);
|
cmuPrescriptionEdit_Click(sender,e);
|
||||||
}
|
}
|
||||||
@ -258,6 +266,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
|
|
||||||
cmuPatientEdit.Enabled = dgvPatient.Rows.Count > 0;
|
cmuPatientEdit.Enabled = dgvPatient.Rows.Count > 0;
|
||||||
cmuPatientDelete.Enabled = dgvPatient.Rows.Count > 0;
|
cmuPatientDelete.Enabled = dgvPatient.Rows.Count > 0;
|
||||||
|
dgvPatient.Visible = dgvPatient.Rows.Count > 0;
|
||||||
|
|
||||||
dgvPatient.Focus();
|
dgvPatient.Focus();
|
||||||
|
|
||||||
@ -432,6 +441,9 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
cmuPhysicianEdit.Enabled = dgvPhysician.Rows.Count > 0;
|
cmuPhysicianEdit.Enabled = dgvPhysician.Rows.Count > 0;
|
||||||
cmuPhysicianDelete.Enabled = dgvPhysician.Rows.Count > 0;
|
cmuPhysicianDelete.Enabled = dgvPhysician.Rows.Count > 0;
|
||||||
|
|
||||||
|
|
||||||
|
dgvPhysician.Visible = dgvPhysician.Rows.Count > 0;
|
||||||
|
|
||||||
dgvPhysician.Focus();
|
dgvPhysician.Focus();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -607,12 +619,12 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (dgvRx.Rows.Count > 0)
|
if (dgvPrescription.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
dgvRx.DataSource = ds.Tables[0];
|
dgvPrescription.DataSource = ds.Tables[0];
|
||||||
DataGridViewRow row = new DataGridViewRow();
|
DataGridViewRow row = new DataGridViewRow();
|
||||||
row = dgvRx.SelectedRows[0];
|
row = dgvPrescription.SelectedRows[0];
|
||||||
string medID = "";
|
string medID = "";
|
||||||
medID = (row.Cells[0].Value).ToString();
|
medID = (row.Cells[0].Value).ToString();
|
||||||
|
|
||||||
@ -622,7 +634,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
{
|
{
|
||||||
PharmacyDataTier.DeleteMedication(medID);
|
PharmacyDataTier.DeleteMedication(medID);
|
||||||
}
|
}
|
||||||
btnRxSearch_Click(sender, e);
|
btnPrescriptionSearch_Click(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -645,13 +657,13 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
private void cmuPrescriptionEdit_Click(object sender, EventArgs e)
|
private void cmuPrescriptionEdit_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (dgvRx.Rows.Count > 0)
|
if (dgvPrescription.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
dgvRx.DataSource = ds.Tables[0];
|
dgvPrescription.DataSource = ds.Tables[0];
|
||||||
// Console.WriteLine( dgvPatient.SelectedRows.Count);
|
// Console.WriteLine( dgvPatient.SelectedRows.Count);
|
||||||
DataGridViewRow row = new DataGridViewRow();
|
DataGridViewRow row = new DataGridViewRow();
|
||||||
row = dgvRx.SelectedRows[0];
|
row = dgvPrescription.SelectedRows[0];
|
||||||
string prescID = "";
|
string prescID = "";
|
||||||
prescID = (row.Cells[0].Value).ToString();
|
prescID = (row.Cells[0].Value).ToString();
|
||||||
frmPrescription PrescriptionAdd = new frmPrescription(this, false);
|
frmPrescription PrescriptionAdd = new frmPrescription(this, false);
|
||||||
@ -669,12 +681,12 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (dgvRx.Rows.Count > 0)
|
if (dgvPrescription.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
dgvRx.DataSource = ds.Tables[0];
|
dgvPrescription.DataSource = ds.Tables[0];
|
||||||
DataGridViewRow row = new DataGridViewRow();
|
DataGridViewRow row = new DataGridViewRow();
|
||||||
row = dgvRx.SelectedRows[0];
|
row = dgvPrescription.SelectedRows[0];
|
||||||
string PresID = "";
|
string PresID = "";
|
||||||
PresID = (row.Cells[0].Value).ToString();
|
PresID = (row.Cells[0].Value).ToString();
|
||||||
|
|
||||||
@ -684,7 +696,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
{
|
{
|
||||||
PharmacyDataTier.DeletePrescription(PresID);
|
PharmacyDataTier.DeletePrescription(PresID);
|
||||||
}
|
}
|
||||||
btnRxSearch_Click(sender, e);
|
btnPrescriptionSearch_Click(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -698,7 +710,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
medicationAdd.Focus();
|
medicationAdd.Focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnRxSearch_Click(object sender, EventArgs e)
|
public void btnPrescriptionSearch_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string rxNum = "";
|
string rxNum = "";
|
||||||
string physID = "";
|
string physID = "";
|
||||||
@ -728,14 +740,14 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
|
|
||||||
if (ds.Tables[0].Rows.Count > 0) // There is a record.
|
if (ds.Tables[0].Rows.Count > 0) // There is a record.
|
||||||
{
|
{
|
||||||
dgvRx.Visible = true;
|
dgvPrescription.Visible = true;
|
||||||
// Get data source.
|
// Get data source.
|
||||||
dgvRx.DataSource = ds.Tables[0];
|
dgvPrescription.DataSource = ds.Tables[0];
|
||||||
dgvRx.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen;
|
dgvPrescription.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen;
|
||||||
|
|
||||||
// Set the row and column header styles.
|
// Set the row and column header styles.
|
||||||
dgvRx.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
|
dgvPrescription.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
|
||||||
dgvRx.ColumnHeadersDefaultCellStyle.BackColor = Color.Green;
|
dgvPrescription.ColumnHeadersDefaultCellStyle.BackColor = Color.Green;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -762,10 +774,12 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cmuMedicationEdit.Enabled = dgvRx.Rows.Count > 0;
|
cmuPrescriptionEdit.Enabled = dgvPrescription.Rows.Count > 0;
|
||||||
cmuMedicationDelete.Enabled = dgvRx.Rows.Count > 0;
|
cmuPrescriptionDelete.Enabled = dgvPrescription.Rows.Count > 0;
|
||||||
|
|
||||||
|
dgvPrescription.Visible = dgvPrescription.Rows.Count > 0;
|
||||||
|
|
||||||
dgvRx.Focus();
|
dgvPrescription.Focus();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -898,6 +912,8 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
cmuMedicationEdit.Enabled = dgvMedication.Rows.Count > 0;
|
cmuMedicationEdit.Enabled = dgvMedication.Rows.Count > 0;
|
||||||
cmuMedicationDelete.Enabled = dgvMedication.Rows.Count > 0;
|
cmuMedicationDelete.Enabled = dgvMedication.Rows.Count > 0;
|
||||||
|
|
||||||
|
dgvMedication.Visible = dgvMedication.Rows.Count > 0;
|
||||||
|
|
||||||
dgvMedication.Focus();
|
dgvMedication.Focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,9 @@
|
|||||||
<metadata name="lblPhysicianLast.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="lblPhysicianLast.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="cmuPatient.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="pat_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="pat_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
@ -174,8 +177,8 @@
|
|||||||
<metadata name="Medications.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="Medications.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="cmuPatient.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="cmuMedication.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>125, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="Medication_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="Medication_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
@ -198,8 +201,8 @@
|
|||||||
<metadata name="RxNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="RxNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="cmuMedication.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="cmuPhysician.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>125, 17</value>
|
<value>211, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="Phys_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="Phys_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
@ -234,12 +237,30 @@
|
|||||||
<metadata name="Specialty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="Specialty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="cmuPhysician.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
|
||||||
<value>211, 17</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="cmuPrescription.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="cmuPrescription.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>332, 17</value>
|
<value>332, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="RxNum_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="numRefills.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="pastNumRefills.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="PrescribedBy.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="Physician_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="Medicationid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="Patientid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</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>
|
||||||
|
@ -131,6 +131,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.btnCancel.TabIndex = 25;
|
this.btnCancel.TabIndex = 25;
|
||||||
this.btnCancel.Text = "Cancel";
|
this.btnCancel.Text = "Cancel";
|
||||||
this.btnCancel.UseVisualStyleBackColor = true;
|
this.btnCancel.UseVisualStyleBackColor = true;
|
||||||
|
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click_1);
|
||||||
//
|
//
|
||||||
// btnGO
|
// btnGO
|
||||||
//
|
//
|
||||||
@ -140,7 +141,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.btnGO.Size = new System.Drawing.Size(67, 23);
|
this.btnGO.Size = new System.Drawing.Size(67, 23);
|
||||||
this.btnGO.TabIndex = 24;
|
this.btnGO.TabIndex = 24;
|
||||||
this.btnGO.UseVisualStyleBackColor = true;
|
this.btnGO.UseVisualStyleBackColor = true;
|
||||||
this.btnGO.Click += new System.EventHandler(this.btnGO_Click_2);
|
this.btnGO.Click += new System.EventHandler(this.btnGO_Click);
|
||||||
//
|
//
|
||||||
// label7
|
// label7
|
||||||
//
|
//
|
||||||
@ -149,7 +150,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.label7.Name = "label7";
|
this.label7.Name = "label7";
|
||||||
this.label7.Size = new System.Drawing.Size(109, 28);
|
this.label7.Size = new System.Drawing.Size(109, 28);
|
||||||
this.label7.TabIndex = 23;
|
this.label7.TabIndex = 23;
|
||||||
this.label7.Text = "Max Refills:";
|
this.label7.Text = "Refills Allowed:";
|
||||||
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
//
|
//
|
||||||
// label6
|
// label6
|
||||||
@ -159,7 +160,7 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
this.label6.Name = "label6";
|
this.label6.Name = "label6";
|
||||||
this.label6.Size = new System.Drawing.Size(109, 28);
|
this.label6.Size = new System.Drawing.Size(109, 28);
|
||||||
this.label6.TabIndex = 22;
|
this.label6.TabIndex = 22;
|
||||||
this.label6.Text = "Completed Refills:";
|
this.label6.Text = "Refills Used:";
|
||||||
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
//
|
//
|
||||||
// label5
|
// label5
|
||||||
|
@ -87,153 +87,153 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnGO_Click(object sender, EventArgs e)
|
// private void btnGO_Click(object sender, EventArgs e)
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
var hasFailed = false;
|
// var hasFailed = false;
|
||||||
|
//
|
||||||
var Patient_id = "";
|
// var Patient_id = "";
|
||||||
var Medication_id = "";
|
// var Medication_id = "";
|
||||||
var Physician_name = "";
|
// var Physician_name = "";
|
||||||
var Physician_id = "";
|
// var Physician_id = "";
|
||||||
var Completed_refills = "";
|
// var Completed_refills = "";
|
||||||
var Max_refills = "";
|
// var Max_refills = "";
|
||||||
var RxNum = "";
|
// var RxNum = "";
|
||||||
|
//
|
||||||
|
//
|
||||||
if (txtMedID.Text.Length + txtPhysName.Text.Length + txtMedID.Text.Length + txtPhysID.Text.Length + txtCompletedRefills.Text.Length + txtMaxRefills.Text.Length + txtRxNum.Text.Length > 0)
|
// if (txtMedID.Text.Length + txtPhysName.Text.Length + txtMedID.Text.Length + txtPhysID.Text.Length + txtCompletedRefills.Text.Length + txtMaxRefills.Text.Length + txtRxNum.Text.Length > 0)
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
Patient_id = txtPatID.Text;
|
// Patient_id = txtPatID.Text;
|
||||||
|
//
|
||||||
if (Patient_id.Length > 8)
|
// if (Patient_id.Length > 8)
|
||||||
{
|
// {
|
||||||
throw new Exception();
|
// throw new Exception();
|
||||||
}else
|
// }else
|
||||||
while (Patient_id.Length < 8)
|
// while (Patient_id.Length < 8)
|
||||||
{
|
// {
|
||||||
Patient_id = "0" + Patient_id;
|
// Patient_id = "0" + Patient_id;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
catch (Exception exception)
|
// catch (Exception exception)
|
||||||
{
|
// {
|
||||||
epLocal.SetError(txtPatID, "Invalid Value");
|
// epLocal.SetError(txtPatID, "Invalid Value");
|
||||||
hasFailed = true;
|
// hasFailed = true;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
RxNum = txtRxNum.Text;
|
// RxNum = txtRxNum.Text;
|
||||||
|
//
|
||||||
if (RxNum.Length > 11)
|
// if (RxNum.Length > 11)
|
||||||
{
|
// {
|
||||||
throw new Exception();
|
// throw new Exception();
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
while (RxNum.Length < 11)
|
// while (RxNum.Length < 11)
|
||||||
{
|
// {
|
||||||
RxNum = "0" + RxNum;
|
// RxNum = "0" + RxNum;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
catch (Exception exception)
|
// catch (Exception exception)
|
||||||
{
|
// {
|
||||||
epLocal.SetError(txtRxNum, "Invalid Value");
|
// epLocal.SetError(txtRxNum, "Invalid Value");
|
||||||
hasFailed = true;
|
// hasFailed = true;
|
||||||
}
|
// }
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
Physician_id = txtPhysID.Text;
|
// Physician_id = txtPhysID.Text;
|
||||||
|
//
|
||||||
if (Physician_id.Length > 8)
|
// if (Physician_id.Length > 8)
|
||||||
{
|
// {
|
||||||
throw new Exception();
|
// throw new Exception();
|
||||||
}else
|
// }else
|
||||||
while (Physician_id.Length < 8)
|
// while (Physician_id.Length < 8)
|
||||||
{
|
// {
|
||||||
Physician_id = "0" + Physician_id;
|
// Physician_id = "0" + Physician_id;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
catch (Exception exception)
|
// catch (Exception exception)
|
||||||
{
|
// {
|
||||||
epLocal.SetError(txtPhysID, "Invalid Value");
|
// epLocal.SetError(txtPhysID, "Invalid Value");
|
||||||
hasFailed = true;
|
// hasFailed = true;
|
||||||
}
|
// }
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
Physician_name = txtPhysName.Text;
|
// Physician_name = txtPhysName.Text;
|
||||||
if (Physician_name.Length > 30)
|
// if (Physician_name.Length > 30)
|
||||||
{
|
// {
|
||||||
throw new Exception();
|
// throw new Exception();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
catch (Exception exception)
|
// catch (Exception exception)
|
||||||
{
|
// {
|
||||||
epLocal.SetError(txtPhysName, "Invalid Value");
|
// epLocal.SetError(txtPhysName, "Invalid Value");
|
||||||
hasFailed = true;
|
// hasFailed = true;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
Medication_id = txtMedID.Text;
|
// Medication_id = txtMedID.Text;
|
||||||
if (Medication_id.Length > 7)
|
// if (Medication_id.Length > 7)
|
||||||
{
|
// {
|
||||||
throw new Exception();
|
// throw new Exception();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
while (Medication_id.Length < 7)
|
// while (Medication_id.Length < 7)
|
||||||
{
|
// {
|
||||||
Medication_id = "0" + Medication_id;
|
// Medication_id = "0" + Medication_id;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
catch (Exception exception)
|
// catch (Exception exception)
|
||||||
{
|
// {
|
||||||
epLocal.SetError(txtMedID, "Invalid Value");
|
// epLocal.SetError(txtMedID, "Invalid Value");
|
||||||
hasFailed = true;
|
// hasFailed = true;
|
||||||
}
|
// }
|
||||||
if (!hasFailed)
|
// if (!hasFailed)
|
||||||
{
|
// {
|
||||||
if (isAdd)
|
// if (isAdd)
|
||||||
{
|
// {
|
||||||
PharmacyDataTier.CreatePrescription(
|
// PharmacyDataTier.CreatePrescription(
|
||||||
RxNum,
|
// RxNum,
|
||||||
Patient_id,
|
// Patient_id,
|
||||||
Medication_id,
|
// Medication_id,
|
||||||
Physician_name,
|
// Physician_name,
|
||||||
Physician_id,
|
// Physician_id,
|
||||||
Completed_refills,
|
// Completed_refills,
|
||||||
Max_refills);
|
// Max_refills);
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
PharmacyDataTier.UpdatePrescription(
|
// PharmacyDataTier.UpdatePrescription(
|
||||||
RxNum,
|
// RxNum,
|
||||||
Patient_id,
|
// Patient_id,
|
||||||
Medication_id,
|
// Medication_id,
|
||||||
Physician_name,
|
// Physician_name,
|
||||||
Physician_id,
|
// Physician_id,
|
||||||
Completed_refills,
|
// Completed_refills,
|
||||||
Max_refills);
|
// Max_refills);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
SourceForm.txtMedicationNumber.Text = RxNum;
|
// SourceForm.txtRxPrescriptionID.Text = RxNum;
|
||||||
//SourceForm.btnRxSearch_Click(sender, e);
|
// SourceForm.btnPrescriptionSearch_Click(sender, e);
|
||||||
Close();
|
// Close();
|
||||||
|
//
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
private void frmPrescription_Load(object sender, EventArgs e)
|
private void frmPrescription_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@ -294,9 +294,9 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void btnGO_Click_2(object sender, EventArgs e)
|
private void btnGO_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
string RxNum_id = "";
|
string RxNum_id = "";
|
||||||
int numRefills = 0;
|
int numRefills = 0;
|
||||||
int pastNumRefills = 0;
|
int pastNumRefills = 0;
|
||||||
@ -304,14 +304,22 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
string PhysicianID = "";
|
string PhysicianID = "";
|
||||||
string Medication_id = "";
|
string Medication_id = "";
|
||||||
string Patient_id = "";
|
string Patient_id = "";
|
||||||
|
|
||||||
bool hasFailed = false;
|
bool hasFailed = false;
|
||||||
|
|
||||||
|
epLocal.Clear();
|
||||||
|
|
||||||
if (txtRxNum.Text.Length > 0 && txtRxNum.Text.Length <= 11)
|
if (txtRxNum.Text.Length > 0 && txtRxNum.Text.Length <= 11)
|
||||||
{
|
{
|
||||||
RxNum_id = txtRxNum.Text;
|
RxNum_id = txtRxNum.Text;
|
||||||
}
|
|
||||||
|
|
||||||
|
while (RxNum_id.Length < 11)
|
||||||
|
{
|
||||||
|
RxNum_id = "0" + RxNum_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (txtPhysName.Text.Length > 0)
|
if (txtPhysName.Text.Length > 0)
|
||||||
{
|
{
|
||||||
PrescribedBy = txtPhysName.Text;
|
PrescribedBy = txtPhysName.Text;
|
||||||
@ -330,6 +338,13 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
hasFailed = true;
|
hasFailed = true;
|
||||||
epLocal.SetError(txtPatID, "Patient Does Not Exist");
|
epLocal.SetError(txtPatID, "Patient Does Not Exist");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (Patient_id.Length < 8)
|
||||||
|
{
|
||||||
|
Patient_id = "0" + Patient_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -346,6 +361,13 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
hasFailed = true;
|
hasFailed = true;
|
||||||
epLocal.SetError(txtMedID, "Medication Does Not Exist");
|
epLocal.SetError(txtMedID, "Medication Does Not Exist");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (Medication_id.Length < 7)
|
||||||
|
{
|
||||||
|
Medication_id = "0" + Medication_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -362,6 +384,13 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
hasFailed = true;
|
hasFailed = true;
|
||||||
epLocal.SetError(txtPhysID, "Physician Does Not Exist");
|
epLocal.SetError(txtPhysID, "Physician Does Not Exist");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (PhysicianID.Length < 8)
|
||||||
|
{
|
||||||
|
PhysicianID = "0" + PhysicianID;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -371,13 +400,13 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
if (txtCompletedRefills.Text.Length > 0)
|
if (txtCompletedRefills.Text.Length > 0)
|
||||||
{
|
{
|
||||||
pastNumRefills = int.Parse(txtCompletedRefills.Text);
|
pastNumRefills = int.Parse(txtCompletedRefills.Text);
|
||||||
}
|
}
|
||||||
else throw new Exception();
|
else throw new Exception();
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
@ -396,14 +425,42 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
throw new Exception();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
epLocal.SetError(txtMaxRefills, "Invalid Value");
|
epLocal.SetError(txtMaxRefills, "Invalid Value");
|
||||||
hasFailed = true;
|
hasFailed = true;
|
||||||
}
|
}
|
||||||
|
if (!hasFailed)
|
||||||
|
{
|
||||||
|
if (isAdd)
|
||||||
|
{
|
||||||
|
PharmacyDataTier.CreatePrescription(
|
||||||
|
RxNum_id,
|
||||||
|
Patient_id, Medication_id,
|
||||||
|
PrescribedBy,
|
||||||
|
PhysicianID,
|
||||||
|
pastNumRefills,
|
||||||
|
numRefills);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PharmacyDataTier.UpdatePrescription(
|
||||||
|
RxNum_id,
|
||||||
|
Patient_id, Medication_id,
|
||||||
|
PrescribedBy,
|
||||||
|
PhysicianID,
|
||||||
|
pastNumRefills,
|
||||||
|
numRefills);
|
||||||
|
}
|
||||||
|
|
||||||
|
SourceForm.txtRxPrescriptionID.Text = RxNum_id;
|
||||||
|
SourceForm.btnPrescriptionSearch_Click(sender, e);
|
||||||
|
Close();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -483,5 +540,10 @@ namespace Louis__Pharmacy_CNSA212_FP
|
|||||||
|
|
||||||
epLocal.SetError(txtMaxRefills,"");
|
epLocal.SetError(txtMaxRefills,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnCancel_Click_1(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user