Compare commits

..

No commits in common. "63e5ad09fb58ba65a000f28f8214b35d76e80db1" and "748c6e08fbedcf8c862383032bf748c66c8c8cfb" have entirely different histories.

8 changed files with 92 additions and 146 deletions

View File

@ -1235,34 +1235,6 @@ namespace Louis__Pharmacy_CNSA212_FP
} }
} }
public static void DecrementPastRefills(string rxNum)
{
try
{
myConn.Open();
cmdString.Parameters.Clear();
cmdString.Connection = myConn;
cmdString.CommandType = CommandType.StoredProcedure;
cmdString.CommandTimeout = 1500;
cmdString.CommandText = "DecrementPastRefills";
cmdString.Parameters.Add("@Prescription_id", SqlDbType.VarChar, 11).Value = rxNum;
cmdString.ExecuteNonQuery();
}
catch (Exception ex)
{
throw new ArgumentException(ex.Message);
}
finally
{
myConn.Close();
}
}
public static void CreatePrescription( public static void CreatePrescription(
string RxNum, string RxNum,
string Patient_id, string Patient_id,

View File

@ -237,6 +237,7 @@ namespace Louis__Pharmacy_CNSA212_FP
this.splcPatient.Panel1.Controls.Add(lblPatientFirst); this.splcPatient.Panel1.Controls.Add(lblPatientFirst);
this.splcPatient.Panel1.Controls.Add(this.txtPatientFirst); this.splcPatient.Panel1.Controls.Add(this.txtPatientFirst);
this.splcPatient.Panel1.Controls.Add(this.btnPatientSearch); this.splcPatient.Panel1.Controls.Add(this.btnPatientSearch);
//this.splcPatient.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.Panel1_Paint);
// //
// splcPatient.Panel2 // splcPatient.Panel2
// //
@ -249,7 +250,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);
// //
@ -320,7 +324,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);
@ -507,7 +526,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);
// //
@ -581,7 +603,14 @@ namespace Louis__Pharmacy_CNSA212_FP
this.dgvMedication.AllowUserToAddRows = false; this.dgvMedication.AllowUserToAddRows = false;
this.dgvMedication.AllowUserToDeleteRows = false; this.dgvMedication.AllowUserToDeleteRows = false;
this.dgvMedication.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvMedication.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvMedication.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Medication_id, this.MedicationName, this.IntakeMethod, this.Frequency, this.Dosage, this.Purpose, this.RxNum }); this.dgvMedication.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Medication_id,
this.MedicationName,
this.IntakeMethod,
this.Frequency,
this.Dosage,
this.Purpose,
this.RxNum});
this.dgvMedication.ContextMenuStrip = this.cmuMedication; this.dgvMedication.ContextMenuStrip = this.cmuMedication;
this.dgvMedication.Location = new System.Drawing.Point(3, 3); this.dgvMedication.Location = new System.Drawing.Point(3, 3);
this.dgvMedication.Name = "dgvMedication"; this.dgvMedication.Name = "dgvMedication";
@ -697,7 +726,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);
// //
@ -767,7 +799,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";
@ -904,9 +947,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
// //
@ -1020,10 +1068,15 @@ namespace Louis__Pharmacy_CNSA212_FP
// //
// dgvPrescription // dgvPrescription
// //
this.dgvPrescription.AllowUserToAddRows = 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.RxNum_id, this.numRefills, this.pastNumRefills, this.PrescribedBy, this.Physician_id, this.Medicationid, this.Patientid }); 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.dgvPrescription.ContextMenuStrip = this.cmuPrescription; this.dgvPrescription.ContextMenuStrip = this.cmuPrescription;
this.dgvPrescription.Location = new System.Drawing.Point(0, 236); this.dgvPrescription.Location = new System.Drawing.Point(0, 236);
this.dgvPrescription.Name = "dgvPrescription"; this.dgvPrescription.Name = "dgvPrescription";
@ -1124,6 +1177,7 @@ namespace Louis__Pharmacy_CNSA212_FP
this.cmuPrescription.ResumeLayout(false); this.cmuPrescription.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvPrescription)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvPrescription)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
private System.Windows.Forms.DataGridViewTextBoxColumn RxNum_id; private System.Windows.Forms.DataGridViewTextBoxColumn RxNum_id;

View File

@ -941,7 +941,7 @@ namespace Louis__Pharmacy_CNSA212_FP
string rxNumString = (row.Cells[0].Value).ToString(); string rxNumString = (row.Cells[0].Value).ToString();
Int32 rxNum = Int32.Parse(rxNumString); Int32 rxNum = Int32.Parse(rxNumString);
frmRefill refill = new frmRefill(rxNum, this); frmRefill refill = new frmRefill(rxNum);
refill.MdiParent = MdiParent; refill.MdiParent = MdiParent;
refill.StartPosition = FormStartPosition.CenterScreen; refill.StartPosition = FormStartPosition.CenterScreen;
refill.Show(); refill.Show();

