diff --git a/FWA_MAIN/MediSearch.aspx.cs b/FWA_MAIN/MediSearch.aspx.cs index 50d044e..3ce6c20 100644 --- a/FWA_MAIN/MediSearch.aspx.cs +++ b/FWA_MAIN/MediSearch.aspx.cs @@ -12,9 +12,9 @@ namespace FWA_MAIN if (!IsPostBack) { - txtMedID.Text = Convert.ToString(Session["vMedID"]); + txtMedID.Text = Convert.ToString(Session["vMediID"]); txtMedName.Text = Convert.ToString(Session["vMedName"]); - txtRxNum.Text = Convert.ToString(Session["vRxNum"]); + txtRxNum.Text = Convert.ToString(Session["vRxNumber"]); btnMediSearch_OnClick(sender,e); @@ -27,7 +27,7 @@ namespace FWA_MAIN DataSet ds = new DataSet(); - string medID = Convert.ToString(Session["vMedID"]); + string medID = Convert.ToString(Session["vMediID"]); string medicationname = Convert.ToString(Session["vMedName"]); //string RxNum = Convert.ToString(Session["vRxNum"]); @@ -65,9 +65,9 @@ namespace FWA_MAIN try { - Session["vMedID"] = txtMedID.Text.Trim(); + Session["vMediID"] = txtMedID.Text.Trim(); Session["vMedName"] = txtMedName.Text.Trim(); - Session["vRxNum"] = txtRxNum.Text.Trim(); + Session["vRxNumber"] = txtRxNum.Text.Trim(); Cache.Remove("StudentData"); BindData(); @@ -133,15 +133,15 @@ namespace FWA_MAIN try { - Session["vMedID"] = txtMedID.Text.Trim(); + Session["vMediID"] = txtMedID.Text.Trim(); Session["vMedName"] = txtMedName.Text.Trim(); - Session["vRxNum"] = txtRxNum.Text.Trim(); + Session["vRxNumber"] = txtRxNum.Text.Trim(); // Use the patientID value as needed try { - medicationID = PharmacyDataTier.GetNextPatientID(); + medicationID = PharmacyDataTier.GetNextMedicationID(); medicationID = Crypt.Encrypt(medicationID); Response.Redirect("medNew.aspx" + "?" + "ID=" + medicationID, false); } @@ -165,9 +165,9 @@ namespace FWA_MAIN try { - Session["vMedID"] = txtMedID.Text.Trim(); + Session["vMediID"] = txtMedID.Text.Trim(); Session["vMedName"] = txtMedName.Text.Trim(); - Session["vRxNum"] = txtRxNum.Text.Trim(); + Session["vRxNumber"] = txtRxNum.Text.Trim(); try @@ -193,7 +193,16 @@ namespace FWA_MAIN protected void btnMedDelete_OnClick(object sender, EventArgs e) { - throw new NotImplementedException(); + try + { + + PharmacyDataTier.DeleteMedication(gvMedication.SelectedRow.Cells[0].Text); + BindData(); + } + catch (Exception exception) + { + + } } } } \ No newline at end of file diff --git a/FWA_MAIN/PharmactDataTier.cs b/FWA_MAIN/PharmactDataTier.cs index 62b3342..27f769f 100644 --- a/FWA_MAIN/PharmactDataTier.cs +++ b/FWA_MAIN/PharmactDataTier.cs @@ -920,7 +920,7 @@ namespace FWA_MAIN } } - public static double GetNextMedicationID() + public static string GetNextMedicationID() { try { @@ -935,7 +935,7 @@ namespace FWA_MAIN cmdString.CommandText = "GetNextMedicationID"; object result = cmdString.ExecuteScalar(); - double value = 0; + double value= 0; try { value = Convert.ToDouble(result); @@ -946,9 +946,15 @@ namespace FWA_MAIN // MessageBox.Show("Error Getting next Patient ID","ERROR",MessageBoxButtons.OK); } - + string stringval = value.ToString(); + + while (stringval.Length < 7) + { + stringval = "0" + stringval; + } + // return dataSet - return value; + return stringval; } catch (Exception ex) { diff --git a/FWA_MAIN/Prescription.aspx b/FWA_MAIN/Prescription.aspx index 0bd46af..f14f4aa 100644 --- a/FWA_MAIN/Prescription.aspx +++ b/FWA_MAIN/Prescription.aspx @@ -10,7 +10,7 @@ $(document).keypress(function(e) { if (e.which === 13) { // Enter key = keycode 13 e.preventDefault(); // Prevent the default Enter action - $("#<%= btnPatSearch.ClientID %>").click(); // Trigger the search button click + $("#<%= btnPreSearch.ClientID %>").click(); // Trigger the search button click } }); }); @@ -62,7 +62,7 @@
- +
diff --git a/FWA_MAIN/Prescription.aspx.cs b/FWA_MAIN/Prescription.aspx.cs index fb90044..f5edb6c 100644 --- a/FWA_MAIN/Prescription.aspx.cs +++ b/FWA_MAIN/Prescription.aspx.cs @@ -84,6 +84,7 @@ namespace FWA_MAIN } catch (Exception exception) { + } } @@ -239,5 +240,7 @@ namespace FWA_MAIN BindData(); } } + + } } \ No newline at end of file diff --git a/FWA_MAIN/Prescription.aspx.designer.cs b/FWA_MAIN/Prescription.aspx.designer.cs index 539841a..f1afb84 100644 --- a/FWA_MAIN/Prescription.aspx.designer.cs +++ b/FWA_MAIN/Prescription.aspx.designer.cs @@ -51,13 +51,13 @@ namespace FWA_MAIN protected global::System.Web.UI.WebControls.TextBox txtMedID; /// - /// btnPatSearch control. + /// btnPreSearch control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Button btnPatSearch; + protected global::System.Web.UI.WebControls.Button btnPreSearch; /// /// gvPrescription control. diff --git a/FWA_MAIN/bin/FWA_MAIN.dll b/FWA_MAIN/bin/FWA_MAIN.dll index d108b8f..19d6b01 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 0bc1318..bb8dc60 100644 Binary files a/FWA_MAIN/bin/FWA_MAIN.pdb and b/FWA_MAIN/bin/FWA_MAIN.pdb differ diff --git a/FWA_MAIN/medEdit.aspx b/FWA_MAIN/medEdit.aspx index 0540678..07509ac 100644 --- a/FWA_MAIN/medEdit.aspx +++ b/FWA_MAIN/medEdit.aspx @@ -17,25 +17,25 @@

