Merge remote-tracking branch 'origin/master'

# Conflicts:
#	FWA_MAIN/bin/FWA_MAIN.dll
#	FWA_MAIN/bin/FWA_MAIN.pdb
#	FWA_MAIN/obj/Debug/FWA_MAIN.dll
#	FWA_MAIN/obj/Debug/FWA_MAIN.pdb
This commit is contained in:
netnobody19 2024-04-03 19:25:07 -04:00
commit 47d13f3841
25 changed files with 431 additions and 175 deletions

View File

@ -4,12 +4,41 @@
<head> <head>
<link href="main.css" rel="stylesheet" type="text/css" /> <link href="main.css" rel="stylesheet" type="text/css" />
<style>
.parent {
position: relative;
height: 100%;
}
.child {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
h1{
text-align: center;
}
</style>
</head> </head>
<body runat="server"> <body runat="server">
<div class="standardcontentpage"> <div class="parent">
<h1>Hello</h1> <div class="child">
<h1>Welcome to Louis' Pharmacy!</h1>
<br/><br/>
<h1>Use the pane on the left to navigate</h1>
<h1>Make a selection and right click for more options</h1>
</div>
</div></body> </div></body>

View File

@ -1,4 +1,4 @@
<%@ Page Title="Medication" Language="C#" MasterPageFile="main.master" CodeBehind="MediSearch.aspx.cs" Inherits="FWA_MAIN.MediSearch" %> <%@ Page Title="Medication" Language="C#" EnableEventValidation="false" MasterPageFile="main.master" CodeBehind="MediSearch.aspx.cs" Inherits="FWA_MAIN.MediSearch" %>
<asp:Content runat="server" ContentPlaceHolderID="cph1"> <asp:Content runat="server" ContentPlaceHolderID="cph1">
@ -52,10 +52,10 @@
<br/> <br/>
</div> </div>
<br/> <br/>
<asp:Button runat="server" ID="btnMediSearch" Text="Search" CssClass="btnMedSearch" OnClick="btnMediSearch_OnClick" /> <asp:Button runat="server" ID="btnMediSearch" Text="Search" CssClass="btnPatSearch" OnClick="btnMediSearch_OnClick" />
</div> </div>
<div style="width: 75%; margin: 0 auto; align-content: center; horiz-align: center">
<asp:GridView runat="server" ID="gvMedication" CssClass="gridview" <asp:GridView runat="server" ID="gvMedication" CssClass="gridview"
HeaderStyle-CssClass="headerstyle" HeaderStyle-CssClass="headerstyle"
RowStyle-CssClass="rowstyle" RowStyle-CssClass="rowstyle"
@ -74,7 +74,7 @@
<asp:BoundField DataField="Purpose" HeaderText="Purpose" ItemStyle-Width="100px"/> <asp:BoundField DataField="Purpose" HeaderText="Purpose" ItemStyle-Width="100px"/>
<asp:BoundField DataField="RxNum" HeaderText="RxNum" ItemStyle-Width="100px"/> <asp:BoundField DataField="RxNum" HeaderText="RxNum" ItemStyle-Width="100px"/>
</Columns> </Columns>
</asp:GridView> </asp:GridView></div>
<script type="text/javascript"> <script type="text/javascript">
@ -87,16 +87,16 @@
</script> </script>
<div id="contextMenu" class="context-menu" <div id="contextMenu" class="context-menu"
style="display: none"> style="display: none; width: auto">
<ul> <ul>
<li> <li style="height: 25px">
<a href="medNew.aspx">New</a> <asp:Button runat="server" CssClass="standardbtn" ID="btnMedNew" Text="New" OnClick="btnMedNew_OnClick"/>
</li> </li>
<li> <li style="height: 25px">
<a href="medEdit.aspx">Edit</a> <asp:Button runat="server" CssClass="standardbtn" ID="bntMedEdit" Text="Edit" OnClick="bntMedEdit_OnClick"/>
</li> </li>
<li> <li style="height: 25px">
<a href="medDelete.aspx">Delete</a> <asp:Button runat="server" CssClass="standardbtn" ID="btnMedDelete" Text="Delete" OnClick="btnMedDelete_OnClick"/>
</li> </li>
<%-- <asp:Button runat="server" Text="New" OnClick="btnNew_OnClick" /> --%> <%-- <asp:Button runat="server" Text="New" OnClick="btnNew_OnClick" /> --%>
@ -137,14 +137,15 @@
.context-menu ul { .context-menu ul {
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
min-width: 150px; /*min-width: 150px; */
list-style: none; list-style: none;
} }
.context-menu ul li { .context-menu ul li {
padding-bottom: 7px; /*padding-bottom: 7px; */
padding-top: 7px; /*padding-top: 7px; */
border: 1px solid black; /*border: 1px solid black; */
} }
.context-menu ul li a { .context-menu ul li a {
@ -156,17 +157,17 @@
background: darkgray; background: darkgray;
} }
</style> </style>
<script type="text/javascript"> <%-- <script type="text/javascript"> --%>
window.onload = function() { <%-- window.onload = function() { --%>
var grid = document.getElementById("<%= gvMedication.ClientID %>"); <%-- var grid = document.getElementById("<%= gvMedication.ClientID %>"); --%>
var rows = grid.getElementsByTagName("tr"); <%-- var rows = grid.getElementsByTagName("tr"); --%>
for (var i = 0; i < rows.length; i++) { <%-- for (var i = 0; i < rows.length; i++) { --%>
rows[i].onclick = function() { <%-- rows[i].onclick = function() { --%>
// Assuming the first cell in every row contains the unique ID <%-- // Assuming the first cell in every row contains the unique ID --%>
var id = this.cells[0].innerText; <%-- var id = this.cells[0].innerText; --%>
__doPostBack('Select$', id); <%-- __doPostBack('Select$', id); --%>
}; <%-- }; --%>
} <%-- } --%>
}; <%-- }; --%>
</script> <%-- </script> --%>
</asp:Content> </asp:Content>

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();
@ -124,7 +124,85 @@ namespace FWA_MAIN
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{ {
throw new NotImplementedException(); BindData();
}
protected void btnMedNew_OnClick(object sender, EventArgs e)
{
string medicationID;
try
{
Session["vMediID"] = txtMedID.Text.Trim();
Session["vMedName"] = txtMedName.Text.Trim();
Session["vRxNumber"] = txtRxNum.Text.Trim();
// Use the patientID value as needed
try
{
medicationID = PharmacyDataTier.GetNextMedicationID();
medicationID = Crypt.Encrypt(medicationID);
Response.Redirect("medNew.aspx" + "?" + "ID=" + medicationID, false);
}
catch (Exception exception)
{
}
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex.InnerException);
}
}
protected void bntMedEdit_OnClick(object sender, EventArgs e)
{
string medicationID = "0";
//Int64 mEditedRecord = 0;
//System.Text.StringBuilder sb = new System.Text.StringBuilder();
try
{
Session["vMediID"] = txtMedID.Text.Trim();
Session["vMedName"] = txtMedName.Text.Trim();
Session["vRxNumber"] = txtRxNum.Text.Trim();
try
{
medicationID = Crypt.Encrypt(gvMedication.SelectedRow.Cells[0].Text);
Response.Redirect("medEdit.aspx" + "?" + "ID=" + medicationID, false);
}
catch (Exception exception)
{
}
// Use the patientID value as needed
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex.InnerException);
}
}
protected void btnMedDelete_OnClick(object sender, EventArgs e)
{
try
{
PharmacyDataTier.DeleteMedication(gvMedication.SelectedRow.Cells[0].Text);
BindData();
}
catch (Exception exception)
{
}
} }
} }
} }