View File

@ -76,8 +76,7 @@ namespace Louis__Pharmacy_CNSA212_FP
txtWeight.Text = ds.Tables[0].Rows[0]["lbs"].ToString(); txtWeight.Text = ds.Tables[0].Rows[0]["lbs"].ToString();
txtHeightFt.Text = ds.Tables[0].Rows[0]["Height_feet"].ToString(); txtHeightFt.Text = ds.Tables[0].Rows[0]["Height_feet"].ToString();
txtHeightIn.Text = ds.Tables[0].Rows[0]["Height_inches"].ToString(); txtHeightIn.Text = ds.Tables[0].Rows[0]["Height_inches"].ToString();
DateTime date = DateTime.Parse(ds.Tables[0].Rows[0]["DOB"].ToString()); txtDOB.Text = ds.Tables[0].Rows[0]["DOB"].ToString();
txtDOB.Text = date.ToString("d");
cboGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString(); cboGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString();
txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString(); txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString();
txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString(); txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString();

View File

@ -53,7 +53,6 @@ namespace Louis__Pharmacy_CNSA212_FP
this.cmuRefill = new System.Windows.Forms.ContextMenuStrip(this.components); this.cmuRefill = new System.Windows.Forms.ContextMenuStrip(this.components);
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.cmuRefresh = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.dgvRefills)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvRefills)).BeginInit();
this.cmuRefill.SuspendLayout(); this.cmuRefill.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@ -181,31 +180,22 @@ namespace Louis__Pharmacy_CNSA212_FP
// //
this.cmuRefill.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmuRefill.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.editToolStripMenuItem, this.editToolStripMenuItem,
this.deleteToolStripMenuItem, this.deleteToolStripMenuItem});
this.cmuRefresh});
this.cmuRefill.Name = "cmuRefill"; this.cmuRefill.Name = "cmuRefill";
this.cmuRefill.Size = new System.Drawing.Size(181, 92); this.cmuRefill.Size = new System.Drawing.Size(108, 48);
// //
// editToolStripMenuItem // editToolStripMenuItem
// //
this.editToolStripMenuItem.Name = "editToolStripMenuItem"; this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.editToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
this.editToolStripMenuItem.Text = "Edit"; this.editToolStripMenuItem.Text = "Edit";
this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click); this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click);
// //
// deleteToolStripMenuItem // deleteToolStripMenuItem
// //
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.deleteToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
this.deleteToolStripMenuItem.Text = "Delete"; this.deleteToolStripMenuItem.Text = "Delete";
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
//
// cmuRefresh
//
this.cmuRefresh.Name = "cmuRefresh";
this.cmuRefresh.Size = new System.Drawing.Size(180, 22);
this.cmuRefresh.Text = "Refresh";
this.cmuRefresh.Click += new System.EventHandler(this.cmuRefresh_Click);
// //
// frmRefill // frmRefill
// //
@ -260,6 +250,5 @@ namespace Louis__Pharmacy_CNSA212_FP
private System.Windows.Forms.ContextMenuStrip cmuRefill; private System.Windows.Forms.ContextMenuStrip cmuRefill;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem cmuRefresh;
} }
} }

View File

