2024-03-20 13:04:27 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Web.UI;
|
2024-03-28 15:04:52 -04:00
|
|
|
|
using System.Data;
|
2024-03-20 13:04:27 -04:00
|
|
|
|
|
|
|
|
|
namespace FWA_MAIN
|
|
|
|
|
{
|
|
|
|
|
public partial class patEdit : Page
|
|
|
|
|
{
|
2024-03-28 15:04:52 -04:00
|
|
|
|
|
|
|
|
|
protected string patID;
|
|
|
|
|
|
2024-03-20 13:04:27 -04:00
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-03-28 15:04:52 -04:00
|
|
|
|
|
|
|
|
|
patID = Crypt.Decrypt(Request.QueryString["ID"]);
|
2024-03-20 13:04:27 -04:00
|
|
|
|
|
2024-03-28 15:04:52 -04:00
|
|
|
|
|
|
|
|
|
txtPatID.Enabled = false;
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
FillPatient(patID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void FillPatient(string id)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var ds = new DataSet();
|
|
|
|
|
ds = PharmacyDataTier.PatientInfoSearch(patID);
|
|
|
|
|
|
2024-04-03 08:27:59 -04:00
|
|
|
|
txtPatID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString().Trim();
|
|
|
|
|
txtFNAME.Text = ds.Tables[0].Rows[0]["FirstName"].ToString().Trim();
|
|
|
|
|
txtLNAME.Text = ds.Tables[0].Rows[0]["LastName"].ToString().Trim();
|
|
|
|
|
txtMidInit.Text = ds.Tables[0].Rows[0]["MiddleIntials"].ToString().Trim();
|
|
|
|
|
txtWeight.Text = ds.Tables[0].Rows[0]["lbs"].ToString().Trim();
|
|
|
|
|
txtHeightFt.Text = ds.Tables[0].Rows[0]["Height_feet"].ToString().Trim();
|
|
|
|
|
txtHeightIn.Text = ds.Tables[0].Rows[0]["Height_inches"].ToString().Trim();
|
|
|
|
|
DateTime date = DateTime.Parse(ds.Tables[0].Rows[0]["DOB"].ToString().Trim());
|
2024-03-28 15:04:52 -04:00
|
|
|
|
txtDOB.Text = date.ToString("d");
|
2024-04-03 08:27:59 -04:00
|
|
|
|
txtGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString().Trim();
|
|
|
|
|
txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString().Trim();
|
|
|
|
|
txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString().Trim();
|
|
|
|
|
txtState.Text = ds.Tables[0].Rows[0]["UsState"].ToString().Trim();
|
|
|
|
|
txtPhoneNum.Text = ds.Tables[0].Rows[0]["PhoneNumber"].ToString().Trim();
|
2024-03-28 15:04:52 -04:00
|
|
|
|
|
2024-03-20 13:04:27 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void btnCancelPat_OnClick(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-03-28 15:04:52 -04:00
|
|
|
|
Response.Redirect("patSearch.aspx");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void btnSavePat_OnClick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string id = Val.varchar(txtPatID, 8);
|
|
|
|
|
string FNAME = Val.varchar(txtFNAME, 30);
|
|
|
|
|
string LNAME = Val.varchar(txtLNAME, 30);
|
|
|
|
|
string MidInit = Val.varchar(txtMidInit, 1);
|
|
|
|
|
int Weight = Val.IntType(txtWeight);
|
|
|
|
|
int HeightFt = Val.IntType(txtHeightFt);
|
|
|
|
|
int HeightIn = Val.IntType(txtHeightIn);
|
|
|
|
|
DateTime date = Val.Date(txtDOB);
|
|
|
|
|
string gender = Val.varchar(txtGender, 1);
|
|
|
|
|
string city = Val.varchar(txtCity, 30);
|
|
|
|
|
short zip = Val.SmallIntType(txtZip);
|
|
|
|
|
string state = Val.varchar(txtState, 2);
|
|
|
|
|
string phone = Val.varchar(txtPhoneNum, 14);
|
|
|
|
|
|
|
|
|
|
PharmacyDataTier.UpdatePatient(id,FNAME,LNAME,MidInit,Weight,HeightFt,HeightIn,date,gender,city,zip,state,phone);
|
|
|
|
|
|
|
|
|
|
Response.Redirect("patSearch.aspx");
|
|
|
|
|
|
2024-03-20 13:04:27 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|