Finished MediBedi fully, broke prescription then fixed it and changed session values to avoid cross population

This commit is contained in:
cadenjmoore 2024-04-03 16:50:34 -04:00
parent 1af5fa7a4f
commit 38c01a7d70
11 changed files with 56 additions and 38 deletions

View File

@ -12,9 +12,9 @@ namespace FWA_MAIN
if (!IsPostBack) if (!IsPostBack)
{ {
txtMedID.Text = Convert.ToString(Session["vMedID"]); txtMedID.Text = Convert.ToString(Session["vMediID"]);
txtMedName.Text = Convert.ToString(Session["vMedName"]); txtMedName.Text = Convert.ToString(Session["vMedName"]);
txtRxNum.Text = Convert.ToString(Session["vRxNum"]); txtRxNum.Text = Convert.ToString(Session["vRxNumber"]);
btnMediSearch_OnClick(sender,e); btnMediSearch_OnClick(sender,e);
@ -27,7 +27,7 @@ namespace FWA_MAIN
DataSet ds = new DataSet(); DataSet ds = new DataSet();
string medID = Convert.ToString(Session["vMedID"]); string medID = Convert.ToString(Session["vMediID"]);
string medicationname = Convert.ToString(Session["vMedName"]); string medicationname = Convert.ToString(Session["vMedName"]);
//string RxNum = Convert.ToString(Session["vRxNum"]); //string RxNum = Convert.ToString(Session["vRxNum"]);
@ -65,9 +65,9 @@ namespace FWA_MAIN
try try
{ {
Session["vMedID"] = txtMedID.Text.Trim(); Session["vMediID"] = txtMedID.Text.Trim();
Session["vMedName"] = txtMedName.Text.Trim(); Session["vMedName"] = txtMedName.Text.Trim();
Session["vRxNum"] = txtRxNum.Text.Trim(); Session["vRxNumber"] = txtRxNum.Text.Trim();
Cache.Remove("StudentData"); Cache.Remove("StudentData");
BindData(); BindData();
@ -133,15 +133,15 @@ namespace FWA_MAIN
try try
{ {
Session["vMedID"] = txtMedID.Text.Trim(); Session["vMediID"] = txtMedID.Text.Trim();
Session["vMedName"] = txtMedName.Text.Trim(); Session["vMedName"] = txtMedName.Text.Trim();
Session["vRxNum"] = txtRxNum.Text.Trim(); Session["vRxNumber"] = txtRxNum.Text.Trim();
// Use the patientID value as needed // Use the patientID value as needed
try try
{ {
medicationID = PharmacyDataTier.GetNextPatientID(); medicationID = PharmacyDataTier.GetNextMedicationID();
medicationID = Crypt.Encrypt(medicationID); medicationID = Crypt.Encrypt(medicationID);
Response.Redirect("medNew.aspx" + "?" + "ID=" + medicationID, false); Response.Redirect("medNew.aspx" + "?" + "ID=" + medicationID, false);
} }
@ -165,9 +165,9 @@ namespace FWA_MAIN
try try
{ {
Session["vMedID"] = txtMedID.Text.Trim(); Session["vMediID"] = txtMedID.Text.Trim();
Session["vMedName"] = txtMedName.Text.Trim(); Session["vMedName"] = txtMedName.Text.Trim();
Session["vRxNum"] = txtRxNum.Text.Trim(); Session["vRxNumber"] = txtRxNum.Text.Trim();
try try
@ -193,7 +193,16 @@ namespace FWA_MAIN
protected void btnMedDelete_OnClick(object sender, EventArgs e) protected void btnMedDelete_OnClick(object sender, EventArgs e)
{ {
throw new NotImplementedException(); try
{
PharmacyDataTier.DeleteMedication(gvMedication.SelectedRow.Cells[0].Text);
BindData();
}
catch (Exception exception)
{
}
} }
} }
} }

View File

@ -920,7 +920,7 @@ namespace FWA_MAIN
} }
} }
public static double GetNextMedicationID() public static string GetNextMedicationID()
{ {
try try
{ {
@ -946,9 +946,15 @@ namespace FWA_MAIN
// MessageBox.Show("Error Getting next Patient ID","ERROR",MessageBoxButtons.OK); // MessageBox.Show("Error Getting next Patient ID","ERROR",MessageBoxButtons.OK);
} }
string stringval = value.ToString();
while (stringval.Length < 7)
{
stringval = "0" + stringval;
}
// return dataSet // return dataSet
return value; return stringval;
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -10,7 +10,7 @@
$(document).keypress(function(e) { $(document).keypress(function(e) {
if (e.which === 13) { // Enter key = keycode 13 if (e.which === 13) { // Enter key = keycode 13
e.preventDefault(); // Prevent the default Enter action 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 @@
</div> </div>
<br/> <br/>
<asp:Button runat="server" ID="btnPatSearch" Text="Search" CssClass="btnPatSearch" OnClick="btnPreSearch_OnClick"/> <asp:Button runat="server" ID="btnPreSearch" Text="Search" CssClass="btnPatSearch" OnClick="btnPreSearch_OnClick"/>
<br/> <br/>
</div> </div>

View File

@ -84,6 +84,7 @@ namespace FWA_MAIN
} }
catch (Exception exception) catch (Exception exception)
{ {
} }
} }
@ -239,5 +240,7 @@ namespace FWA_MAIN
BindData(); BindData();
} }
} }
} }
} }