@ -19,12 +19,9 @@ namespace Louis__Pharmacy_CNSA212_FP
{ {
public DataSet ds = new DataSet(); public DataSet ds = new DataSet();
private int rxNum = 0; private int rxNum = 0;
private frmInfo SourceForm = new frmInfo();
public frmRefill(int thisRxID, frmInfo SenderForm) public frmRefill(int thisRxID)
{ {
SourceForm = SenderForm;
InitializeComponent(); InitializeComponent();
rxNum = thisRxID; rxNum = thisRxID;
frmRefill_Load(null, null); frmRefill_Load(null, null);
@ -48,19 +45,6 @@ namespace Louis__Pharmacy_CNSA212_FP
dgvRefills.DataSource = ds.Tables[0]; dgvRefills.DataSource = ds.Tables[0];
} }
public void frmRefill_reLoad(object sender, EventArgs e)
{
int rxID = 0;
DataGridViewRow row = new DataGridViewRow();
rxID = rxNum;
DataSet ds = new DataSet();
ds = PharmacyDataTier.GetRefill(rxID.ToString());
dgvRefills.DataSource = ds.Tables[0];
}
private void editToolStripMenuItem_Click(object sender, EventArgs e) private void editToolStripMenuItem_Click(object sender, EventArgs e)
{ {
string refillID = ""; string refillID = "";
@ -70,7 +54,7 @@ namespace Louis__Pharmacy_CNSA212_FP
refillID = (row.Cells[0].Value).ToString(); refillID = (row.Cells[0].Value).ToString();
frmRefillAdd add = new frmRefillAdd(false, this); frmRefillAdd add = new frmRefillAdd(false);
add.MdiParent = MdiParent; add.MdiParent = MdiParent;
add.StartPosition = FormStartPosition.CenterScreen; add.StartPosition = FormStartPosition.CenterScreen;
add.Show(); add.Show();
@ -83,39 +67,6 @@ namespace Louis__Pharmacy_CNSA212_FP
editToolStripMenuItem_Click(sender, e); editToolStripMenuItem_Click(sender, e);
} }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
string refillID = "";
string rxID = "";
DataGridViewRow row = new DataGridViewRow();
row = dgvRefills.SelectedRows[0];
refillID = (row.Cells[0].Value).ToString();
rxID = (row.Cells[4].Value).ToString();
PharmacyDataTier.DeleteRefill(refillID);
PharmacyDataTier.DecrementPastRefills(rxID);
frmRefill_reLoad(sender, e);
SourceForm.btnPrescriptionSearch_Click(sender,e);
}
public void refreshrefills(object sender, EventArgs e)
{
DataGridViewRow row = new DataGridViewRow();
row = dgvRefills.SelectedRows[0];
string rxNumString = (row.Cells[4].Value).ToString();
Int32 rxNum = Int32.Parse(rxNumString);
frmRefill_Load(null, null);
}
private void cmuRefresh_Click(object sender, EventArgs e)
{
refreshrefills(sender, e);
}
//private void btnSearch_Click(object sender, EventArgs e) //private void btnSearch_Click(object sender, EventArgs e)
//{ //{
// string patientID = ""; // string patientID = "";

View File

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

View File

@ -15,12 +15,9 @@ namespace Louis__Pharmacy_CNSA212_FP
{ {
private static bool isAdd; private static bool isAdd;
public DataSet ds = new DataSet(); public DataSet ds = new DataSet();
public string currentID = "";
private frmRefill SourceForm;
public frmRefillAdd(bool isNew, frmRefill refillform)
{
SourceForm = refillform; public frmRefillAdd(bool isNew)
{
isAdd = isNew; isAdd = isNew;
InitializeComponent(); InitializeComponent();
@ -62,8 +59,6 @@ namespace Louis__Pharmacy_CNSA212_FP
txtPatientID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString(); txtPatientID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString();
txtMedicationID.Text = ds.Tables[0].Rows[0]["Medication_id"].ToString(); txtMedicationID.Text = ds.Tables[0].Rows[0]["Medication_id"].ToString();
txtRxNumber.Text = ds.Tables[0].Rows[0]["RxNum_id"].ToString(); txtRxNumber.Text = ds.Tables[0].Rows[0]["RxNum_id"].ToString();
currentID = txtRxNumber.Text;
} }
private void btnAdd_Click(object sender, EventArgs e) private void btnAdd_Click(object sender, EventArgs e)
@ -96,41 +91,28 @@ namespace Louis__Pharmacy_CNSA212_FP
medicationID = txtMedicationID.Text.Trim(); medicationID = txtMedicationID.Text.Trim();
rxNum = txtRxNumber.Text.Trim(); rxNum = txtRxNumber.Text.Trim();
// frmRefill refill = new frmRefill(0, this);
PharmacyDataTier.UpdateRefill(refillID, date, patientID, medicationID, rxNum); PharmacyDataTier.UpdateRefill(refillID, date, patientID, medicationID, rxNum);
if (currentID != rxNum)
{
PharmacyDataTier.DecrementPastRefills(currentID);
PharmacyDataTier.PastRefills(rxNum);
}
} }
else else
{ {
//if (numRefills == pastNumRefills) if (numRefills == pastNumRefills)
//{ {
// MessageBox.Show("This prescription has reached the maximum number of refills.", "Max Refill", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("This prescription has reached the maximum number of refills.", "Max Refill", MessageBoxButtons.OK, MessageBoxIcon.Error);
//}
//else
//{
// if (isAdd)
// {
// refillID = txtRefillID.Text.Trim();
// date = DateTime.Parse(txtRefillDate.Text.Trim());
// patientID = txtPatientID.Text.Trim();
// medicationID = txtMedicationID.Text.Trim();
// PharmacyDataTier.AddRefill(refillID, date, patientID, medicationID, rxNum);
// PharmacyDataTier.PastRefills(rxNum);
// }
//}
} }
else
{
if (isAdd)
{
refillID = txtRefillID.Text.Trim();
date = DateTime.Parse(txtRefillDate.Text.Trim());
patientID = txtPatientID.Text.Trim();
medicationID = txtMedicationID.Text.Trim();
SourceForm.frmRefill_reLoad(sender, e); PharmacyDataTier.AddRefill(refillID, date, patientID, medicationID, rxNum);
Close(); PharmacyDataTier.PastRefills(rxNum);
}
}
}
} }
catch (Exception exception) catch (Exception exception)
{ {