diff --git a/.idea/.idea.FWA_MAIN/.idea/dataSources.xml b/.idea/.idea.FWA_MAIN/.idea/dataSources.xml index d250876..9c698e4 100644 --- a/.idea/.idea.FWA_MAIN/.idea/dataSources.xml +++ b/.idea/.idea.FWA_MAIN/.idea/dataSources.xml @@ -1,7 +1,15 @@ - + + sqlserver.jb + true + true + com.jetbrains.jdbc.sqlserver.SqlServerDriver + Server=sql.eggtech.net;Database=College2;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino; + $ProjectFileDir$ + + sqlserver.jb true true diff --git a/.idea/config/applicationhost.config b/.idea/config/applicationhost.config index f5fa50f..6aca535 100644 --- a/.idea/config/applicationhost.config +++ b/.idea/config/applicationhost.config @@ -155,7 +155,7 @@ - + diff --git a/FWA_MAIN/Crypt.cs b/FWA_MAIN/Crypt.cs new file mode 100644 index 0000000..c5fe444 --- /dev/null +++ b/FWA_MAIN/Crypt.cs @@ -0,0 +1,77 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Configuration; +using System.Web.UI.WebControls; +using System; +using System.IO; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace FWA_MAIN +{ + public class Crypt + { + static private string encryptKey = + "CXvA@xsFmBik#E4#7tf4zY7JK^qaTUwFYw^QuC7sipSyBPfkS$qFFU%ZQmRb5GY85unfCmEw@dK7Bhiyt%3asL62yygk6x6D@@D8CUnJfF8@F$C9vtJgGwNhmSxvo#Lh"; + + static private string encryptSalt = + "gab-purgatory-studio-atlantic-ladle-challenge-slaw-unshaken-eastward-caring-deftly-devious-crudeness-walrus-glorifier-unsteady-sauciness-feminist-jailbreak-upside"; + + static public string Encrypt(string cleartext) + { + byte[] plainText = Encoding.UTF8.GetBytes(cleartext); + + using (RijndaelManaged rijndaelCipher = new RijndaelManaged()) + { + PasswordDeriveBytes secretKey = new PasswordDeriveBytes(Encoding.ASCII.GetBytes(encryptKey), + Encoding.ASCII.GetBytes(encryptSalt)); + using (ICryptoTransform encryptor = + rijndaelCipher.CreateEncryptor(secretKey.GetBytes(32), secretKey.GetBytes(16))) + { + using (MemoryStream memoryStream = new MemoryStream()) + { + using (CryptoStream cryptoStream = + new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write)) + { + cryptoStream.Write(plainText, 0, plainText.Length); + cryptoStream.FlushFinalBlock(); + string base64 = Convert.ToBase64String(memoryStream.ToArray()); + + // Generate a string that won't get screwed up when passed as a query string. + string urlEncoded = HttpUtility.UrlEncode(base64); + return urlEncoded; + } + } + } + } + } + + static public string Decrypt(string cleartext) + { + byte[] encryptedData = Convert.FromBase64String(cleartext); + PasswordDeriveBytes secretKey = new PasswordDeriveBytes(Encoding.ASCII.GetBytes(encryptKey), + Encoding.ASCII.GetBytes(encryptSalt)); + + using (RijndaelManaged rijndaelCipher = new RijndaelManaged()) + { + using (ICryptoTransform decryptor = + rijndaelCipher.CreateDecryptor(secretKey.GetBytes(32), secretKey.GetBytes(16))) + { + using (MemoryStream memoryStream = new MemoryStream(encryptedData)) + { + using (CryptoStream cryptoStream = + new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read)) + { + byte[] plainText = new byte[encryptedData.Length]; + cryptoStream.Read(plainText, 0, plainText.Length); + string utf8 = Encoding.UTF8.GetString(plainText); + return utf8.Trim('\0'); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/FWA_MAIN/FWA_MAIN.csproj b/FWA_MAIN/FWA_MAIN.csproj index 7bbff8e..2b8ed2e 100644 --- a/FWA_MAIN/FWA_MAIN.csproj +++ b/FWA_MAIN/FWA_MAIN.csproj @@ -117,6 +117,7 @@ + Global.asax @@ -162,11 +163,11 @@ patEdit.aspx - + ASPXCodeBehind - patient.aspx + patSearch.aspx - + ASPXCodeBehind patNew.aspx @@ -187,12 +188,19 @@ physician.aspx - + ASPXCodeBehind - physNew.aspx + preNew.aspx - - physNew.aspx + + preNew.aspx + + + ASPXCodeBehind + Prescription.aspx + + + Prescription.aspx @@ -206,6 +214,7 @@ Default.aspx + @@ -224,11 +233,10 @@ - + - diff --git a/FWA_MAIN/PharmactDataTier.cs b/FWA_MAIN/PharmactDataTier.cs index 90a3087..76e6464 100644 --- a/FWA_MAIN/PharmactDataTier.cs +++ b/FWA_MAIN/PharmactDataTier.cs @@ -831,7 +831,7 @@ namespace FWA_MAIN } - public static double GetNextPatientID() + public static string GetNextPatientID() { try { @@ -845,7 +845,6 @@ namespace FWA_MAIN cmdString.CommandTimeout = 1500; cmdString.CommandText = "GetNextPatientID"; // Define input parameter - cmdString.Parameters.Add("@TableName", SqlDbType.NVarChar, 128).Value = "PATIENT"; object result = cmdString.ExecuteScalar(); double value = 0; @@ -858,10 +857,16 @@ namespace FWA_MAIN { // MessageBox.Show("Error Getting next Patient ID","ERROR",MessageBoxButtons.OK); } - + + string stringval = value.ToString(); + + while (stringval.Length < 8) + { + stringval = "0" + stringval; + } // return dataSet - return value; + return stringval; } catch (Exception ex) { diff --git a/FWA_MAIN/patient.aspx b/FWA_MAIN/Prescription.aspx similarity index 59% rename from FWA_MAIN/patient.aspx rename to FWA_MAIN/Prescription.aspx index c397191..437c6db 100644 --- a/FWA_MAIN/patient.aspx +++ b/FWA_MAIN/Prescription.aspx @@ -1,43 +1,78 @@ -<%@ Page Title="Patients" Language="C#" MasterPageFile="main.master" CodeBehind="patient.aspx.cs" Inherits="FWA_MAIN.patient" %> +<%@ Page Title="Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="Prescription.aspx.cs" Inherits="FWA_MAIN.Prescription" %>

- Patients + Prescriptions

- +

- +


+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
- +

- +


+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+ + +

- +
@@ -56,10 +91,10 @@ style="display: none">
  • - New + New
  • - Edit + Edit
  • Delete diff --git a/FWA_MAIN/patient.aspx.cs b/FWA_MAIN/Prescription.aspx.cs similarity index 57% rename from FWA_MAIN/patient.aspx.cs rename to FWA_MAIN/Prescription.aspx.cs index e2ca2f0..6e946a7 100644 --- a/FWA_MAIN/patient.aspx.cs +++ b/FWA_MAIN/Prescription.aspx.cs @@ -3,22 +3,23 @@ using System.Web.UI; namespace FWA_MAIN { - public partial class patient : Page + public partial class Prescription : Page { protected void Page_Load(object sender, EventArgs e) { } + protected void btnPreSearch_OnClick(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + + protected void btnNew_OnClick(object sender, EventArgs e) { - Response.Redirect("patNew.aspx"); - - } - - protected void btnPatSearch_OnClick(object sender, EventArgs e) - { + Response.Redirect("preNew.aspx"); } } diff --git a/FWA_MAIN/Prescription.aspx.designer.cs b/FWA_MAIN/Prescription.aspx.designer.cs new file mode 100644 index 0000000..bb17373 --- /dev/null +++ b/FWA_MAIN/Prescription.aspx.designer.cs @@ -0,0 +1,112 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FWA_MAIN +{ + + + public partial class Prescription + { + + /// + /// txtRxNum control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRxNum; + + /// + /// txtPhysID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPhysID; + + /// + /// txtPatID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPatID; + + /// + /// txtNumRefill control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNumRefill; + + /// + /// txtPastRefill control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPastRefill; + + /// + /// txtStart control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtStart; + + /// + /// txtPreEnd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPreEnd; + + /// + /// btnPatSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnPatSearch; + + /// + /// gvPatient control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvPatient; + + /// + /// Master property. + /// + /// + /// Auto-generated property. + /// + public new FWA_MAIN.main Master + { + get + { + return ((FWA_MAIN.main)(base.Master)); + } + } + } +} diff --git a/FWA_MAIN/Val.cs b/FWA_MAIN/Val.cs new file mode 100644 index 0000000..9f6d11b --- /dev/null +++ b/FWA_MAIN/Val.cs @@ -0,0 +1,81 @@ +using System; +using System.Web.UI.WebControls; + +namespace FWA_MAIN +{ + public class Val + { + + public static string varchar(TextBox box, int length) + { + + if (box.Text.Length <= length) + { + return box.Text.Trim(); + } + else + { + return ""; + } + + } + + public static int IntType(TextBox box) + { + + try + { + + return int.Parse(box.Text.Trim()); + } + catch (Exception e) + { + return 0; + } + + } + + public static short SmallIntType(TextBox box) + { + try + { + + if (box.Text.Length > 0) + { + if (double.Parse(box.Text) < 65535 && double.Parse(box.Text) >= 0) + { + return short.Parse(box.Text.Trim()); + } + else + { + return 0; + } + } + else + { + return 0; + } + } + catch (Exception e) + { + return 0; + } + } + + public static DateTime Date(TextBox box) + { + try + { + + DateTime date = DateTime.Parse(box.Text.Trim()); + + return date; + + } + catch (Exception e) + { + return new DateTime(3000, 1, 1); + } + } + } +} \ No newline at end of file diff --git a/FWA_MAIN/bin/FWA_MAIN.dll b/FWA_MAIN/bin/FWA_MAIN.dll index b611adc..d634662 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.dll.config b/FWA_MAIN/bin/FWA_MAIN.dll.config index 0bb3f02..b80eae9 100644 --- a/FWA_MAIN/bin/FWA_MAIN.dll.config +++ b/FWA_MAIN/bin/FWA_MAIN.dll.config @@ -14,7 +14,7 @@ - + diff --git a/FWA_MAIN/bin/FWA_MAIN.pdb b/FWA_MAIN/bin/FWA_MAIN.pdb index 07884ac..16534e7 100644 Binary files a/FWA_MAIN/bin/FWA_MAIN.pdb and b/FWA_MAIN/bin/FWA_MAIN.pdb differ diff --git a/FWA_MAIN/main.aspx.cs b/FWA_MAIN/main.aspx.cs index 995544a..7d7a651 100644 --- a/FWA_MAIN/main.aspx.cs +++ b/FWA_MAIN/main.aspx.cs @@ -40,7 +40,7 @@ namespace FWA_MAIN protected void btnPatient_OnClick(object sender, EventArgs e) { - Response.Redirect("patient.aspx"); + Response.Redirect("patSearch.aspx"); } @@ -56,7 +56,7 @@ namespace FWA_MAIN protected void btnPrescription_OnClick(object sender, EventArgs e) { - throw new NotImplementedException(); + Response.Redirect("Prescription.aspx"); } } } \ No newline at end of file diff --git a/FWA_MAIN/main.css b/FWA_MAIN/main.css index 798291a..d54d7f2 100644 --- a/FWA_MAIN/main.css +++ b/FWA_MAIN/main.css @@ -13,6 +13,51 @@ } +.gridview { + outline-color: black; + margin: 10px; + font-family: Arial, sans-serif; + width: auto; + border-collapse: collapse; +} + +.gridview th { + background-color: #101214; + color: #fff; + padding: 5px; + text-align: center; +} + +.gridview td { + /*background-color: #1D2125;*/ + padding: 5px; + width: 120px; + color: #FFFFFF; +} + +.gridview tr:hover { + background-color: #101214; +} + +.gridview .headerstyle { + background-color: #161A1D; + color: white; + font-weight: bold; + text-align: left; +} + +.gridview .rowstyle { + background-color: #1D2125; +} + +.gridview .alternatingrowstyle { + background-color: #2C333A; +} + +.gridview .selectedrowstyle { + background-color: #09326C; +} + .buttonLabel{ text-align: right; @@ -70,7 +115,7 @@ font-size: 16px; color: white; /*border: 2px solid #0056b3;*/ - + } diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache index 187d440..2ae3ac5 100644 Binary files a/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache and b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache differ diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache index fe67137..2e69a80 100644 --- a/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache +++ b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -45d3d63d138360e7ab73dd1d2eec4fe816552351495d36e6dec0aaff47df2394 +e89e31cdadf20fe7db48ef132bf217873437f194debfb0966ea84327b2ae8615 diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.dll b/FWA_MAIN/obj/Debug/FWA_MAIN.dll index b611adc..d634662 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 07884ac..16534e7 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/patEdit.aspx b/FWA_MAIN/patEdit.aspx index f3eee35..bafd888 100644 --- a/FWA_MAIN/patEdit.aspx +++ b/FWA_MAIN/patEdit.aspx @@ -1,7 +1,17 @@ <%@ Page Title="Edit Patient" Language="C#" MasterPageFile="main.master" CodeBehind="patEdit.aspx.cs" Inherits="FWA_MAIN.patEdit" %> - + +

    Edit Patient

    @@ -47,7 +57,7 @@
    -
    +
    \ No newline at end of file diff --git a/FWA_MAIN/patEdit.aspx.cs b/FWA_MAIN/patEdit.aspx.cs index 140477a..93a4b9b 100644 --- a/FWA_MAIN/patEdit.aspx.cs +++ b/FWA_MAIN/patEdit.aspx.cs @@ -1,18 +1,78 @@ 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(); + 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]["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(); + DateTime date = DateTime.Parse(ds.Tables[0].Rows[0]["DOB"].ToString()); + txtDOB.Text = date.ToString("d"); + txtGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString(); + txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString(); + txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString(); + txtState.Text = ds.Tables[0].Rows[0]["UsState"].ToString(); + txtPhoneNum.Text = ds.Tables[0].Rows[0]["PhoneNumber"].ToString(); + } 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); + 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"); + } } } \ No newline at end of file diff --git a/FWA_MAIN/patNew.aspx b/FWA_MAIN/patNew.aspx index 8b08fec..bc5a852 100644 --- a/FWA_MAIN/patNew.aspx +++ b/FWA_MAIN/patNew.aspx @@ -1,7 +1,17 @@ <%@ Page Title="New Patient" Language="C#" MasterPageFile="main.master" CodeBehind="patNew.aspx.cs" Inherits="FWA_MAIN.patNew" %> - + +

    New Patient

    @@ -47,7 +57,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 diff --git a/FWA_MAIN/patSearch.aspx b/FWA_MAIN/patSearch.aspx new file mode 100644 index 0000000..dde386a --- /dev/null +++ b/FWA_MAIN/patSearch.aspx @@ -0,0 +1,162 @@ +<%@ Page Title="Patients" EnableEventValidation="false" Language="C#" MasterPageFile="main.master" CodeBehind="~/patSearch.aspx.cs" Inherits="FWA_MAIN.patSearch" %> + + + + + + +

    + Patients +

    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    + + + + + + + + + + +
    + + + + + + + +
    \ No newline at end of file diff --git a/FWA_MAIN/patSearch.aspx.cs b/FWA_MAIN/patSearch.aspx.cs new file mode 100644 index 0000000..165732e --- /dev/null +++ b/FWA_MAIN/patSearch.aspx.cs @@ -0,0 +1,213 @@ +using System; +using System.Web.UI; +using System.Data; +using System.Drawing; +using System.Web.UI.WebControls; + +namespace FWA_MAIN +{ + public partial class patSearch : Page + { + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + + txtPatID.Text = Convert.ToString(Session["vPatID"]); + txtFNAME.Text = Convert.ToString(Session["vFNAME"]); + txtLNAME.Text = Convert.ToString(Session["vLNAME"]); + + btnPatSearch_OnClick(sender,e); + + } + + } + + protected void btnNew_OnClick(object sender, EventArgs e) + { + + Response.Redirect("patNew.aspx"); + + } + private void BindData() + { + + DataSet ds = new DataSet(); + + string patID = Convert.ToString(Session["vPatID"]); + string LNAME = Convert.ToString(Session["vLNAME"]); + string FNAME = Convert.ToString(Session["vFNAME"]); + + txtPatID.Text = patID; + txtFNAME.Text = FNAME; + txtLNAME.Text = LNAME; + + // if (textHasValues) + // { + ds = PharmacyDataTier.PatientInfoSearch(patID, LNAME, FNAME); + // } + + + // ds = dt.GetStudents(); + gvPatient.DataSource = ds.Tables[0]; + + if (Cache["StudentData"] == null) + { + Cache.Add("StudentData", new DataView(ds.Tables[0]), + null,System.Web.Caching.Cache.NoAbsoluteExpiration, + System.TimeSpan.FromMinutes(10), System.Web.Caching.CacheItemPriority.Default, + null); + } + gvPatient.DataBind(); + + } + protected void btnPatSearch_OnClick(object sender, EventArgs e) + { + if (txtPatID.Text.Trim().Length > 0 || txtFNAME.Text.Trim().Length > 0 || txtLNAME.Text.Trim().Length > 0) + { + + + try + { + + Session["vPatID"] = txtPatID.Text.Trim(); + Session["vFNAME"] = txtFNAME.Text.Trim(); + Session["vLNAME"] = txtLNAME.Text.Trim(); + + Cache.Remove("StudentData"); + BindData(); + + + + } + catch (Exception exception) + { + + + + } + + } + } + + protected void gvPatient_OnRowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(gvPatient, "Select$" + e.Row.RowIndex); + e.Row.ToolTip = "Click to select this row."; + } + } + + protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) + { + BindData(); + } + + protected void gvPatient_OnRowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "Select") + { + // Determine the index of the selected row + int index = Convert.ToInt32(e.CommandArgument); + + // Check if the selected row index is the same as the previous selected row index + if (gvPatient.SelectedIndex == index) + { + // Deselect the row + gvPatient.SelectedIndex = -1; + } + else + { + // Select the row + gvPatient.SelectedIndex = index; + } + + // Refresh the GridView to update the style + gvPatient.DataBind(); + } + } + + protected void btnPatNew_OnClick(object sender, EventArgs e) + { + + string patientID; + + try + { + Session["vPatID"] = txtPatID.Text.Trim(); + Session["vFNAME"] = txtFNAME.Text.Trim(); + Session["vLNAME"] = txtLNAME.Text.Trim(); + + // Use the patientID value as needed + try + { + + patientID = PharmacyDataTier.GetNextPatientID(); + patientID = Crypt.Encrypt(patientID); + Response.Redirect("patNew.aspx" + "?" + "ID=" + patientID, false); + } + catch (Exception exception) + { + } + + + } + catch (Exception ex) + { + throw new Exception(ex.Message, ex.InnerException); + } + + } + + protected void bntPatEdit_OnClick(object sender, EventArgs e) + { + string patientID = "0"; + Int64 mEditedRecord = 0; + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + + try + { + Session["vPatID"] = txtPatID.Text.Trim(); + Session["vFNAME"] = txtFNAME.Text.Trim(); + Session["vLNAME"] = txtLNAME.Text.Trim(); + + + try + { + + patientID = Crypt.Encrypt(gvPatient.SelectedRow.Cells[0].Text); + Response.Redirect("patEdit.aspx" + "?" + "ID=" + patientID, false); + } + catch (Exception exception) + { + } + + // Use the patientID value as needed + + + + } + catch (Exception ex) + { + throw new Exception(ex.Message, ex.InnerException); + } + } + + protected void btnPatDelete_OnClick(object sender, EventArgs e) + { + try + { + + PharmacyDataTier.DeletePatient(gvPatient.SelectedRow.Cells[0].Text); + BindData(); + } + catch (Exception exception) + { + + } + + } + } +} \ No newline at end of file diff --git a/FWA_MAIN/patient.aspx.designer.cs b/FWA_MAIN/patSearch.aspx.designer.cs similarity index 69% rename from FWA_MAIN/patient.aspx.designer.cs rename to FWA_MAIN/patSearch.aspx.designer.cs index 0a16a11..2ee1597 100644 --- a/FWA_MAIN/patient.aspx.designer.cs +++ b/FWA_MAIN/patSearch.aspx.designer.cs @@ -11,7 +11,7 @@ namespace FWA_MAIN { - public partial class patient + public partial class patSearch { /// @@ -59,6 +59,33 @@ namespace FWA_MAIN /// protected global::System.Web.UI.WebControls.GridView gvPatient; + /// + /// btnPatNew control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnPatNew; + + /// + /// bntPatEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button bntPatEdit; + + /// + /// btnPatDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnPatDelete; + /// /// Master property. /// diff --git a/FWA_MAIN/preNew.aspx b/FWA_MAIN/preNew.aspx new file mode 100644 index 0000000..c989a64 --- /dev/null +++ b/FWA_MAIN/preNew.aspx @@ -0,0 +1,42 @@ +<%@ Page Title="New Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="preNew.aspx.cs" Inherits="FWA_MAIN.preNew" %> + + + + + +

    New Prescription

    +
    +
    +
    +

    +

    +

    +

    +

    +

    +

    +

    + +
    +
    +

    +

    +

    +

    +

    +

    +

    +

    + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/FWA_MAIN/preNew.aspx.cs b/FWA_MAIN/preNew.aspx.cs new file mode 100644 index 0000000..3ebd8c1 --- /dev/null +++ b/FWA_MAIN/preNew.aspx.cs @@ -0,0 +1,18 @@ +using System; +using System.Web.UI; + +namespace FWA_MAIN +{ + public partial class preNew : Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnCancelPre_OnClick(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/FWA_MAIN/preNew.aspx.designer.cs b/FWA_MAIN/preNew.aspx.designer.cs new file mode 100644 index 0000000..7678379 --- /dev/null +++ b/FWA_MAIN/preNew.aspx.designer.cs @@ -0,0 +1,121 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FWA_MAIN +{ + + + public partial class preNew + { + + /// + /// txtRxNum control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRxNum; + + /// + /// txtNumRefill control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNumRefill; + + /// + /// txtPastRefill control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPastRefill; + + /// + /// txtPhysID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPhysID; + + /// + /// txtMedID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMedID; + + /// + /// txtPatID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPatID; + + /// + /// txtPreStart control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPreStart; + + /// + /// txtPreEnd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPreEnd; + + /// + /// btnSavePat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSavePat; + + /// + /// btnCancelPat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelPat; + + /// + /// Master property. + /// + /// + /// Auto-generated property. + /// + public new FWA_MAIN.main Master + { + get + { + return ((FWA_MAIN.main)(base.Master)); + } + } + } +}