diff --git a/FWA_MAIN/Val.cs b/FWA_MAIN/Val.cs index 80d9d8f..9f6d11b 100644 --- a/FWA_MAIN/Val.cs +++ b/FWA_MAIN/Val.cs @@ -23,7 +23,15 @@ namespace FWA_MAIN public static int IntType(TextBox box) { - return int.Parse(box.Text.Trim()); + try + { + + return int.Parse(box.Text.Trim()); + } + catch (Exception e) + { + return 0; + } } diff --git a/FWA_MAIN/bin/FWA_MAIN.dll b/FWA_MAIN/bin/FWA_MAIN.dll index 970dbd1..9ce8db4 100644 Binary files a/FWA_MAIN/bin/FWA_MAIN.dll and b/FWA_MAIN/bin/FWA_MAIN.dll differ diff --git a/FWA_MAIN/bin/FWA_MAIN.pdb b/FWA_MAIN/bin/FWA_MAIN.pdb index c01e1c1..4017860 100644 Binary files a/FWA_MAIN/bin/FWA_MAIN.pdb and b/FWA_MAIN/bin/FWA_MAIN.pdb differ diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.dll b/FWA_MAIN/obj/Debug/FWA_MAIN.dll index 970dbd1..9ce8db4 100644 Binary files a/FWA_MAIN/obj/Debug/FWA_MAIN.dll and b/FWA_MAIN/obj/Debug/FWA_MAIN.dll differ diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.pdb b/FWA_MAIN/obj/Debug/FWA_MAIN.pdb index c01e1c1..4017860 100644 Binary files a/FWA_MAIN/obj/Debug/FWA_MAIN.pdb and b/FWA_MAIN/obj/Debug/FWA_MAIN.pdb differ diff --git a/FWA_MAIN/patNew.aspx b/FWA_MAIN/patNew.aspx index 8b08fec..ed2f629 100644 --- a/FWA_MAIN/patNew.aspx +++ b/FWA_MAIN/patNew.aspx @@ -47,7 +47,7 @@
-
+
\ No newline at end of file diff --git a/FWA_MAIN/patNew.aspx.cs b/FWA_MAIN/patNew.aspx.cs index bbf8098..ecc82a5 100644 --- a/FWA_MAIN/patNew.aspx.cs +++ b/FWA_MAIN/patNew.aspx.cs @@ -5,14 +5,41 @@ namespace FWA_MAIN { public partial class patNew : Page { + protected string patID; + 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) { - 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"); } } } \ No newline at end of file