diff --git a/.idea/.idea.FWA_MAIN/.idea/dataSources.xml b/.idea/.idea.FWA_MAIN/.idea/dataSources.xml index 9c698e4..12eff08 100644 --- a/.idea/.idea.FWA_MAIN/.idea/dataSources.xml +++ b/.idea/.idea.FWA_MAIN/.idea/dataSources.xml @@ -1,7 +1,7 @@ - + sqlserver.jb true true @@ -9,7 +9,7 @@ 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/.idea.FWA_MAIN/.idea/indexLayout.xml b/.idea/.idea.FWA_MAIN/.idea/indexLayout.xml index 7b08163..3b17e0a 100644 --- a/.idea/.idea.FWA_MAIN/.idea/indexLayout.xml +++ b/.idea/.idea.FWA_MAIN/.idea/indexLayout.xml @@ -2,7 +2,11 @@ - + + FWA_MAIN/Prescription.aspx + FWA_MAIN/physNew.aspx + FWA_MAIN/preNew.aspx + \ No newline at end of file diff --git a/.idea/config/applicationhost.config b/.idea/config/applicationhost.config index 6aca535..15916dc 100644 --- a/.idea/config/applicationhost.config +++ b/.idea/config/applicationhost.config @@ -155,7 +155,7 @@ - + diff --git a/FWA_MAIN/FWA_MAIN.csproj b/FWA_MAIN/FWA_MAIN.csproj index 2b8ed2e..2fe263f 100644 --- a/FWA_MAIN/FWA_MAIN.csproj +++ b/FWA_MAIN/FWA_MAIN.csproj @@ -128,6 +128,13 @@ main.master + + ASPXCodeBehind + MaxRefillNotif.aspx + + + MaxRefillNotif.aspx + ASPXCodeBehind medDelete.aspx @@ -188,6 +195,13 @@ physician.aspx + + ASPXCodeBehind + preEdit.aspx + + + preEdit.aspx + ASPXCodeBehind preNew.aspx @@ -203,6 +217,20 @@ Prescription.aspx + + ASPXCodeBehind + RefEdit.aspx + + + RefEdit.aspx + + + ASPXCodeBehind + Refills.aspx + + + Refills.aspx + ASPXCodeBehind testpage.aspx @@ -228,6 +256,7 @@ + @@ -237,6 +266,11 @@ + + + + + diff --git a/FWA_MAIN/MaxRefillNotif.aspx b/FWA_MAIN/MaxRefillNotif.aspx new file mode 100644 index 0000000..de2ab23 --- /dev/null +++ b/FWA_MAIN/MaxRefillNotif.aspx @@ -0,0 +1,29 @@ +<%@ Page Language="C#" CodeBehind="MaxRefillNotif.aspx.cs" Inherits="FWA_MAIN.MaxRefillNotif" %> + + + + + + + + + + + Title + + +
+
+

MAX REFILLS REACHED

+
+ +
+
+
+ + + + + \ No newline at end of file diff --git a/FWA_MAIN/MaxRefillNotif.aspx.cs b/FWA_MAIN/MaxRefillNotif.aspx.cs new file mode 100644 index 0000000..694e114 --- /dev/null +++ b/FWA_MAIN/MaxRefillNotif.aspx.cs @@ -0,0 +1,20 @@ +using System; +using System.Security.Principal; +using System.Web.UI; + +namespace FWA_MAIN +{ + public partial class MaxRefillNotif : Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnClose_OnClick(object sender, EventArgs e) + { + string script = "window.close();"; + ClientScript.RegisterStartupScript(this.GetType(), "closeWindow", script, true); + } + } +} \ No newline at end of file diff --git a/FWA_MAIN/MaxRefillNotif.aspx.designer.cs b/FWA_MAIN/MaxRefillNotif.aspx.designer.cs new file mode 100644 index 0000000..99bc42f --- /dev/null +++ b/FWA_MAIN/MaxRefillNotif.aspx.designer.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// 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 MaxRefillNotif + { + + /// + /// HtmlForm control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm HtmlForm; + + /// + /// btnClose control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnClose; + } +} diff --git a/FWA_MAIN/MediSearch.aspx b/FWA_MAIN/MediSearch.aspx index 11d9971..74afe15 100644 --- a/FWA_MAIN/MediSearch.aspx +++ b/FWA_MAIN/MediSearch.aspx @@ -2,26 +2,21 @@ - + - + - +

