2024-01-31 12:05:11 -05:00
|
|
|
|
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;
|
|
|
|
|
|
2024-02-14 18:21:17 -05:00
|
|
|
|
|
2024-01-31 12:05:11 -05:00
|
|
|
|
namespace Louis__Pharmacy_CNSA212_FP
|
|
|
|
|
{
|
2024-01-31 12:45:33 -05:00
|
|
|
|
public partial class frmInfo : Form
|
2024-01-31 12:05:11 -05:00
|
|
|
|
{
|
2024-02-16 11:32:00 -05:00
|
|
|
|
|
2024-02-14 18:21:17 -05:00
|
|
|
|
private ErrorProvider ep1 = new ErrorProvider();
|
|
|
|
|
|
2024-02-16 11:32:00 -05:00
|
|
|
|
public DataSet ds = new DataSet();
|
|
|
|
|
|
2024-01-31 12:45:33 -05:00
|
|
|
|
public frmInfo()
|
2024-01-31 12:05:11 -05:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2024-02-16 16:08:18 -05:00
|
|
|
|
|
|
|
|
|
dgvPatient.DoubleClick += cmuPatientEdit_Click;
|
2024-02-19 13:38:27 -05:00
|
|
|
|
dgvPhysician.DoubleClick += cmuPhysicianEdit_Click;
|
2024-02-19 16:27:27 -05:00
|
|
|
|
dgvPrescription.DoubleClick += cmuRxEdit_Click;
|
2024-02-16 16:08:18 -05:00
|
|
|
|
|
2024-02-19 14:19:36 -05:00
|
|
|
|
tbcInfo.SelectedIndexChanged += frmInfoTabChange;
|
|
|
|
|
|
2024-01-31 12:05:11 -05:00
|
|
|
|
}
|
2024-02-02 16:00:30 -05:00
|
|
|
|
|
|
|
|
|
private void frmInfo_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
2024-02-14 19:27:21 -05:00
|
|
|
|
KeyPreview = true;
|
|
|
|
|
KeyDown += frmInfo_KeyDown;
|
2024-02-15 12:04:26 -05:00
|
|
|
|
|
|
|
|
|
cmuPatientEdit.Enabled = false;
|
|
|
|
|
cmuPatientDelete.Enabled = false;
|
2024-02-19 21:24:58 -05:00
|
|
|
|
cmuPhysicianEdit.Enabled = false;
|
|
|
|
|
cmuPhysicianDelete.Enabled = false;
|
|
|
|
|
cmuRxEdit.Enabled = false;
|
|
|
|
|
cmuRxDelete.Enabled = false;
|
2024-02-15 12:04:26 -05:00
|
|
|
|
|
2024-02-16 16:08:18 -05:00
|
|
|
|
|
2024-02-16 19:36:56 -05:00
|
|
|
|
txtPatientFirst.Focus();
|
|
|
|
|
|
2024-02-19 14:19:36 -05:00
|
|
|
|
patientIsActive = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-19 16:27:27 -05:00
|
|
|
|
private bool physicianIsActive;
|
|
|
|
|
private bool patientIsActive;
|
|
|
|
|
private bool medicationIsActive;
|
2024-02-19 14:19:36 -05:00
|
|
|
|
private void frmInfoTabChange(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(tbcInfo.SelectedIndex);
|
|
|
|
|
|
|
|
|
|
patientIsActive = false;
|
|
|
|
|
physicianIsActive = false;
|
2024-02-19 16:27:27 -05:00
|
|
|
|
medicationIsActive = false;
|
|
|
|
|
|
2024-02-19 14:19:36 -05:00
|
|
|
|
|
|
|
|
|
if (tbcInfo.SelectedIndex == 0)
|
|
|
|
|
{
|
|
|
|
|
patientIsActive = true;
|
2024-02-19 16:27:27 -05:00
|
|
|
|
}
|
|
|
|
|
else if (tbcInfo.SelectedIndex == 1)
|
|
|
|
|
{
|
|
|
|
|
medicationIsActive = true;
|
|
|
|
|
}
|
|
|
|
|
else if (tbcInfo.SelectedIndex == 2)
|
2024-02-19 14:19:36 -05:00
|
|
|
|
{
|
|
|
|
|
physicianIsActive = true;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-02 16:00:30 -05:00
|
|
|
|
}
|
2024-02-06 11:46:50 -05:00
|
|
|
|
|
2024-02-14 19:27:21 -05:00
|
|
|
|
private void frmInfo_KeyDown(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
2024-02-19 14:19:36 -05:00
|
|
|
|
if (e.KeyCode == Keys.Escape)
|
|
|
|
|
{this.Close();
|
2024-02-14 19:27:21 -05:00
|
|
|
|
}
|
|
|
|
|
|
2024-02-19 16:27:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if data grid view is not focused, run the search function
|
2024-02-19 14:19:36 -05:00
|
|
|
|
if (e.KeyCode == Keys.Enter && physicianIsActive && !dgvPhysician.Focused){
|
2024-02-19 10:47:16 -05:00
|
|
|
|
btnPhysicianSearch_Click(sender, e);
|
2024-02-14 19:27:21 -05:00
|
|
|
|
}
|
2024-02-19 14:19:36 -05:00
|
|
|
|
// if data grid view is focused, run the edit function
|
|
|
|
|
else if (e.KeyCode == Keys.Enter && physicianIsActive && dgvPhysician.Focused)
|
|
|
|
|
{
|
|
|
|
|
cmuPhysicianEdit_Click(sender, e);
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-19 16:27:27 -05:00
|
|
|
|
|
|
|
|
|
|
2024-02-19 14:19:36 -05:00
|
|
|
|
// if data grid view is not focused, run the search function
|
|
|
|
|
if (e.KeyCode == Keys.Enter && patientIsActive && !dgvPatient.Focused)
|
|
|
|
|
{
|
|
|
|
|
btnPatientSearch_Click(sender,e);
|
|
|
|
|
}
|
|
|
|
|
// if data grid view is focused, run the edit function
|
|
|
|
|
else if (e.KeyCode == Keys.Enter && patientIsActive && dgvPatient.Focused)
|
|
|
|
|
{
|
|
|
|
|
cmuPatientEdit_Click(sender,e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-02-14 19:27:21 -05:00
|
|
|
|
|
2024-02-19 16:27:27 -05:00
|
|
|
|
// 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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-14 19:27:21 -05:00
|
|
|
|
}
|
|
|
|
|
|
2024-02-06 11:46:50 -05:00
|
|
|
|
private void addUpdatePatientAndPhysicianToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2024-02-07 13:23:25 -05:00
|
|
|
|
|
|
|
|
|
private void pATIENTBindingNavigatorSaveItem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
2024-02-14 18:21:17 -05:00
|
|
|
|
}
|
|
|
|
|
|
2024-02-16 16:08:18 -05:00
|
|
|
|
public void btnPatientSearch_Click(object sender, EventArgs e)
|
2024-02-14 18:21:17 -05:00
|
|
|
|
{
|
|
|
|
|
string fname = "";
|
|
|
|
|
string lname = "";
|
|
|
|
|
string id = "";
|
|
|
|
|
|
2024-02-16 11:32:00 -05:00
|
|
|
|
|
2024-02-14 18:21:17 -05:00
|
|
|
|
|
|
|
|
|
if (txtPatientFirst.Text.Length + txtPatientLast.Text.Length + txtPatientID.Text.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
fname = txtPatientFirst.Text;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
lname = txtPatientLast.Text;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
id = txtPatientID.Text;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ds = PharmacyDataTier.PatientInfoSearch(id,lname,fname);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ds.Tables[0].Rows.Count > 0) // There is a record.
|
|
|
|
|
{
|
|
|
|
|
dgvPatient.Visible = true;
|
|
|
|
|
// Get data source.
|
|
|
|
|
dgvPatient.DataSource = ds.Tables[0];
|
|
|
|
|
dgvPatient.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen;
|
|
|
|
|
|
|
|
|
|
// Set the row and column header styles.
|
|
|
|
|
dgvPatient.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
|
|
|
|
|
dgvPatient.ColumnHeadersDefaultCellStyle.BackColor = Color.Green;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dgvPatient.Visible = false; // Hide the DataGridView if no results are found.
|
|
|
|
|
MessageBox.Show("No records found.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ep1.SetError(btnPatientSearch, "Error Searching");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ep1.SetError(txtPatientID, "Invalid Value");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ep1.SetError(txtPatientLast, "Invalid Value");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
ep1.SetError(txtPatientFirst, "Invalid Value");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2024-02-15 12:04:26 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmuPatientEdit.Enabled = dgvPatient.Rows.Count > 0;
|
|
|
|
|
cmuPatientDelete.Enabled = dgvPatient.Rows.Count > 0;
|
2024-02-14 18:21:17 -05:00
|
|
|
|
|
2024-02-19 14:19:36 -05:00
|
|
|
|
dgvPatient.Focus();
|
2024-02-14 18:21:17 -05:00
|
|
|
|
|
2024-02-07 13:23:25 -05:00
|
|
|
|
}
|
2024-02-14 19:27:21 -05:00
|
|
|
|
|
2024-02-19 21:24:58 -05:00
|
|
|
|
public void btnPrescriptionSearch_Click(object sender, EventArgs e)
|
2024-02-14 19:27:21 -05:00
|
|
|
|
{
|
2024-02-19 21:24:58 -05:00
|
|
|
|
string medID = "";
|
|
|
|
|
string medicationName = "";
|
2024-02-14 19:27:21 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (txtPrescriptionPatID.Text.Length+txtRxNumber.Text.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
2024-02-19 21:24:58 -05:00
|
|
|
|
medicationName = txtPrescriptionPatID.Text;
|
2024-02-14 19:27:21 -05:00
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
2024-02-19 21:24:58 -05:00
|
|
|
|
medID = txtRxNumber.Text;
|
2024-02-14 19:27:21 -05:00
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 21:24:58 -05:00
|
|
|
|
ds = PharmacyDataTier.MedicationInfoSearch(medID,medicationName);
|
2024-02-14 19:27:21 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ds.Tables[0].Rows.Count > 0) // There is a record.
|
|
|
|
|
{
|
|
|
|
|
dgvPrescription.Visible = true;
|
|
|
|
|
// Get data source.
|
|
|
|
|
dgvPrescription.DataSource = ds.Tables[0];
|
|
|
|
|
dgvPrescription.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen;
|
|
|
|
|
|
|
|
|
|
// Set the row and column header styles.
|
|
|
|
|
dgvPrescription.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
|
|
|
|
|
dgvPrescription.ColumnHeadersDefaultCellStyle.BackColor = Color.Green;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dgvPatient.Visible = false; // Hide the DataGridView if no results are found.
|
|
|
|
|
MessageBox.Show("No records found.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
|
2024-02-19 16:27:27 -05:00
|
|
|
|
ep1.SetError(btnMedicationSearch, "Error Searching");
|
2024-02-14 19:27:21 -05:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ep1.SetError(txtRxNumber, "Invalid Value");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ep1.SetError(txtPrescriptionPatID, "Invalid Value");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-19 21:24:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmuRxEdit.Enabled = dgvPrescription.Rows.Count > 0;
|
|
|
|
|
cmuRxDelete.Enabled = dgvPrescription.Rows.Count > 0;
|
|
|
|
|
|
|
|
|
|
dgvPrescription.Focus();
|
|
|
|
|
|
2024-02-14 19:27:21 -05:00
|
|
|
|
}
|
2024-02-19 11:56:51 -05:00
|
|
|
|
|
|
|
|
|
public void btnPhysicianSearch_Click(object sender, EventArgs e)
|
2024-02-14 19:43:07 -05:00
|
|
|
|
{
|
2024-02-15 12:04:26 -05:00
|
|
|
|
|
2024-02-14 19:43:07 -05:00
|
|
|
|
string fname = "";
|
|
|
|
|
string lname = "";
|
|
|
|
|
string phyID = "";;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (txtPhysicianFirst.Text.Length+txtPhysicianLast.Text.Length+txtPhysicianID.Text.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
fname = txtPhysicianFirst.Text;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
lname = txtPhysicianLast.Text;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
phyID = txtPhysicianID.Text;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ds = PharmacyDataTier.PhysicianInfoSearch(fname, lname, phyID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ds.Tables[0].Rows.Count > 0) // There is a record.
|
|
|
|
|
{
|
|
|
|
|
dgvPhysician.Visible = true;
|
|
|
|
|
// Get data source.
|
|
|
|
|
dgvPhysician.DataSource = ds.Tables[0];
|
|
|
|
|
dgvPhysician.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen;
|
|
|
|
|
|
|
|
|
|
// Set the row and column header styles.
|
|
|
|
|
dgvPhysician.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
|
|
|
|
|
dgvPhysician.ColumnHeadersDefaultCellStyle.BackColor = Color.Green;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dgvPatient.Visible = false; // Hide the DataGridView if no results are found.
|
|
|
|
|
MessageBox.Show("No records found.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ep1.SetError(btnPhysicianSearch, "Error Searching");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ep1.SetError(txtPhysicianID, "Invalid Value");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ep1.SetError(txtPhysicianLast, "Invalid Value");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
ep1.SetError(txtPhysicianFirst, "Invalid Value");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2024-02-19 14:19:36 -05:00
|
|
|
|
|
2024-02-19 21:24:58 -05:00
|
|
|
|
|
|
|
|
|
cmuPhysicianEdit.Enabled = dgvPhysician.Rows.Count > 0;
|
|
|
|
|
cmuPhysicianDelete.Enabled = dgvPhysician.Rows.Count > 0;
|
|
|
|
|
|
2024-02-19 14:19:36 -05:00
|
|
|
|
dgvPhysician.Focus();
|
2024-02-15 12:04:26 -05:00
|
|
|
|
|
2024-02-14 19:43:07 -05:00
|
|
|
|
}
|
2024-02-15 08:55:05 -05:00
|
|
|
|
|
|
|
|
|
private void cmuPatientNew_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-02-15 12:04:26 -05:00
|
|
|
|
|
2024-02-16 19:41:26 -05:00
|
|
|
|
frmPatient PatientAdd = new frmPatient(this, true);
|
2024-02-15 12:04:26 -05:00
|
|
|
|
PatientAdd.MdiParent = MdiParent;
|
|
|
|
|
PatientAdd.StartPosition = FormStartPosition.CenterScreen;
|
|
|
|
|
PatientAdd.Show();
|
|
|
|
|
PatientAdd.Focus();
|
|
|
|
|
|
|
|
|
|
|
2024-02-15 08:55:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cmuPatientEdit_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-02-15 12:04:26 -05:00
|
|
|
|
if (dgvPatient.Rows.Count > 0)
|
|
|
|
|
{
|
2024-02-16 11:32:00 -05:00
|
|
|
|
|
|
|
|
|
dgvPatient.DataSource = ds.Tables[0];
|
2024-02-16 10:12:36 -05:00
|
|
|
|
// Console.WriteLine( dgvPatient.SelectedRows.Count);
|
2024-02-16 11:32:00 -05:00
|
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
|
|
row = dgvPatient.SelectedRows[0];
|
2024-02-16 10:12:36 -05:00
|
|
|
|
string patid = "";
|
2024-02-19 13:30:33 -05:00
|
|
|
|
patid = (row.Cells[3].Value).ToString();
|
2024-02-16 19:41:26 -05:00
|
|
|
|
frmPatient PatientAdd = new frmPatient(this, false);
|
2024-02-15 12:04:26 -05:00
|
|
|
|
PatientAdd.MdiParent = MdiParent;
|
|
|
|
|
PatientAdd.StartPosition = FormStartPosition.CenterScreen;
|
|
|
|
|
PatientAdd.Show();
|
|
|
|
|
PatientAdd.Focus();
|
2024-02-16 10:12:36 -05:00
|
|
|
|
PatientAdd.FillPatient(patid);
|
|
|
|
|
|
2024-02-15 12:04:26 -05:00
|
|
|
|
}
|
2024-02-16 10:12:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void dgvPatient_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
2024-02-16 16:08:18 -05:00
|
|
|
|
{
|
|
|
|
|
cmuPatientEdit_Click(sender, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Panel1_Paint(object sender, PaintEventArgs e)
|
2024-02-16 10:12:36 -05:00
|
|
|
|
{
|
|
|
|
|
|
2024-02-16 16:08:18 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cmuPatientDelete_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (dgvPatient.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
dgvPatient.DataSource = ds.Tables[0];
|
|
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
|
|
row = dgvPatient.SelectedRows[0];
|
|
|
|
|
string patid = "";
|
2024-02-19 14:37:25 -05:00
|
|
|
|
patid = (row.Cells[3].Value).ToString();
|
2024-02-16 16:08:18 -05:00
|
|
|
|
PharmacyDataTier.DeletePatient(patid);
|
|
|
|
|
btnPatientSearch_Click(sender, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-02-15 08:55:05 -05:00
|
|
|
|
}
|
2024-02-16 20:13:30 -05:00
|
|
|
|
|
|
|
|
|
private void cmuPhysicianNew_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
frmPhysician physicianAdd = new frmPhysician(this, true);
|
|
|
|
|
physicianAdd.MdiParent = MdiParent;
|
|
|
|
|
physicianAdd.StartPosition = FormStartPosition.CenterScreen;
|
|
|
|
|
physicianAdd.Show();
|
|
|
|
|
physicianAdd.Focus();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cmuPhysicianEdit_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-02-19 10:47:16 -05:00
|
|
|
|
|
|
|
|
|
if (dgvPhysician.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
dgvPhysician.DataSource = ds.Tables[0];
|
|
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
|
|
row = dgvPhysician.SelectedRows[0];
|
|
|
|
|
string phyID = "";
|
2024-02-19 13:30:33 -05:00
|
|
|
|
phyID = (row.Cells[0].Value).ToString();
|
2024-02-19 10:47:16 -05:00
|
|
|
|
frmPhysician PhysicianAdd = new frmPhysician(this, false);
|
|
|
|
|
PhysicianAdd.MdiParent = MdiParent;
|
|
|
|
|
PhysicianAdd.StartPosition = FormStartPosition.CenterScreen;
|
|
|
|
|
PhysicianAdd.Show();
|
|
|
|
|
PhysicianAdd.Focus();
|
|
|
|
|
PhysicianAdd.FillPhysician(phyID);
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-16 20:13:30 -05:00
|
|
|
|
}
|
2024-02-19 13:11:10 -05:00
|
|
|
|
|
|
|
|
|
private void cmuPhysicianDelete_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (dgvPhysician.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
dgvPhysician.DataSource = ds.Tables[0];
|
|
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
|
|
row = dgvPhysician.SelectedRows[0];
|
|
|
|
|
string phyID = "";
|
2024-02-19 14:37:25 -05:00
|
|
|
|
phyID = (row.Cells[0].Value).ToString();
|
2024-02-19 13:11:10 -05:00
|
|
|
|
PharmacyDataTier.DeletePhysician(phyID);
|
2024-02-19 21:24:58 -05:00
|
|
|
|
PhysicianReset(sender, e);
|
2024-02-19 13:11:10 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-19 21:24:58 -05:00
|
|
|
|
private void PhysicianReset(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
txtPhysicianFirst.Text = "";
|
|
|
|
|
txtPhysicianLast.Text = "";
|
|
|
|
|
txtPhysicianID.Text = "";
|
|
|
|
|
dgvPhysician.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-19 13:11:10 -05:00
|
|
|
|
private void dgvPhysician_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void dgvPhysician_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
}
|
2024-02-19 16:27:27 -05:00
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2024-02-19 21:24:58 -05:00
|
|
|
|
if (dgvPrescription.Rows.Count > 0)
|
2024-02-19 16:27:27 -05:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
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)
|
2024-02-19 21:24:58 -05:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (dgvPrescription.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
dgvPrescription.DataSource = ds.Tables[0];
|
|
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
|
|
row = dgvPrescription.SelectedRows[0];
|
|
|
|
|
string medID = "";
|
|
|
|
|
medID = (row.Cells[0].Value).ToString();
|
|
|
|
|
PharmacyDataTier.DeleteMedication(medID);
|
|
|
|
|
btnPrescriptionSearch_Click(sender, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void lblDisMedicationNum_Click(object sender, EventArgs e)
|
2024-02-19 16:27:27 -05:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2024-01-31 12:05:11 -05:00
|
|
|
|
}
|
|
|
|
|
}
|