View File

@ -59,6 +59,33 @@ namespace FWA_MAIN
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.GridView gvMedication; protected global::System.Web.UI.WebControls.GridView gvMedication;
/// <summary>
/// btnMedNew control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnMedNew;
/// <summary>
/// bntMedEdit control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button bntMedEdit;
/// <summary>
/// btnMedDelete control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnMedDelete;
/// <summary> /// <summary>
/// Master property. /// Master property.
/// </summary> /// </summary>

View File

@ -236,6 +236,7 @@ namespace FWA_MAIN
string Medication_id, string Medication_id,
string MedicationName, string MedicationName,
string IntakeMethod, string IntakeMethod,
string Frequency, string Frequency,
string Dosage, string Dosage,
string Purpose, string Purpose,
@ -938,7 +939,7 @@ namespace FWA_MAIN
} }
} }
public static double GetNextMedicationID() public static string GetNextMedicationID()
{ {
try try
{ {
@ -964,9 +965,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.

View File

@ -47,10 +47,18 @@ namespace FWA_MAIN
protected void btnRefDelete_OnClick(object sender, EventArgs e) protected void btnRefDelete_OnClick(object sender, EventArgs e)
{ {
try
{
PharmacyDataTier.DeleteRefill(gvRefills.SelectedRow.Cells[0].Text); PharmacyDataTier.DeleteRefill(gvRefills.SelectedRow.Cells[0].Text);
PharmacyDataTier.RefreshRefill(gvRefills.SelectedRow.Cells[4].Text); PharmacyDataTier.RefreshRefill(gvRefills.SelectedRow.Cells[4].Text);
Fill(); Fill();
} }
catch (Exception exception)
{
}
}
protected void gvRefills_OnRowCommand(object sender, GridViewCommandEventArgs e) protected void gvRefills_OnRowCommand(object sender, GridViewCommandEventArgs e)
{ {

View File

@ -14,7 +14,7 @@
</defaultDocument> </defaultDocument>
</system.webServer> </system.webServer>
<connectionStrings> <connectionStrings>
<add name="ConnString" connectionString="Server=sql.eggtech.net;Database=FinalProjectOfficialPharmacy;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;" providerName="System.Data.SqlClient"/> <add name="ConnString" connectionString="Server=10.1.1.250;Database=FinalProjectOfficialPharmacy;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;" providerName="System.Data.SqlClient"/>
</connectionStrings> </connectionStrings>
<appSettings> <appSettings>
<add key="webpages:Version" value="3.0.0.0"/> <add key="webpages:Version" value="3.0.0.0"/>

View File

@ -1,27 +1,37 @@
<%@ Page Title="Edit Medication" Language="C#" MasterPageFile="main.master" CodeBehind="medEdit.aspx.cs" Inherits="FWA_MAIN.medEdit" %> <%@ Page Title="Edit Medication" Language="C#" MasterPageFile="main.master" CodeBehind="medEdit.aspx.cs" Inherits="FWA_MAIN.medEdit" %>
<asp:Content runat="server" ContentPlaceHolderID="cph1"> <asp:Content runat="server" ContentPlaceHolderID="cph1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(document).keypress(function(e) {
if (e.which === 13) { // Enter key = keycode 13
e.preventDefault(); // Prevent the default Enter action
$("#<%= btnSaveMed.ClientID %>").click(); // Trigger the search button click
}
});
});
</script>
<link type="text/css" href="main.css"/> <link type="text/css" href="main.css"/>
<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">Patient ID: </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>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtMedName"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtMedName"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtIntake"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtIntake"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPatID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtFrequency"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtFrequency"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtDosage"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtDosage"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPurpose"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPurpose"></asp:TextBox></div>
@ -32,7 +42,7 @@
</div> </div>
<br/> <br/>
<div class="patDiv" style="margin-left: 500px"> <div class="patDiv" style="margin-left: 500px">
<div style="margin-right: 10px; display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnSavePat" Text="Save"/></div> <div style="margin-right: 10px; display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnSaveMed" Text="Save" OnClick="btnSaveMed_OnClick"/></div>
<div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelPat" Text="Cancel" OnClick="btnCancelPat_OnClick"/></div> <div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelMed" Text="Cancel" OnClick="btnCancelMed_OnClick"/></div>
</div> </div>
</asp:Content> </asp:Content>

View File

@ -1,18 +1,71 @@
using System; using System;
using System.Data;
using System.Web.UI; using System.Web.UI;
namespace FWA_MAIN namespace FWA_MAIN
{ {
public partial class medEdit : Page public partial class medEdit : Page
{ {
protected string medID;
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
medID = Crypt.Decrypt(Request.QueryString["ID"]);
}
protected void btnCancelPat_OnClick(object sender, EventArgs e) txtMedID.Enabled = false;
if (!IsPostBack)
{ {
throw new NotImplementedException();
FillMedication(medID);
}
}
protected void FillMedication(string id)
{
var ds = new DataSet();
ds = PharmacyDataTier.MedicationInfoSearch(medID);
txtMedID.Text = ds.Tables[0].Rows[0]["Medication_id"].ToString();
txtMedName.Text = ds.Tables[0].Rows[0]["MedicationName"].ToString();
txtIntake.Text = ds.Tables[0].Rows[0]["IntakeMethod"].ToString();
txtFrequency.Text = ds.Tables[0].Rows[0]["Frequency"].ToString();
txtDosage.Text = ds.Tables[0].Rows[0]["Dosage"].ToString();
txtPurpose.Text = ds.Tables[0].Rows[0]["Purpose"].ToString();
txtRxNum.Text = ds.Tables[0].Rows[0]["RxNum"].ToString();
}
protected void btnCancelMed_OnClick(object sender, EventArgs e)
{
Response.Redirect("mediSearch.aspx");
}
protected void btnSaveMed_OnClick(object sender, EventArgs e)
{
string id = Val.varchar(txtMedID, 7);
string medName = Val.varchar(txtMedName, 60);
string intake = Val.varchar(txtIntake, 30);
string frequency = Val.varchar(txtFrequency, length:30);
string dosage = Val.varchar(txtDosage, length:30);
string purpose = Val.varchar(txtPurpose, length:100);
string rxNum = Val.varchar(txtRxNum, 30);
PharmacyDataTier.UpdateMedication(id, medName, intake,frequency, dosage, purpose, rxNum);
Response.Redirect("mediSearch.aspx");
} }
} }
} }