Medications @@ -61,15 +56,23 @@ - + - - - - - + + + + + + diff --git a/FWA_MAIN/MediSearch.aspx.cs b/FWA_MAIN/MediSearch.aspx.cs index dce0cf9..674758d 100644 --- a/FWA_MAIN/MediSearch.aspx.cs +++ b/FWA_MAIN/MediSearch.aspx.cs @@ -1,4 +1,5 @@ using System; +using System.Data; using System.Web.UI; using System.Web.UI.WebControls; @@ -8,20 +9,120 @@ namespace FWA_MAIN { protected void Page_Load(object sender, EventArgs e) { + if (!IsPostBack) + { + + txtMedID.Text = Convert.ToString(Session["vMedID"]); + txtMedName.Text = Convert.ToString(Session["vMedName"]); + txtRxNum.Text = Convert.ToString(Session["vRxNum"]); + + btnMediSearch_OnClick(sender,e); + } } + + private void BindData() + { + + DataSet ds = new DataSet(); + + string medID = Convert.ToString(Session["vMedID"]); + string medicationname = Convert.ToString(Session["vMedName"]); + //string RxNum = Convert.ToString(Session["vRxNum"]); + + txtMedID.Text = medID; + txtMedName.Text = medicationname; + //txtRxNum.Text = RxNum; + + // if (textHasValues) + // { + ds = PharmacyDataTier.MedicationInfoSearch(medID, medicationname); + // } + + + // ds = dt.GetStudents(); + gvMedication.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); + } + gvMedication.DataBind(); + + } + + protected void btnMediSearch_OnClick(object sender, EventArgs e) { - throw new NotImplementedException(); + if (txtMedID.Text.Trim().Length > 0 || txtMedName.Text.Trim().Length > 0 || txtRxNum.Text.Trim().Length > 0) + { + + + try + { + + Session["vMedID"] = txtMedID.Text.Trim(); + Session["vMedName"] = txtMedName.Text.Trim(); + Session["vRxNum"] = txtRxNum.Text.Trim(); + + Cache.Remove("StudentData"); + BindData(); + + + + } + catch (Exception exception) + { + + + + } + + } } - protected void gvMedication_OnSelectedIndexChanged(object sender, EventArgs e) - { - throw new NotImplementedException(); - } + protected void gvMedication_OnRowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(gvMedication, "Select$" + e.Row.RowIndex); + e.Row.ToolTip = "Click to select this row."; + } + } + + + + protected void gvMedication_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 (gvMedication.SelectedIndex == index) + { + // Deselect the row + gvMedication.SelectedIndex = -1; + } + else + { + // Select the row + gvMedication.SelectedIndex = index; + } + + // Refresh the GridView to update the style + gvMedication.DataBind(); + } + } + + protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { throw new NotImplementedException(); } diff --git a/FWA_MAIN/PharmactDataTier.cs b/FWA_MAIN/PharmactDataTier.cs index 76e6464..d8298cc 100644 --- a/FWA_MAIN/PharmactDataTier.cs +++ b/FWA_MAIN/PharmactDataTier.cs @@ -959,7 +959,7 @@ namespace FWA_MAIN } } - public static double GetNextRxNum() + public static string GetNextRxNum() { try { @@ -984,10 +984,17 @@ namespace FWA_MAIN { // MessageBox.Show("Error Getting next Rx Number", "ERROR", MessageBoxButtons.OK); } + string stringval = value.ToString(); + while (stringval.Length < 11) + { + stringval = "0" + stringval; + } // return dataSet - return value; + return stringval; + + } catch (Exception ex) { @@ -1074,7 +1081,7 @@ namespace FWA_MAIN } } - public static double GetNextRefillID() + public static string GetNextRefillID() { try { @@ -1102,9 +1109,15 @@ namespace FWA_MAIN // MessageBox.Show("Error Getting next Refill ID", "ERROR", MessageBoxButtons.OK); } + string stringval = value.ToString(); + + while (stringval.Length < 10) + { + stringval = "0" + stringval; + } // return dataSet - return value; + return stringval; } catch (Exception ex) { @@ -1147,6 +1160,7 @@ namespace FWA_MAIN myConn.Close(); } } + public static void UpdateRefill(string refillID, DateTime date, string patientID, string medicationID, string rxNum) { @@ -1209,6 +1223,38 @@ namespace FWA_MAIN } } + + public static void DeleteAllRefill(string PrescriptionID) + { + + try + { + // open connection + myConn.Open(); + //clear any parameters + cmdString.Parameters.Clear(); + // command + cmdString.Connection = myConn; + cmdString.CommandType = CommandType.StoredProcedure; + cmdString.CommandTimeout = 1500; + cmdString.CommandText = "DeleteAllRefill"; + // Define input parameter + cmdString.Parameters.Add("@RxID", SqlDbType.Char, 11).Value = PrescriptionID; + + cmdString.ExecuteNonQuery(); + } + catch (Exception ex) + { + throw new ArgumentException(ex.Message); + } + finally + { + myConn.Close(); + } + + } + + public static void PastRefills(string rxNum) { @@ -1237,6 +1283,34 @@ namespace FWA_MAIN myConn.Close(); } } + + public static void RefreshRefill(string rxNum) + { + try + { + myConn.Open(); + + cmdString.Parameters.Clear(); + + cmdString.Connection = myConn; + cmdString.CommandType = CommandType.StoredProcedure; + cmdString.CommandTimeout = 1500; + + cmdString.CommandText = "RefreshRefill"; + + cmdString.Parameters.Add("@Prescription_id", SqlDbType.VarChar, 11).Value = rxNum; + + cmdString.ExecuteNonQuery(); + } + catch (Exception ex) + { + throw new ArgumentException(ex.Message); + } + finally + { + myConn.Close(); + } + } public static void DecrementPastRefills(string rxNum) { @@ -1307,6 +1381,51 @@ namespace FWA_MAIN myConn.Close(); } } + + + public static void CreatePrescription2( + string RxNum, + string Patient_id, + string Medication_id, + string Physician_id, + int Completed_refills, + int Max_refills, + DateTime start, + DateTime end) + { + try + { + myConn.Open(); + + cmdString.Parameters.Clear(); + + cmdString.Connection = myConn; + cmdString.CommandType = CommandType.StoredProcedure; + cmdString.CommandTimeout = 1500; + + cmdString.CommandText = "CreatePrescription2"; + + cmdString.Parameters.Add("@Medication_id", SqlDbType.VarChar, 7).Value = Medication_id; + cmdString.Parameters.Add("@numRefills", SqlDbType.VarChar, 60).Value = Max_refills; + cmdString.Parameters.Add("@pastNumRefills", SqlDbType.VarChar, 30).Value = Completed_refills; + cmdString.Parameters.Add("@Physician_id", SqlDbType.VarChar, 30).Value = Physician_id; + cmdString.Parameters.Add("@Patient_id", SqlDbType.VarChar, 100).Value = Patient_id; + cmdString.Parameters.Add("@RxNum", SqlDbType.VarChar, 30).Value = RxNum; + cmdString.Parameters.Add("@start", SqlDbType.DateTime).Value = start; + cmdString.Parameters.Add("@end", SqlDbType.DateTime).Value = end; + + cmdString.ExecuteNonQuery(); + + } + catch (Exception ex) + { + throw new ArgumentException(ex.Message); + } + finally + { + myConn.Close(); + } + } public static void UpdatePrescription( string RxNum, @@ -1349,6 +1468,50 @@ namespace FWA_MAIN myConn.Close(); } } + + public static void UpdatePrescription( + string RxNum, + string Patient_id, + string Medication_id, + string Physician_id, + int Completed_refills, + int Max_refills, + DateTime start, + DateTime end) + { + try + { + myConn.Open(); + + cmdString.Parameters.Clear(); + + cmdString.Connection = myConn; + cmdString.CommandType = CommandType.StoredProcedure; + cmdString.CommandTimeout = 1500; + + cmdString.CommandText = "UpdatePrescription2"; + + cmdString.Parameters.Add("@Medication_id", SqlDbType.VarChar, 7).Value = Medication_id; + cmdString.Parameters.Add("@numRefills", SqlDbType.VarChar, 60).Value = Max_refills; + cmdString.Parameters.Add("@pastNumRefills", SqlDbType.VarChar, 30).Value = Completed_refills; + cmdString.Parameters.Add("@Physician_id", SqlDbType.VarChar, 30).Value = Physician_id; + cmdString.Parameters.Add("@Patient_id", SqlDbType.VarChar, 100).Value = Patient_id; + cmdString.Parameters.Add("@RxNum", SqlDbType.VarChar, 30).Value = RxNum; + cmdString.Parameters.Add("@start", SqlDbType.DateTime).Value = start; + cmdString.Parameters.Add("@end", SqlDbType.DateTime).Value = end; + + cmdString.ExecuteNonQuery(); + + } + catch (Exception ex) + { + throw new ArgumentException(ex.Message); + } + finally + { + myConn.Close(); + } + } // public static void FillComboBox(string table, string ValueMember, string displayMember, ComboBox myComboBox) // { diff --git a/FWA_MAIN/Prescription.aspx b/FWA_MAIN/Prescription.aspx index 437c6db..0bd46af 100644 --- a/FWA_MAIN/Prescription.aspx +++ b/FWA_MAIN/Prescription.aspx @@ -1,8 +1,21 @@ -<%@ Page Title="Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="Prescription.aspx.cs" Inherits="FWA_MAIN.Prescription" %> +<%@ Page Title="Prescription" EnableEventValidation="false" Language="C#" MasterPageFile="main.master" CodeBehind="Prescription.aspx.cs" Inherits="FWA_MAIN.Prescription" %> + + + +

Prescriptions

@@ -21,21 +34,11 @@
- -
-
-
- -
-
-
- -
-
-
- -
-
+ + +
+ +
@@ -52,32 +55,40 @@

- -
-
-
- -
-
-
- -
-
-
- -
-
- - - + + +
+ +
- +
- - - + +
+ + + + + + + + + + + +
+ + style="display: none; width: auto"> +
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • + + <%-- --%> +
+ - +
\ No newline at end of file diff --git a/FWA_MAIN/Prescription.aspx.cs b/FWA_MAIN/Prescription.aspx.cs index 6e946a7..5e29dd7 100644 --- a/FWA_MAIN/Prescription.aspx.cs +++ b/FWA_MAIN/Prescription.aspx.cs @@ -1,5 +1,7 @@ using System; using System.Web.UI; +using System.Data; +using System.Web.UI.WebControls; namespace FWA_MAIN { @@ -8,19 +10,234 @@ namespace FWA_MAIN protected void Page_Load(object sender, EventArgs e) { + if (!IsPostBack) + { + + txtRxNum.Text = Convert.ToString(Session["vRxNum"]); + txtPhysID.Text = Convert.ToString(Session["vPhysID"]); + txtPatID.Text = Convert.ToString(Session["vPatID"]); + txtMedID.Text = Convert.ToString(Session["vMedID"]); + + btnPreSearch_OnClick(sender,e); + + } + + } - protected void btnPreSearch_OnClick(object sender, EventArgs e) + private void BindData() { - throw new NotImplementedException(); + + DataSet ds = new DataSet(); + + string RxNum = Convert.ToString(Session["vRxNum"]); + string physID = Convert.ToString(Session["vPhysID"]); + string patID = Convert.ToString(Session["vPatID"]); + string medID = Convert.ToString(Session["vMedID"]); + + txtRxNum.Text = RxNum; + txtPhysID.Text = physID; + txtPatID.Text = patID; + txtMedID.Text = medID; + + // if (textHasValues) + // { + ds = PharmacyDataTier.PrescriptionInfoSearch(RxNum,patID, medID, physID); + // } + + + // ds = dt.GetStudents(); + gvPrescription.DataSource = ds.Tables[0]; + + if (Cache["PreData"] == null) + { + Cache.Add("PreData", new DataView(ds.Tables[0]), + null,System.Web.Caching.Cache.NoAbsoluteExpiration, + System.TimeSpan.FromMinutes(10), System.Web.Caching.CacheItemPriority.Default, + null); + } + gvPrescription.DataBind(); + } - - protected void btnNew_OnClick(object sender, EventArgs e) + protected void btnPreSearch_OnClick(object sender, EventArgs e) + { + + if (txtPatID.Text.Trim().Length > 0 || txtRxNum.Text.Trim().Length > 0 || txtMedID.Text.Trim().Length > 0 || + txtPhysID.Text.Trim().Length > 0) + { + + + try + { + + Session["vRxNum"] = txtRxNum.Text.Trim(); + Session["vPhysID"] = txtPhysID.Text.Trim(); + Session["vPatID"] = txtPatID.Text.Trim(); + Session["vMedID"] = txtMedID.Text.Trim(); + + Cache.Remove("PreData"); + 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(gvPrescription, "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 (gvPrescription.SelectedIndex == index) + { + // Deselect the row + gvPrescription.SelectedIndex = -1; + } + else + { + // Select the row + gvPrescription.SelectedIndex = index; + } + + // Refresh the GridView to update the style + gvPrescription.DataBind(); + } + } + protected void btnPreNew_OnClick(object sender, EventArgs e) { - Response.Redirect("preNew.aspx"); + string prescriptionID; + try + { + Session["vRxNum"] = txtRxNum.Text.Trim(); + Session["vPhysID"] = txtPhysID.Text.Trim(); + Session["vPatID"] = txtPatID.Text.Trim(); + Session["vMedID"] = txtMedID.Text.Trim(); + + // Use the patientID value as needed + try + { + + prescriptionID = PharmacyDataTier.GetNextRxNum(); + prescriptionID = Crypt.Encrypt(prescriptionID); + Response.Redirect("preNew.aspx" + "?" + "ID=" + prescriptionID, false); + } + catch (Exception exception) + { + } + + + } + catch (Exception ex) + { + throw new Exception(ex.Message, ex.InnerException); + } + } + + protected void bntPreEdit_OnClick(object sender, EventArgs e) + { + string prescriptionID = "0"; + Int64 mEditedRecord = 0; + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + + try + { + Session["vRxNum"] = txtRxNum.Text.Trim(); + Session["vPhysID"] = txtPhysID.Text.Trim(); + Session["vPatID"] = txtPatID.Text.Trim(); + Session["vMedID"] = txtMedID.Text.Trim(); + + + try + { + + prescriptionID = Crypt.Encrypt(gvPrescription.SelectedRow.Cells[0].Text); + Response.Redirect("preEdit.aspx" + "?" + "ID=" + prescriptionID, false); + } + catch (Exception exception) + { + } + + // Use the patientID value as needed + + + + } + catch (Exception ex) + { + throw new Exception(ex.Message, ex.InnerException); + } + } + + protected void btnPreDelete_OnClick(object sender, EventArgs e) + { + try + { + + PharmacyDataTier.DeleteAllRefill(gvPrescription.SelectedRow.Cells[0].Text); + PharmacyDataTier.DeletePrescription(gvPrescription.SelectedRow.Cells[0].Text); + BindData(); + } + catch (Exception exception) + { + + } + } + + + protected void btnPreView_OnClick(object sender, EventArgs e) + { + string refillID = "0"; + try + { + + refillID = Crypt.Encrypt(gvPrescription.SelectedRow.Cells[0].Text); + Response.Redirect("Refills.aspx" + "?" + "ID=" + refillID, false); + } + catch (Exception exception) + { + } + } + + protected void btnPreRefill_OnClick(object sender, EventArgs e) + { + if (gvPrescription.SelectedRow != null) + { + + if (int.Parse(gvPrescription.SelectedRow.Cells[2].Text) < int.Parse(gvPrescription.SelectedRow.Cells[1].Text)) + { + PharmacyDataTier.AddRefill(PharmacyDataTier.GetNextRefillID().ToString(), DateTime.Now, gvPrescription.SelectedRow.Cells[5].Text,gvPrescription.SelectedRow.Cells[4].Text,gvPrescription.SelectedRow.Cells[0].Text); + } + else + { + string script = "window.open('MaxRefillNotif.aspx', 'PopupWindow', 'width=600,height=400,left=100,top=100');"; + ScriptManager.RegisterStartupScript(this, GetType(), "popup", script, true); + } + PharmacyDataTier.RefreshRefill(gvPrescription.SelectedRow.Cells[0].Text); + BindData(); + } } } } \ No newline at end of file diff --git a/FWA_MAIN/Prescription.aspx.designer.cs b/FWA_MAIN/Prescription.aspx.designer.cs index bb17373..539841a 100644 --- a/FWA_MAIN/Prescription.aspx.designer.cs +++ b/FWA_MAIN/Prescription.aspx.designer.cs @@ -42,40 +42,13 @@ namespace FWA_MAIN protected global::System.Web.UI.WebControls.TextBox txtPatID; /// - /// txtNumRefill control. + /// txtMedID 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; + protected global::System.Web.UI.WebControls.TextBox txtMedID; /// /// btnPatSearch control. @@ -87,13 +60,58 @@ namespace FWA_MAIN protected global::System.Web.UI.WebControls.Button btnPatSearch; /// - /// gvPatient control. + /// gvPrescription control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.GridView gvPatient; + protected global::System.Web.UI.WebControls.GridView gvPrescription; + + /// + /// btnPreNew control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnPreNew; + + /// + /// bntPreEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button bntPreEdit; + + /// + /// btnPreDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnPreDelete; + + /// + /// btnPreRefill control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnPreRefill; + + /// + /// btnPreView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnPreView; /// /// Master property. diff --git a/FWA_MAIN/RefEdit.aspx b/FWA_MAIN/RefEdit.aspx new file mode 100644 index 0000000..d2ce242 --- /dev/null +++ b/FWA_MAIN/RefEdit.aspx @@ -0,0 +1,43 @@ +<%@ Page Title="EditRefill" Language="C#" MasterPageFile="main.master" CodeBehind="RefEdit.aspx.cs" Inherits="FWA_MAIN.RefEdit" %> + + + + + + +

Edit Refill

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/FWA_MAIN/RefEdit.aspx.cs b/FWA_MAIN/RefEdit.aspx.cs new file mode 100644 index 0000000..7766c0c --- /dev/null +++ b/FWA_MAIN/RefEdit.aspx.cs @@ -0,0 +1,65 @@ +using System; +using System.Data; +using System.Diagnostics; +using System.Web.UI; + +namespace FWA_MAIN +{ + public partial class RefEdit : Page + { + + protected string refID; + + protected void Page_Load(object sender, EventArgs e) + { + + txtMedID.Enabled = false; + txtPatID.Enabled = false; + txtPreID.Enabled = false; + txtRefillID.Enabled = false; + + + + if (!IsPostBack) + { + refID = Crypt.Decrypt(Request.QueryString["ID"]); + + FillRefill(); + } + + } + + protected void FillRefill() + { + + var ds = new DataSet(); + ds = PharmacyDataTier.RefillSearch(refID); + + + txtRefillID.Text = ds.Tables[0].Rows[0]["Refill_id"].ToString(); + DateTime date = DateTime.Parse(ds.Tables[0].Rows[0]["RefillDate"].ToString()); + txtDate.Text = date.ToString("d"); + txtPatID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString(); + txtMedID.Text = ds.Tables[0].Rows[0]["Medication_id"].ToString(); + txtPreID.Text = ds.Tables[0].Rows[0]["RxNum_id"].ToString(); + + } + + protected void btnSaveRef_OnClick(object sender, EventArgs e) + { + PharmacyDataTier.UpdateRefill( + txtRefillID.Text, + Val.Date(txtDate), + txtPatID.Text, + txtMedID.Text, + txtPreID.Text + ); + Response.Redirect("Refills.aspx" + "?" + "ID=" + Crypt.Encrypt(txtPreID.Text), false); + } + + protected void btnCancelRef_OnClick(object sender, EventArgs e) + { + Response.Redirect("Refills.aspx" + "?" + "ID=" + Crypt.Encrypt(txtPreID.Text), false); + } + } +} \ No newline at end of file diff --git a/FWA_MAIN/RefEdit.aspx.designer.cs b/FWA_MAIN/RefEdit.aspx.designer.cs new file mode 100644 index 0000000..1975d64 --- /dev/null +++ b/FWA_MAIN/RefEdit.aspx.designer.cs @@ -0,0 +1,94 @@ +//------------------------------------------------------------------------------ +// +// 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 RefEdit + { + + /// + /// txtRefillID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRefillID; + + /// + /// txtDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDate; + + /// + /// 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; + + /// + /// 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; + + /// + /// txtPreID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPreID; + + /// + /// btnSaveRef control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSaveRef; + + /// + /// btnCancelRef control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelRef; + + /// + /// Master property. + /// + /// + /// Auto-generated property. + /// + public new FWA_MAIN.main Master + { + get + { + return ((FWA_MAIN.main)(base.Master)); + } + } + } +} diff --git a/FWA_MAIN/Refills.aspx b/FWA_MAIN/Refills.aspx new file mode 100644 index 0000000..13bad2b --- /dev/null +++ b/FWA_MAIN/Refills.aspx @@ -0,0 +1,113 @@ +<%@ Page Title="Refills" Language="C#" EnableEventValidation="false" MasterPageFile="main.master" CodeBehind="Refills.aspx.cs" Inherits="FWA_MAIN.Refills" %> + + + + +

+ Refills +

+ +
+ + + + + + + + +
+ +
+
+
+
+
+
+ + + + + + + +
\ No newline at end of file diff --git a/FWA_MAIN/Refills.aspx.cs b/FWA_MAIN/Refills.aspx.cs new file mode 100644 index 0000000..947dc30 --- /dev/null +++ b/FWA_MAIN/Refills.aspx.cs @@ -0,0 +1,98 @@ +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FWA_MAIN +{ + public partial class Refills : Page + { + protected string preID; + + protected void Page_Load(object sender, EventArgs e) + { + preID = Crypt.Decrypt(Request.QueryString["ID"]); + + + + + Fill(); + + } + + protected void Fill() + { + + var ds = new DataSet(); + ds = PharmacyDataTier.GetRefill(preID); + gvRefills.DataSource = ds; + gvRefills.DataBind(); + + } + + protected void btnRefEdit_OnClick(object sender, EventArgs e) + { + string refillID = "0"; + try + { + + refillID = Crypt.Encrypt(gvRefills.SelectedRow.Cells[0].Text); + Response.Redirect("RefEdit.aspx" + "?" + "ID=" + refillID, false); + } + catch (Exception exception) + { + } + + } + + protected void btnRefDelete_OnClick(object sender, EventArgs e) + { + PharmacyDataTier.DeleteRefill(gvRefills.SelectedRow.Cells[0].Text); + PharmacyDataTier.RefreshRefill(gvRefills.SelectedRow.Cells[4].Text); + Fill(); + } + + protected void gvRefills_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 (gvRefills.SelectedIndex == index) + { + // Deselect the row + gvRefills.SelectedIndex = -1; + } + else + { + // Select the row + gvRefills.SelectedIndex = index; + } + + // Refresh the GridView to update the style + gvRefills.DataBind(); + } + } + + protected void gvRefills_OnRowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(gvRefills, "Select$" + e.Row.RowIndex); + e.Row.ToolTip = "Click to select this row."; + } + } + + protected void gvRefills_SelectedIndexChanged(object sender, EventArgs e) + { + Fill(); + } + + protected void btnBack_OnClick(object sender, EventArgs e) + { + Response.Redirect("Prescription.aspx"); + } + } +} \ No newline at end of file diff --git a/FWA_MAIN/Refills.aspx.designer.cs b/FWA_MAIN/Refills.aspx.designer.cs new file mode 100644 index 0000000..6df2af4 --- /dev/null +++ b/FWA_MAIN/Refills.aspx.designer.cs @@ -0,0 +1,67 @@ +//------------------------------------------------------------------------------ +// +// 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 Refills + { + + /// + /// gvRefills control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvRefills; + + /// + /// btnBack control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnBack; + + /// + /// btnRefEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRefEdit; + + /// + /// btnRefDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRefDelete; + + /// + /// 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 index 9f6d11b..18b7bff 100644 --- a/FWA_MAIN/Val.cs +++ b/FWA_MAIN/Val.cs @@ -1,4 +1,5 @@ using System; +using System.Data; using System.Web.UI.WebControls; namespace FWA_MAIN @@ -62,6 +63,69 @@ namespace FWA_MAIN } } + public static string PatID(TextBox box) + { + + string word = box.Text.Trim(); + + while (word.Length < 8) + { + word = "0" + word; + } + + DataSet ds = PharmacyDataTier.PatientInfoSearch(word); + + if (ds.Tables[0].Rows.Count > 0) + { + return word; + } + else + { + return "00000000"; + } + + } + public static string MedID(TextBox box) + { + string word = box.Text.Trim(); + + while (word.Length < 7) + { + word = "0" + word; + } + + DataSet ds = PharmacyDataTier.MedicationInfoSearch(word); + + if (ds.Tables[0].Rows.Count > 0) + { + return word; + } + else + { + return "0000000"; + } + } + public static string PhyID(TextBox box) + { + string word = box.Text.Trim(); + + while (word.Length < 8) + { + word = "0" + word; + } + + DataSet ds = PharmacyDataTier.PhysicianInfoSearch(word); + + if (ds.Tables[0].Rows.Count > 0) + { + return word; + } + else + { + return "00000000"; + } + } + public static DateTime Date(TextBox box) { try @@ -69,6 +133,11 @@ namespace FWA_MAIN DateTime date = DateTime.Parse(box.Text.Trim()); + if (date < new DateTime(1753,1,1) || date > new DateTime(9999,12,31)) + { + throw new Exception(); + } + return date; } diff --git a/FWA_MAIN/bin/FWA_MAIN.dll b/FWA_MAIN/bin/FWA_MAIN.dll index d634662..b7ddfb4 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 16534e7..ff34a1d 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.csproj.AssemblyReference.cache b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache index 2ae3ac5..406c024 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 2e69a80..fb81b31 100644 --- a/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache +++ b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -e89e31cdadf20fe7db48ef132bf217873437f194debfb0966ea84327b2ae8615 +70b4448723339e99ed60f3c81dc6a5d1da61b1ddf61a97f8541739006170aed6 diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.dll b/FWA_MAIN/obj/Debug/FWA_MAIN.dll index d634662..b7ddfb4 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 16534e7..ff34a1d 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/obj/Debug/Package/PackageTmp/Web.config b/FWA_MAIN/obj/Debug/Package/PackageTmp/Web.config index c3180cb..938a42f 100644 --- a/FWA_MAIN/obj/Debug/Package/PackageTmp/Web.config +++ b/FWA_MAIN/obj/Debug/Package/PackageTmp/Web.config @@ -13,15 +13,26 @@ + + + + - - + + diff --git a/FWA_MAIN/obj/Debug/Package/PackageTmp/bin/FWA_MAIN.dll b/FWA_MAIN/obj/Debug/Package/PackageTmp/bin/FWA_MAIN.dll index 469d8e0..b7ddfb4 100644 Binary files a/FWA_MAIN/obj/Debug/Package/PackageTmp/bin/FWA_MAIN.dll and b/FWA_MAIN/obj/Debug/Package/PackageTmp/bin/FWA_MAIN.dll differ diff --git a/FWA_MAIN/obj/Debug/Package/PackageTmp/bin/FWA_MAIN.pdb b/FWA_MAIN/obj/Debug/Package/PackageTmp/bin/FWA_MAIN.pdb index 8b3bd69..ff34a1d 100644 Binary files a/FWA_MAIN/obj/Debug/Package/PackageTmp/bin/FWA_MAIN.pdb and b/FWA_MAIN/obj/Debug/Package/PackageTmp/bin/FWA_MAIN.pdb differ diff --git a/FWA_MAIN/obj/Debug/Package/PackageTmp/main.css b/FWA_MAIN/obj/Debug/Package/PackageTmp/main.css index 0797493..d54d7f2 100644 --- a/FWA_MAIN/obj/Debug/Package/PackageTmp/main.css +++ b/FWA_MAIN/obj/Debug/Package/PackageTmp/main.css @@ -13,6 +13,99 @@ } +.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; + vertical-align: center; + +} + +.btnPatSearch, .btnMediSearch{ + + margin-left: 177px; + + height: 25px; + width: 100px; + color: white; + background-color: #161A1D; + +} + +.indivPatDiv, .indivMedDiv{ + + height: 35px; + /*outline: solid 1px red;*/ + + +} + +.standardbtn{ + + height: 25px; + width: 100px; + color: white; + background-color: #161A1D; + +} + +.patDiv, .medDiv{ + vertical-align: top; + /*outline: solid 1px red;*/ + display: inline-block; + +} + +.defaultTXT{ + + height: 25px; + +} + .sidenavbutton{ background-color: #1D2125; @@ -22,7 +115,7 @@ font-size: 16px; color: white; /*border: 2px solid #0056b3;*/ - + } @@ -34,7 +127,7 @@ .welcomepage{ background-color: #1b6d85; - outline: solid 1px red; + /*outline: solid 1px red;*/ } .standardcontentpage{ diff --git a/FWA_MAIN/obj/Debug/Package/PackageTmp/main.master b/FWA_MAIN/obj/Debug/Package/PackageTmp/main.master index 0c41add..7e76c7a 100644 --- a/FWA_MAIN/obj/Debug/Package/PackageTmp/main.master +++ b/FWA_MAIN/obj/Debug/Package/PackageTmp/main.master @@ -11,9 +11,9 @@ +
@@ -32,6 +31,7 @@
+ \ No newline at end of file diff --git a/FWA_MAIN/obj/Debug/Package/PackageTmp/patNew.aspx b/FWA_MAIN/obj/Debug/Package/PackageTmp/patNew.aspx index 086f088..bc5a852 100644 --- a/FWA_MAIN/obj/Debug/Package/PackageTmp/patNew.aspx +++ b/FWA_MAIN/obj/Debug/Package/PackageTmp/patNew.aspx @@ -1,7 +1,63 @@ <%@ Page Title="New Patient" Language="C#" MasterPageFile="main.master" CodeBehind="patNew.aspx.cs" Inherits="FWA_MAIN.patNew" %> + + + -

New Patient

- +

New Patient

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/FWA_MAIN/obj/Debug/Package/PackageTmp/patient.aspx b/FWA_MAIN/obj/Debug/Package/PackageTmp/patient.aspx deleted file mode 100644 index 98d0ff4..0000000 --- a/FWA_MAIN/obj/Debug/Package/PackageTmp/patient.aspx +++ /dev/null @@ -1,84 +0,0 @@ -<%@ Page Title="Patients" Language="C#" MasterPageFile="main.master" CodeBehind="patient.aspx.cs" Inherits="FWA_MAIN.patient" %> - - - - -

- Welcome to Pharmacy. -

-

- Hi, We are creating a - custom context menu here. -

- - - - - - -
\ No newline at end of file diff --git a/FWA_MAIN/obj/Debug/TransformWebConfig/original/Web.config b/FWA_MAIN/obj/Debug/TransformWebConfig/original/Web.config index 5abb5ab..b80eae9 100644 --- a/FWA_MAIN/obj/Debug/TransformWebConfig/original/Web.config +++ b/FWA_MAIN/obj/Debug/TransformWebConfig/original/Web.config @@ -1,28 +1,38 @@ - + - - - - - - - - - + + + + + + + + + + + + + - - + + @@ -58,12 +68,8 @@ - - + + - + \ No newline at end of file diff --git a/FWA_MAIN/obj/Debug/TransformWebConfig/transformed/Web.config b/FWA_MAIN/obj/Debug/TransformWebConfig/transformed/Web.config index c3180cb..938a42f 100644 --- a/FWA_MAIN/obj/Debug/TransformWebConfig/transformed/Web.config +++ b/FWA_MAIN/obj/Debug/TransformWebConfig/transformed/Web.config @@ -13,15 +13,26 @@ + + + + - - + + diff --git a/FWA_MAIN/obj/Debug/_WPPLastBuildInfo.txt b/FWA_MAIN/obj/Debug/_WPPLastBuildInfo.txt index b5e402d..aec68e5 100644 Binary files a/FWA_MAIN/obj/Debug/_WPPLastBuildInfo.txt and b/FWA_MAIN/obj/Debug/_WPPLastBuildInfo.txt differ diff --git a/FWA_MAIN/patNew.aspx.cs b/FWA_MAIN/patNew.aspx.cs index ecc82a5..cb08093 100644 --- a/FWA_MAIN/patNew.aspx.cs +++ b/FWA_MAIN/patNew.aspx.cs @@ -12,6 +12,7 @@ namespace FWA_MAIN patID = Crypt.Decrypt(Request.QueryString["ID"]); + txtPatID.Enabled = false; txtPatID.Text = patID; } diff --git a/FWA_MAIN/preEdit.aspx b/FWA_MAIN/preEdit.aspx new file mode 100644 index 0000000..91d909b --- /dev/null +++ b/FWA_MAIN/preEdit.aspx @@ -0,0 +1,52 @@ +<%@ Page Title="Edit Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="preEdit.aspx.cs" Inherits="FWA_MAIN.preEdit" %> + + + + + + +

Edit Prescription

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

+
+
+
+
+
\ No newline at end of file diff --git a/FWA_MAIN/preEdit.aspx.cs b/FWA_MAIN/preEdit.aspx.cs new file mode 100644 index 0000000..227f7f2 --- /dev/null +++ b/FWA_MAIN/preEdit.aspx.cs @@ -0,0 +1,64 @@ +using System; +using System.Web.UI; +using System.Data; + +namespace FWA_MAIN +{ + public partial class preEdit : Page + { + protected string preID; + protected void Page_Load(object sender, EventArgs e) + { + preID = Crypt.Decrypt(Request.QueryString["ID"]); + + txtRxNum.Enabled = false; + + if (!IsPostBack) + { + + FillPrescription(preID); + } + } + protected void FillPrescription(string id) + { + + var ds = new DataSet(); + ds = PharmacyDataTier.PrescriptionInfoSearch(id); + + txtRxNum.Text = ds.Tables[0].Rows[0]["RxNum_id"].ToString(); + txtAllowed.Text = ds.Tables[0].Rows[0]["numRefills"].ToString(); + txtUsed.Text = ds.Tables[0].Rows[0]["pastNumRefills"].ToString(); + txtMedID.Text = ds.Tables[0].Rows[0]["Medication_id"].ToString(); + txtPhysID.Text = ds.Tables[0].Rows[0]["Physician_id"].ToString(); + txtPatID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString(); + DateTime date1 = DateTime.Parse(ds.Tables[0].Rows[0]["PrescriptionStart"].ToString()); + txtStart.Text = date1.ToString("d"); + DateTime date2 = DateTime.Parse(ds.Tables[0].Rows[0]["PrescriptionEnd"].ToString()); + txtEnd.Text = date2.ToString("d"); + + + } + protected void btnSavePre_OnClick(object sender, EventArgs e) + { + string rxnum = Val.varchar(txtRxNum, 11); + int allow = Val.IntType(txtAllowed); + int used = Val.IntType(txtUsed); + string medid = Val.varchar(txtMedID, 7); + string phyid = Val.varchar(txtPhysID, 8); + string patid = Val.varchar(txtPatID, 8); + DateTime start = Val.Date(txtStart); + DateTime end = Val.Date(txtEnd); + + PharmacyDataTier.UpdatePrescription(rxnum,patid,medid,phyid,used,allow,start,end); + PharmacyDataTier.RefreshRefill(rxnum); + + Response.Redirect("Prescription.aspx"); + + } + + protected void btnCancelPre_OnClick(object sender, EventArgs e) + { + Response.Redirect("Prescription.aspx"); + } + } +} \ No newline at end of file diff --git a/FWA_MAIN/preEdit.aspx.designer.cs b/FWA_MAIN/preEdit.aspx.designer.cs new file mode 100644 index 0000000..8216f4f --- /dev/null +++ b/FWA_MAIN/preEdit.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 preEdit + { + + /// + /// 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; + + /// + /// 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; + + /// + /// 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; + + /// + /// 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; + + /// + /// txtUsed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtUsed; + + /// + /// txtAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtAllowed; + + /// + /// 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; + + /// + /// txtEnd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEnd; + + /// + /// 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)); + } + } + } +} diff --git a/FWA_MAIN/preNew.aspx b/FWA_MAIN/preNew.aspx index c989a64..06d4979 100644 --- a/FWA_MAIN/preNew.aspx +++ b/FWA_MAIN/preNew.aspx @@ -1,33 +1,43 @@ <%@ Page Title="New Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="preNew.aspx.cs" Inherits="FWA_MAIN.preNew" %> - + +

New Prescription

-
-

-

-

-

-

-

-

-

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

-

-

-

-

-

-

-

- +
+
+
+
+
+
+
+
+
@@ -36,7 +46,7 @@
-
+
\ No newline at end of file diff --git a/FWA_MAIN/preNew.aspx.cs b/FWA_MAIN/preNew.aspx.cs index 3ebd8c1..1c1b176 100644 --- a/FWA_MAIN/preNew.aspx.cs +++ b/FWA_MAIN/preNew.aspx.cs @@ -5,14 +5,36 @@ namespace FWA_MAIN { public partial class preNew : Page { + + protected string preID; protected void Page_Load(object sender, EventArgs e) { + preID = Crypt.Decrypt(Request.QueryString["ID"]); + txtRxNum.Enabled = false; + txtRxNum.Text = preID; } protected void btnCancelPre_OnClick(object sender, EventArgs e) { - throw new NotImplementedException(); + Response.Redirect("Prescription.aspx"); + } + + protected void btnSavePat_OnClick(object sender, EventArgs e) + { + string rxnum = Val.varchar(txtRxNum, 11); + int allow = Val.IntType(txtAllowed); + int used = Val.IntType(txtUsed); + string medid = Val.MedID(txtMedID); + string phyid = Val.PhyID(txtPhysID); + string patid = Val.PatID(txtPatID); + DateTime start = Val.Date(txtStart); + DateTime end = Val.Date(txtEnd); + + PharmacyDataTier.CreatePrescription2(rxnum,patid,medid,phyid,used,allow,start,end); + PharmacyDataTier.RefreshRefill(rxnum); + + Response.Redirect("Prescription.aspx"); } } } \ No newline at end of file diff --git a/FWA_MAIN/preNew.aspx.designer.cs b/FWA_MAIN/preNew.aspx.designer.cs index 7678379..3c48633 100644 --- a/FWA_MAIN/preNew.aspx.designer.cs +++ b/FWA_MAIN/preNew.aspx.designer.cs @@ -24,31 +24,13 @@ namespace FWA_MAIN protected global::System.Web.UI.WebControls.TextBox txtRxNum; /// - /// txtNumRefill control. + /// txtPatID 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; + protected global::System.Web.UI.WebControls.TextBox txtPatID; /// /// txtMedID control. @@ -60,31 +42,49 @@ namespace FWA_MAIN protected global::System.Web.UI.WebControls.TextBox txtMedID; /// - /// txtPatID control. + /// txtPhysID control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtPatID; + protected global::System.Web.UI.WebControls.TextBox txtPhysID; /// - /// txtPreStart control. + /// txtUsed control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtPreStart; + protected global::System.Web.UI.WebControls.TextBox txtUsed; /// - /// txtPreEnd control. + /// txtAllowed control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtPreEnd; + protected global::System.Web.UI.WebControls.TextBox txtAllowed; + + /// + /// 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; + + /// + /// txtEnd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEnd; /// /// btnSavePat control.