search work

This commit is contained in:
EggMan20339 2024-02-16 11:32:00 -05:00
parent 22bb09981a
commit 28286960c5
4 changed files with 478 additions and 544 deletions

View File

@ -26,9 +26,9 @@ namespace Louis__Pharmacy_CNSA212_FP
cmdString.Connection = myConn;
cmdString.CommandType = CommandType.StoredProcedure;
cmdString.CommandTimeout = 1500;
cmdString.CommandText = "PatientInfoSearch";
cmdString.CommandText = "SearchPatients";
// Define input parameter
cmdString.Parameters.Add("@patientID", SqlDbType.VarChar, 6).Value = id;
cmdString.Parameters.Add("@ID", SqlDbType.VarChar, 8).Value = id;
cmdString.Parameters.Add("@lname", SqlDbType.VarChar, 30).Value = lname;
cmdString.Parameters.Add("@fname", SqlDbType.VarChar, 30).Value = fname;
// adapter and dataset
@ -64,9 +64,11 @@ namespace Louis__Pharmacy_CNSA212_FP
cmdString.Connection = myConn;
cmdString.CommandType = CommandType.StoredProcedure;
cmdString.CommandTimeout = 1500;
cmdString.CommandText = "PatientInfoSearch";
cmdString.CommandText = "SearchPatients";
// Define input parameter
cmdString.Parameters.Add("@patientID", SqlDbType.VarChar, 6).Value = id;
cmdString.Parameters.Add("@ID", SqlDbType.VarChar, 8).Value = id;
cmdString.Parameters.Add("@lname", SqlDbType.VarChar, 30).Value = "";
cmdString.Parameters.Add("@fname", SqlDbType.VarChar, 30).Value = "";
// adapter and dataset
SqlDataAdapter aAdapter = new SqlDataAdapter();
aAdapter.SelectCommand = cmdString;

File diff suppressed because it is too large Load Diff

View File

@ -13,8 +13,11 @@ namespace Louis__Pharmacy_CNSA212_FP
{
public partial class frmInfo : Form
{
private ErrorProvider ep1 = new ErrorProvider();
public DataSet ds = new DataSet();
public frmInfo()
{
InitializeComponent();
@ -60,7 +63,7 @@ namespace Louis__Pharmacy_CNSA212_FP
string lname = "";
string id = "";
DataSet ds = new DataSet();
if (txtPatientFirst.Text.Length + txtPatientLast.Text.Length + txtPatientID.Text.Length > 0)
{
@ -150,7 +153,6 @@ namespace Louis__Pharmacy_CNSA212_FP
string rxID = "";
string patientID = "";
DataSet ds = new DataSet();
if (txtPrescriptionPatID.Text.Length+txtRxNumber.Text.Length > 0)
{
@ -225,7 +227,6 @@ namespace Louis__Pharmacy_CNSA212_FP
string lname = "";
string phyID = "";;
DataSet ds = new DataSet();
if (txtPhysicianFirst.Text.Length+txtPhysicianLast.Text.Length+txtPhysicianID.Text.Length > 0)
{
@ -322,10 +323,13 @@ namespace Louis__Pharmacy_CNSA212_FP
{
if (dgvPatient.Rows.Count > 0)
{
dgvPatient.DataSource = ds.Tables[0];
// Console.WriteLine( dgvPatient.SelectedRows.Count);
DataGridViewRow row = dgvPatient.SelectedRows[0];
DataGridViewRow row = new DataGridViewRow();
row = dgvPatient.SelectedRows[0];
string patid = "";
patid = (row.Cells[0].Value).ToString();
patid = (row.Cells[4].Value).ToString();
frmPatientAdd PatientAdd = new frmPatientAdd(false);
PatientAdd.MdiParent = MdiParent;
PatientAdd.StartPosition = FormStartPosition.CenterScreen;

View File

@ -59,7 +59,7 @@ namespace Louis__Pharmacy_CNSA212_FP
txtPatientID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString();
txtFname.Text = ds.Tables[0].Rows[0]["FirstName"].ToString();
txtLname.Text = ds.Tables[0].Rows[0]["LastName"].ToString();
txtMidInit.Text = ds.Tables[0].Rows[0]["MiddleInitals"].ToString();
txtMidInit.Text = ds.Tables[0].Rows[0]["MiddleIntials"].ToString();
txtWeight.Text = ds.Tables[0].Rows[0]["lbs"].ToString();
txtHeightFt.Text = ds.Tables[0].Rows[0]["Height_feet"].ToString();
txtHeightIn.Text = ds.Tables[0].Rows[0]["Height_inches"].ToString();