View File

@ -41,15 +41,6 @@ namespace FWA_MAIN
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtIntake; protected global::System.Web.UI.WebControls.TextBox txtIntake;
/// <summary>
/// txtPatID control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPatID;
/// <summary> /// <summary>
/// txtFrequency control. /// txtFrequency control.
/// </summary> /// </summary>
@ -87,22 +78,22 @@ namespace FWA_MAIN
protected global::System.Web.UI.WebControls.TextBox txtRxNum; protected global::System.Web.UI.WebControls.TextBox txtRxNum;
/// <summary> /// <summary>
/// btnSavePat control. /// btnSaveMed 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 btnSavePat; protected global::System.Web.UI.WebControls.Button btnSaveMed;
/// <summary> /// <summary>
/// btnCancelPat control. /// btnCancelMed 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 btnCancelPat; protected global::System.Web.UI.WebControls.Button btnCancelMed;
/// <summary> /// <summary>
/// Master property. /// Master property.

View File

@ -1,17 +1,26 @@
<%@ Page Title="New Medication" Language="C#" MasterPageFile="main.master" CodeBehind="medNew.aspx.cs" Inherits="FWA_MAIN.medNew" %> <%@ Page Title="New Medication" Language="C#" MasterPageFile="main.master" CodeBehind="medNew.aspx.cs" Inherits="FWA_MAIN.medNew" %>
<asp:Content runat="server" ContentPlaceHolderID="cph1"> <asp:Content runat="server" ContentPlaceHolderID="cph1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(document).keypress(function(e) {
if (e.which === 13) { // Enter key = keycode 13
e.preventDefault(); // Prevent the default Enter action
$("#<%= btnSaveMed.ClientID %>").click(); // Trigger the search button click
}
});
});
</script>
<link type="text/css" href="main.css"/> <link type="text/css" href="main.css"/>
<h1 style="text-align: center; font-size: 44px">New Medication</h1> <h1 style="text-align: center; font-size: 44px">New 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: 400px; padding-right: 5px;width: 100px">
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Medication ID: </label></div> <div class="indivPatDiv" style="text-align: right"><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"><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"><label class="buttonLabel">Intake Method: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Patient ID: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Frequency: </label></div> <div class="indivPatDiv" style="text-align: right"><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"><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"><label class="buttonLabel">Purpose: </label></div>
@ -22,7 +31,7 @@
<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>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtMedName"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtMedName"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtIntake"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtIntake"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPatID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtFrequency"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtFrequency"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtDosage"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtDosage"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPurpose"></asp:TextBox></div> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPurpose"></asp:TextBox></div>
@ -35,7 +44,7 @@
</div> </div>
<br/><br/> <br/><br/>
<div class="patDiv" style="margin-left: 500px"> <div class="patDiv" style="margin-left: 500px">
<div style="margin-right: 10px; display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnSavePat" Text="Create"/></div> <div style="margin-right: 10px; display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnSaveMed" Text="Create" OnClick="btnSaveMed_OnClick"/></div>
<div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelPat" Text="Cancel" OnClick="btnCancelPat_OnClick"/></div> <div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelMed" Text="Cancel" OnClick="btnCancelMed_OnClick"/></div>
</div> </div>
</asp:Content> </asp:Content>