View File

@ -51,13 +51,13 @@ namespace FWA_MAIN
protected global::System.Web.UI.WebControls.TextBox txtMedID; protected global::System.Web.UI.WebControls.TextBox txtMedID;
/// <summary> /// <summary>
/// btnPatSearch control. /// btnPreSearch control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnPatSearch; protected global::System.Web.UI.WebControls.Button btnPreSearch;
/// <summary> /// <summary>
/// gvPrescription control. /// gvPrescription control.

Binary file not shown.

Binary file not shown.

View File

@ -17,15 +17,15 @@
<h1 style="text-align: center; font-size: 44px">Edit Medication</h1> <h1 style="text-align: center; font-size: 44px">Edit Medication</h1>
<div class="patDiv"> <div class="patDiv">
<div class="patDiv"> <div class="patDiv">
<div class="patDiv" style="padding-left: 150px; padding-right: 5px;width: 100px"> <div class="patDiv" style="padding-left: 450px; padding-right: 30px;width: 100px">
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Medication ID: </label></div> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Medication ID: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Medication Name: </label></div> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Medication Name: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Intake Method: </label></div> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Intake Method: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Frequency: </label></div> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Frequency: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Dosage: </label></div> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Dosage: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Purpose: </label></div> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Purpose: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">RX Number: </label></div> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">RX Number: </label></div>
</div> </div>
<div class="patDiv"> <div class="patDiv">
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtMedID"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtMedID"></asp:TextBox></div>

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@ namespace FWA_MAIN
if (!IsPostBack) if (!IsPostBack)
{ {
txtPatID.Text = Convert.ToString(Session["vPatID"]); txtPatID.Text = Convert.ToString(Session["vPatientID"]);
txtFNAME.Text = Convert.ToString(Session["vFNAME"]); txtFNAME.Text = Convert.ToString(Session["vFNAME"]);
txtLNAME.Text = Convert.ToString(Session["vLNAME"]); txtLNAME.Text = Convert.ToString(Session["vLNAME"]);
@ -35,7 +35,7 @@ namespace FWA_MAIN
DataSet ds = new DataSet(); DataSet ds = new DataSet();
string patID = Convert.ToString(Session["vPatID"]); string patID = Convert.ToString(Session["vPatientID"]);
string LNAME = Convert.ToString(Session["vLNAME"]); string LNAME = Convert.ToString(Session["vLNAME"]);
string FNAME = Convert.ToString(Session["vFNAME"]); string FNAME = Convert.ToString(Session["vFNAME"]);
@ -71,7 +71,7 @@ namespace FWA_MAIN
try try
{ {
Session["vPatID"] = txtPatID.Text.Trim(); Session["vPatientID"] = txtPatID.Text.Trim();
Session["vFNAME"] = txtFNAME.Text.Trim(); Session["vFNAME"] = txtFNAME.Text.Trim();
Session["vLNAME"] = txtLNAME.Text.Trim(); Session["vLNAME"] = txtLNAME.Text.Trim();
@ -136,7 +136,7 @@ namespace FWA_MAIN
try try
{ {
Session["vPatID"] = txtPatID.Text.Trim(); Session["vPatientID"] = txtPatID.Text.Trim();
Session["vFNAME"] = txtFNAME.Text.Trim(); Session["vFNAME"] = txtFNAME.Text.Trim();
Session["vLNAME"] = txtLNAME.Text.Trim(); Session["vLNAME"] = txtLNAME.Text.Trim();
@ -169,7 +169,7 @@ namespace FWA_MAIN
try try
{ {
Session["vPatID"] = txtPatID.Text.Trim(); Session["vPatientID"] = txtPatID.Text.Trim();
Session["vFNAME"] = txtFNAME.Text.Trim(); Session["vFNAME"] = txtFNAME.Text.Trim();
Session["vLNAME"] = txtLNAME.Text.Trim(); Session["vLNAME"] = txtLNAME.Text.Trim();