Edit Medication

-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.dll b/FWA_MAIN/obj/Debug/FWA_MAIN.dll index d108b8f..19d6b01 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 0bc1318..bb8dc60 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/patSearch.aspx.cs b/FWA_MAIN/patSearch.aspx.cs index 165732e..4e06636 100644 --- a/FWA_MAIN/patSearch.aspx.cs +++ b/FWA_MAIN/patSearch.aspx.cs @@ -14,7 +14,7 @@ namespace FWA_MAIN if (!IsPostBack) { - txtPatID.Text = Convert.ToString(Session["vPatID"]); + txtPatID.Text = Convert.ToString(Session["vPatientID"]); txtFNAME.Text = Convert.ToString(Session["vFNAME"]); txtLNAME.Text = Convert.ToString(Session["vLNAME"]); @@ -35,7 +35,7 @@ namespace FWA_MAIN DataSet ds = new DataSet(); - string patID = Convert.ToString(Session["vPatID"]); + string patID = Convert.ToString(Session["vPatientID"]); string LNAME = Convert.ToString(Session["vLNAME"]); string FNAME = Convert.ToString(Session["vFNAME"]); @@ -71,7 +71,7 @@ namespace FWA_MAIN try { - Session["vPatID"] = txtPatID.Text.Trim(); + Session["vPatientID"] = txtPatID.Text.Trim(); Session["vFNAME"] = txtFNAME.Text.Trim(); Session["vLNAME"] = txtLNAME.Text.Trim(); @@ -136,7 +136,7 @@ namespace FWA_MAIN try { - Session["vPatID"] = txtPatID.Text.Trim(); + Session["vPatientID"] = txtPatID.Text.Trim(); Session["vFNAME"] = txtFNAME.Text.Trim(); Session["vLNAME"] = txtLNAME.Text.Trim(); @@ -169,7 +169,7 @@ namespace FWA_MAIN try { - Session["vPatID"] = txtPatID.Text.Trim(); + Session["vPatientID"] = txtPatID.Text.Trim(); Session["vFNAME"] = txtFNAME.Text.Trim(); Session["vLNAME"] = txtLNAME.Text.Trim();