View File

@ -5,14 +5,34 @@ namespace FWA_MAIN
{ {
public partial class medNew : Page public partial class medNew : Page
{ {
protected string medID;
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
medID = Crypt.Decrypt(Request.QueryString["ID"]);
txtMedID.Enabled = false;
txtMedID.Text = medID;
} }
protected void btnCancelPat_OnClick(object sender, EventArgs e) protected void btnCancelMed_OnClick(object sender, EventArgs e)
{ {
throw new NotImplementedException(); Response.Redirect("MediSearch.aspx");
}
protected void btnSaveMed_OnClick(object sender, EventArgs e)
{
string id = Val.varchar(txtMedID, 7);
string medName = Val.varchar(txtMedName, 60);
string intake = Val.varchar(txtIntake, 30);
string frequency = Val.varchar(txtFrequency, length:30);
string dosage = Val.varchar(txtDosage, length:30);
string purpose = Val.varchar(txtPurpose, length:100);
string rxNum = Val.varchar(txtRxNum, 30);
PharmacyDataTier.CreateMedication(id, medName, intake,frequency, dosage, purpose, rxNum);
Response.Redirect("mediSearch.aspx");
} }
} }
} }

View File

@ -41,15 +41,6 @@ namespace FWA_MAIN
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtIntake; protected global::System.Web.UI.WebControls.TextBox txtIntake;
/// <summary>
/// txtPatID control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPatID;
/// <summary> /// <summary>
/// txtFrequency control. /// txtFrequency control.
/// </summary> /// </summary>
@ -87,22 +78,22 @@ namespace FWA_MAIN
protected global::System.Web.UI.WebControls.TextBox txtRxNum; protected global::System.Web.UI.WebControls.TextBox txtRxNum;
/// <summary> /// <summary>
/// btnSavePat control. /// btnSaveMed 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 btnSavePat; protected global::System.Web.UI.WebControls.Button btnSaveMed;
/// <summary> /// <summary>
/// btnCancelPat control. /// btnCancelMed 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 btnCancelPat; protected global::System.Web.UI.WebControls.Button btnCancelMed;
/// <summary> /// <summary>
/// Master property. /// Master property.

