78 lines
2.9 KiB
C#
78 lines
2.9 KiB
C#
using System;
|
|
using System.Web.UI;
|
|
using System.Data;
|
|
|
|
namespace FWA_MAIN
|
|
{
|
|
public partial class patEdit : Page
|
|
{
|
|
|
|
protected string patID;
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
patID = Crypt.Decrypt(Request.QueryString["ID"]);
|
|
|
|
|
|
txtPatID.Enabled = false;
|
|
if (!IsPostBack)
|
|
{
|
|
|
|
FillPatient(patID);
|
|
}
|
|
|
|
}
|
|
|
|
protected void FillPatient(string id)
|
|
{
|
|
|
|
var ds = new DataSet();
|
|
ds = PharmacyDataTier.PatientInfoSearch(patID);
|
|
|
|
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());
|
|
txtDOB.Text = date.ToString("d");
|
|
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();
|
|
|
|
}
|
|
|
|
protected void btnCancelPat_OnClick(object sender, EventArgs e)
|
|
{
|
|
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");
|
|
|
|
}
|
|
}
|
|
} |