new patient works

This commit is contained in:
caschick221 2024-03-28 15:21:56 -04:00
parent 389ac65817
commit 8fc2e1ab81
7 changed files with 38 additions and 3 deletions

View File

@ -23,7 +23,15 @@ namespace FWA_MAIN
public static int IntType(TextBox box) public static int IntType(TextBox box)
{ {
return int.Parse(box.Text.Trim()); try
{
return int.Parse(box.Text.Trim());
}
catch (Exception e)
{
return 0;
}
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -47,7 +47,7 @@
</div> </div>
<br/> <br/>
<div class="patDiv" style="margin-left: 500px"> <div class="patDiv" style="margin-left: 500px">
<div style="margin-right: 10px; display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnSavePat" Text="Create"/></div> <div style="margin-right: 10px; display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnSavePat" Text="Create" OnClick="btnSavePat_OnClick"/></div>
<div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelPat" Text="Cancel" OnClick="btnCancelPat_OnClick"/></div> <div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelPat" Text="Cancel" OnClick="btnCancelPat_OnClick"/></div>
</div> </div>
</asp:Content> </asp:Content>

View File

@ -5,14 +5,41 @@ namespace FWA_MAIN
{ {
public partial class patNew : Page public partial class patNew : Page
{ {
protected string patID;
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
patID = Crypt.Decrypt(Request.QueryString["ID"]);
txtPatID.Text = patID;
} }
protected void btnCancelPat_OnClick(object sender, EventArgs e) protected void btnCancelPat_OnClick(object sender, EventArgs e)
{ {
Response.Redirect("patient.aspx"); 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);
Int16 zip = Val.SmallIntType(txtZip);
string state = Val.varchar(txtState, 2);
string phone = Val.varchar(txtPhoneNum, 14);
PharmacyDataTier.CreatePatient(id,FNAME,LNAME,MidInit,Weight,HeightFt,HeightIn,date,gender,city,zip,state,phone);
Response.Redirect("patSearch.aspx");
} }
} }
} }