View File

@ -4,12 +4,41 @@
<head> <head>
<link href="main.css" rel="stylesheet" type="text/css" /> <link href="main.css" rel="stylesheet" type="text/css" />
<style>
.parent {
position: relative;
height: 100%;
}
.child {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
h1{
text-align: center;
}
</style>
</head> </head>
<body runat="server"> <body runat="server">
<div class="standardcontentpage"> <div class="parent">
<h1>Hello</h1> <div class="child">
<h1>Welcome to Louis' Pharmacy!</h1>
<br/><br/>
<h1>Use the pane on the left to navigate</h1>
<h1>Make a selection and right click for more options</h1>
</div>
</div></body> </div></body>

View File

@ -14,7 +14,7 @@
</defaultDocument> </defaultDocument>
</system.webServer> </system.webServer>
<connectionStrings> <connectionStrings>
<add name="ConnString" connectionString="Server=sql.eggtech.net;Database=FinalProjectOfficialPharmacy;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;" providerName="System.Data.SqlClient" /> <add name="ConnString" connectionString="Server=10.1.1.250;Database=FinalProjectOfficialPharmacy;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;" providerName="System.Data.SqlClient" />
</connectionStrings> </connectionStrings>
<appSettings> <appSettings>
<add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Version" value="3.0.0.0" />

View File

@ -14,7 +14,7 @@
</defaultDocument> </defaultDocument>
</system.webServer> </system.webServer>
<connectionStrings> <connectionStrings>
<add name="ConnString" connectionString="Server=sql.eggtech.net;Database=FinalProjectOfficialPharmacy;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;" providerName="System.Data.SqlClient"/> <add name="ConnString" connectionString="Server=10.1.1.250;Database=FinalProjectOfficialPharmacy;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;" providerName="System.Data.SqlClient"/>
</connectionStrings> </connectionStrings>
<appSettings> <appSettings>
<add key="webpages:Version" value="3.0.0.0"/> <add key="webpages:Version" value="3.0.0.0"/>

View File

@ -14,7 +14,7 @@
</defaultDocument> </defaultDocument>
</system.webServer> </system.webServer>
<connectionStrings> <connectionStrings>
<add name="ConnString" connectionString="Server=sql.eggtech.net;Database=FinalProjectOfficialPharmacy;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;" providerName="System.Data.SqlClient" /> <add name="ConnString" connectionString="Server=10.1.1.250;Database=FinalProjectOfficialPharmacy;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;" providerName="System.Data.SqlClient" />
</connectionStrings> </connectionStrings>
<appSettings> <appSettings>
<add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Version" value="3.0.0.0" />

View File

@ -30,20 +30,20 @@ namespace FWA_MAIN
var ds = new DataSet(); var ds = new DataSet();
ds = PharmacyDataTier.PatientInfoSearch(patID); ds = PharmacyDataTier.PatientInfoSearch(patID);
txtPatID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString(); txtPatID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString().Trim();
txtFNAME.Text = ds.Tables[0].Rows[0]["FirstName"].ToString(); txtFNAME.Text = ds.Tables[0].Rows[0]["FirstName"].ToString().Trim();
txtLNAME.Text = ds.Tables[0].Rows[0]["LastName"].ToString(); txtLNAME.Text = ds.Tables[0].Rows[0]["LastName"].ToString().Trim();
txtMidInit.Text = ds.Tables[0].Rows[0]["MiddleIntials"].ToString(); txtMidInit.Text = ds.Tables[0].Rows[0]["MiddleIntials"].ToString().Trim();
txtWeight.Text = ds.Tables[0].Rows[0]["lbs"].ToString(); txtWeight.Text = ds.Tables[0].Rows[0]["lbs"].ToString().Trim();
txtHeightFt.Text = ds.Tables[0].Rows[0]["Height_feet"].ToString(); txtHeightFt.Text = ds.Tables[0].Rows[0]["Height_feet"].ToString().Trim();
txtHeightIn.Text = ds.Tables[0].Rows[0]["Height_inches"].ToString(); txtHeightIn.Text = ds.Tables[0].Rows[0]["Height_inches"].ToString().Trim();
DateTime date = DateTime.Parse(ds.Tables[0].Rows[0]["DOB"].ToString()); DateTime date = DateTime.Parse(ds.Tables[0].Rows[0]["DOB"].ToString().Trim());
txtDOB.Text = date.ToString("d"); txtDOB.Text = date.ToString("d");
txtGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString(); txtGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString().Trim();
txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString(); txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString().Trim();
txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString(); txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString().Trim();
txtState.Text = ds.Tables[0].Rows[0]["UsState"].ToString(); txtState.Text = ds.Tables[0].Rows[0]["UsState"].ToString().Trim();
txtPhoneNum.Text = ds.Tables[0].Rows[0]["PhoneNumber"].ToString(); txtPhoneNum.Text = ds.Tables[0].Rows[0]["PhoneNumber"].ToString().Trim();
} }

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();

View File

@ -43,9 +43,9 @@ namespace FWA_MAIN
string rxnum = Val.varchar(txtRxNum, 11); string rxnum = Val.varchar(txtRxNum, 11);
int allow = Val.IntType(txtAllowed); int allow = Val.IntType(txtAllowed);
int used = Val.IntType(txtUsed); int used = Val.IntType(txtUsed);
string medid = Val.varchar(txtMedID, 7); string medid = Val.MedID(txtMedID);
string phyid = Val.varchar(txtPhysID, 8); string phyid = Val.PhyID(txtPhysID);
string patid = Val.varchar(txtPatID, 8); string patid = Val.PatID(txtPatID);
DateTime start = Val.Date(txtStart); DateTime start = Val.Date(txtStart);
DateTime end = Val.Date(txtEnd); DateTime end = Val.Date(txtEnd);