Merge remote-tracking branch 'origin/master'

This commit is contained in:
netnobody19 2024-04-02 10:07:29 -04:00
commit 4a6f1b6d52
43 changed files with 1871 additions and 317 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true"> <component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="College2@sql.eggtech.net" uuid="c2de8ef4-059e-44b0-a7e0-cca90bba5cf4"> <data-source source="LOCAL" name="College2@sql.eggtech.net" uuid="b645e608-5922-4cfb-84ec-cdb5d5cd28ef">
<driver-ref>sqlserver.jb</driver-ref> <driver-ref>sqlserver.jb</driver-ref>
<synchronize>true</synchronize> <synchronize>true</synchronize>
<configured-by-url>true</configured-by-url> <configured-by-url>true</configured-by-url>
@ -9,7 +9,7 @@
<jdbc-url>Server=sql.eggtech.net;Database=College2;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;</jdbc-url> <jdbc-url>Server=sql.eggtech.net;Database=College2;User Id=admin;Password=delirium-purveyor-overall-backboned-approval-amino;</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir> <working-dir>$ProjectFileDir$</working-dir>
</data-source> </data-source>
<data-source source="LOCAL" name="FinalProjectOfficialPharmacy@sql.eggtech.net" uuid="e9b9e528-a4c2-4f75-8a99-51124912d950"> <data-source source="LOCAL" name="FinalProjectOfficialPharmacy@sql.eggtech.net" uuid="2d017281-7170-459e-a8dc-a82ccc836dd2">
<driver-ref>sqlserver.jb</driver-ref> <driver-ref>sqlserver.jb</driver-ref>
<synchronize>true</synchronize> <synchronize>true</synchronize>
<configured-by-url>true</configured-by-url> <configured-by-url>true</configured-by-url>

View File

@ -2,7 +2,11 @@
<project version="4"> <project version="4">
<component name="UserContentModel"> <component name="UserContentModel">
<attachedFolders /> <attachedFolders />
<explicitIncludes /> <explicitIncludes>
<Path>FWA_MAIN/Prescription.aspx</Path>
<Path>FWA_MAIN/physNew.aspx</Path>
<Path>FWA_MAIN/preNew.aspx</Path>
</explicitIncludes>
<explicitExcludes /> <explicitExcludes />
</component> </component>
</project> </project>

View File

@ -155,7 +155,7 @@
<virtualDirectoryDefaults allowSubDirConfig="true" /> <virtualDirectoryDefaults allowSubDirConfig="true" />
<site name="FWA_MAIN" id="1"> <site name="FWA_MAIN" id="1">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\caschick221\RiderProjects\FWA_MAIN\FWA_MAIN" /> <virtualDirectory path="/" physicalPath="C:\Users\eggman\Nextcloud\TSCT\2nd Year\SEM 4\RiderProjects\FWA_MAIN\FWA_MAIN" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:5000:localhost" /> <binding protocol="http" bindingInformation="*:5000:localhost" />

View File

@ -128,6 +128,13 @@
<Compile Include="main.master.designer.cs"> <Compile Include="main.master.designer.cs">
<DependentUpon>main.master</DependentUpon> <DependentUpon>main.master</DependentUpon>
</Compile> </Compile>
<Compile Include="MaxRefillNotif.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>MaxRefillNotif.aspx</DependentUpon>
</Compile>
<Compile Include="MaxRefillNotif.aspx.designer.cs">
<DependentUpon>MaxRefillNotif.aspx</DependentUpon>
</Compile>
<Compile Include="medDelete.aspx.cs"> <Compile Include="medDelete.aspx.cs">
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
<DependentUpon>medDelete.aspx</DependentUpon> <DependentUpon>medDelete.aspx</DependentUpon>
@ -188,6 +195,13 @@
<Compile Include="physician.aspx.designer.cs"> <Compile Include="physician.aspx.designer.cs">
<DependentUpon>physician.aspx</DependentUpon> <DependentUpon>physician.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="preEdit.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>preEdit.aspx</DependentUpon>
</Compile>
<Compile Include="preEdit.aspx.designer.cs">
<DependentUpon>preEdit.aspx</DependentUpon>
</Compile>
<Compile Include="preNew.aspx.cs"> <Compile Include="preNew.aspx.cs">
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
<DependentUpon>preNew.aspx</DependentUpon> <DependentUpon>preNew.aspx</DependentUpon>
@ -203,6 +217,20 @@
<DependentUpon>Prescription.aspx</DependentUpon> <DependentUpon>Prescription.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RefEdit.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>RefEdit.aspx</DependentUpon>
</Compile>
<Compile Include="RefEdit.aspx.designer.cs">
<DependentUpon>RefEdit.aspx</DependentUpon>
</Compile>
<Compile Include="Refills.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>Refills.aspx</DependentUpon>
</Compile>
<Compile Include="Refills.aspx.designer.cs">
<DependentUpon>Refills.aspx</DependentUpon>
</Compile>
<Compile Include="testpage.aspx.cs"> <Compile Include="testpage.aspx.cs">
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
<DependentUpon>testpage.aspx</DependentUpon> <DependentUpon>testpage.aspx</DependentUpon>
@ -228,6 +256,7 @@
<Content Include="Content\Site.css" /> <Content Include="Content\Site.css" />
<Content Include="main.css" /> <Content Include="main.css" />
<Content Include="main.master" /> <Content Include="main.master" />
<Content Include="MaxRefillNotif.aspx" />
<Content Include="medDelete.aspx" /> <Content Include="medDelete.aspx" />
<Content Include="medEdit.aspx" /> <Content Include="medEdit.aspx" />
<Content Include="MediSearch.aspx" /> <Content Include="MediSearch.aspx" />
@ -237,6 +266,11 @@
<Content Include="patNew.aspx" /> <Content Include="patNew.aspx" />
<Content Include="physEdit.aspx" /> <Content Include="physEdit.aspx" />
<Content Include="physician.aspx" /> <Content Include="physician.aspx" />
<Content Include="preEdit.aspx" />
<Content Include="preNew.aspx" />
<Content Include="Prescription.aspx" />
<Content Include="RefEdit.aspx" />
<Content Include="Refills.aspx" />
<Content Include="Scripts\bootstrap.js" /> <Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" /> <Content Include="Scripts\bootstrap.min.js" />
<Content Include="Default.aspx" /> <Content Include="Default.aspx" />

View File

@ -0,0 +1,29 @@
<%@ Page Language="C#" CodeBehind="MaxRefillNotif.aspx.cs" Inherits="FWA_MAIN.MaxRefillNotif" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<link type="text/css" href="main.css"/>
<head runat="server">
<title>Title</title>
</head>
<body style="background-color: #0f0f0f">
<form id="HtmlForm" runat="server" style="background-color: #0f0f0f">
<div style="horiz-align: center; width: 100%">
<h1 style="color: red; horiz-align: center">MAX REFILLS REACHED</h1>
</div>
<br/>
<br/>
<br/>
<asp:Button runat="server" ID="btnClose" CssClass="btnPatSearch" Text="Close" OnClick="btnClose_OnClick"/>
</form>
</body>
</html>

View File

@ -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);
}
}
}

35
FWA_MAIN/MaxRefillNotif.aspx.designer.cs generated Normal file
View File

@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FWA_MAIN
{
public partial class MaxRefillNotif
{
/// <summary>
/// HtmlForm control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm HtmlForm;
/// <summary>
/// btnClose 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 btnClose;
}
}

View File

@ -2,26 +2,21 @@
<asp:Content runat="server" ContentPlaceHolderID="cph1"> <asp:Content runat="server" ContentPlaceHolderID="cph1">
<link type="text/css" href="main.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () { $(document).ready(function() {
var inputElements = document.getElementsByTagName('input'); $(document).keypress(function(e) {
for (var i = 0; i < inputElements.length; i++) { if (e.which === 13) { // Enter key = keycode 13
var input = inputElements[i]; e.preventDefault(); // Prevent the default Enter action
if (input.type === 'text') { $("#<%= btnMediSearch.ClientID %>").click(); // Trigger the search button click
input.addEventListener('keydown', function (event) {
if (event.keyCode === 13) { // 13 is the Enter key
event.preventDefault(); // Prevent the default action
document.getElementById('<%= btnMediSearch.ClientID %>').click(); // Trigger button click
} }
}); });
}
}
}); });
</script> </script>
<link type="text/css" href="main.css"/>
<h1 style="text-align: center; font-size: 44px"> <h1 style="text-align: center; font-size: 44px">
Medications Medications
@ -61,15 +56,23 @@
</div> </div>
<asp:GridView runat="server" ID="gvMedication" BorderColor="white" AutoGenerateColumns="False" OnSelectedIndexChanged="gvMedication_OnSelectedIndexChanged" <asp:GridView runat="server" ID="gvMedication" CssClass="gridview"
OnRowDataBound="gvMedication_OnRowDataBound"> HeaderStyle-CssClass="headerstyle"
RowStyle-CssClass="rowstyle"
AlternatingRowStyle-CssClass="alternatingrowstyle"
SelectedRowStyle-CssClass="selectedrowstyle"
OnRowCommand="gvMedication_OnRowCommand"
AutoGenerateColumns="False"
OnRowDataBound="gvMedication_OnRowDataBound"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns> <Columns>
<asp:BoundField DataField="Medication_id" HeaderText="Medication ID" ItemStyle-Width="100px"/> <asp:BoundField DataField="Medication_id" HeaderText="Medication ID" ItemStyle-Width="100px"/>
<asp:BoundField DataField="FirstName" HeaderText="First Name" ItemStyle-Width="100px"/> <asp:BoundField DataField="MedicationName" HeaderText="Medication Name" ItemStyle-Width="100px"/>
<asp:BoundField DataField="LastName" HeaderText="Last Name" ItemStyle-Width="100px"/> <asp:BoundField DataField="IntakeMethod" HeaderText="Intake Method" ItemStyle-Width="100px"/>
<asp:BoundField DataField="DOB" HeaderText="Date of Birth" ItemStyle-Width="100px"/> <asp:BoundField DataField="Frequency" HeaderText="Frequency" ItemStyle-Width="100px"/>
<asp:BoundField DataField="PhoneNumber" HeaderText="Phone Number" ItemStyle-Width="100px"/> <asp:BoundField DataField="Dosage" HeaderText="Dosage" ItemStyle-Width="100px"/>
<asp:BoundField DataField="Gender" HeaderText="Gender" ItemStyle-Width="100px"/> <asp:BoundField DataField="Purpose" HeaderText="Purpose" ItemStyle-Width="100px"/>
<asp:BoundField DataField="RxNum" HeaderText="RxNum" ItemStyle-Width="100px"/>
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Data;
using System.Web.UI; using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
@ -8,20 +9,120 @@ namespace FWA_MAIN
{ {
protected void Page_Load(object sender, EventArgs e) 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) 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) 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(); throw new NotImplementedException();
} }

View File

@ -959,7 +959,7 @@ namespace FWA_MAIN
} }
} }
public static double GetNextRxNum() public static string GetNextRxNum()
{ {
try try
{ {
@ -984,10 +984,17 @@ namespace FWA_MAIN
{ {
// MessageBox.Show("Error Getting next Rx Number", "ERROR", MessageBoxButtons.OK); // MessageBox.Show("Error Getting next Rx Number", "ERROR", MessageBoxButtons.OK);
} }
string stringval = value.ToString();
while (stringval.Length < 11)
{
stringval = "0" + stringval;
}
// return dataSet // return dataSet
return value; return stringval;
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -1074,7 +1081,7 @@ namespace FWA_MAIN
} }
} }
public static double GetNextRefillID() public static string GetNextRefillID()
{ {
try try
{ {
@ -1102,9 +1109,15 @@ namespace FWA_MAIN
// MessageBox.Show("Error Getting next Refill ID", "ERROR", MessageBoxButtons.OK); // MessageBox.Show("Error Getting next Refill ID", "ERROR", MessageBoxButtons.OK);
} }
string stringval = value.ToString();
while (stringval.Length < 10)
{
stringval = "0" + stringval;
}
// return dataSet // return dataSet
return value; return stringval;
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -1148,6 +1161,7 @@ namespace FWA_MAIN
} }
} }
public static void UpdateRefill(string refillID, DateTime date, string patientID, string medicationID, string rxNum) public static void UpdateRefill(string refillID, DateTime date, string patientID, string medicationID, string rxNum)
{ {
try try
@ -1210,6 +1224,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) public static void PastRefills(string rxNum)
{ {
try try
@ -1238,6 +1284,34 @@ namespace FWA_MAIN
} }
} }
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) public static void DecrementPastRefills(string rxNum)
{ {
try try
@ -1308,6 +1382,51 @@ namespace FWA_MAIN
} }
} }
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( public static void UpdatePrescription(
string RxNum, string RxNum,
string Patient_id, string Patient_id,
@ -1350,6 +1469,50 @@ namespace FWA_MAIN
} }
} }
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) // public static void FillComboBox(string table, string ValueMember, string displayMember, ComboBox myComboBox)
// { // {
// try // try

View File

@ -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" %>
<asp:Content runat="server" ContentPlaceHolderID="cph1"> <asp:Content runat="server" ContentPlaceHolderID="cph1">
<link type="text/css" href="main.css"/> <link type="text/css" href="main.css"/>
<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
$("#<%= btnPatSearch.ClientID %>").click(); // Trigger the search button click
}
});
});
</script>
<h1 style="text-align: center; font-size: 44px"> <h1 style="text-align: center; font-size: 44px">
Prescriptions Prescriptions
</h1> </h1>
@ -21,21 +34,11 @@
</div> </div>
<br/> <br/>
<div class="indivPatDiv" style="text-align: right;"> <div class="indivPatDiv" style="text-align: right;">
<label for="txtNumRefill" class="buttonLabel">Number of refills: </label> <label for="txtMedID" class="buttonLabel">Medication ID: </label>
</div>
<br/>
<div class="indivPatDiv" style="text-align: right;">
<label for="txtPastRefill" class="buttonLabel">Number of Past Refills: </label>
</div>
<br/>
<div class="indivPatDiv" style="text-align: right;">
<label for="txtStart" class="buttonLabel">Prescription Start Date: </label>
</div>
<br/>
<div class="indivPatDiv" style="text-align: right;">
<label for="txtPreEnd" class="buttonLabel">Prescription End Date: </label>
</div> </div>
<br/> <br/>
</div> </div>
<div class="patDiv" style="width: 400px"> <div class="patDiv" style="width: 400px">
@ -52,31 +55,39 @@
</div> </div>
<br/> <br/>
<div class="indivPatDiv"> <div class="indivPatDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtNumRefill"></asp:TextBox> <asp:TextBox runat="server" CssClass="defaultTXT" id="txtMedID"></asp:TextBox>
</div> </div>
<br/> <br/>
<div class="indivPatDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtPastRefill"></asp:TextBox>
</div>
<br/>
<div class="indivPatDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtStart"></asp:TextBox>
</div>
<br/>
<div class="indivPatDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtPreEnd"></asp:TextBox>
</div>
<br/>
</div> </div>
<br/> <br/>
<asp:Button runat="server" ID="btnPatSearch" Text="Search" CssClass="btnPatSearch" OnClick="btnPreSearch_OnClick"/> <asp:Button runat="server" ID="btnPatSearch" Text="Search" CssClass="btnPatSearch" OnClick="btnPreSearch_OnClick"/>
<br/>
</div> </div>
<asp:GridView runat="server" ID="gvPatient" BorderColor="red"></asp:GridView> <div style="width: 80%; margin: 0 auto; align-content: center; horiz-align: center">
<asp:GridView runat="server" ID="gvPrescription"
CssClass="gridview"
HeaderStyle-CssClass="headerstyle"
RowStyle-CssClass="rowstyle"
AlternatingRowStyle-CssClass="alternatingrowstyle"
SelectedRowStyle-CssClass="selectedrowstyle"
OnRowCommand="gvPatient_OnRowCommand"
AutoGenerateColumns="False"
OnRowDataBound="gvPatient_OnRowDataBound"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="RxNum_id" HeaderText="Rx Number" SortExpression="RxNum"/>
<asp:BoundField DataField="numRefills" HeaderText="Allowed Refills" SortExpression="numRefills"/>
<asp:BoundField DataField="pastNumRefills" HeaderText="Refills Used" SortExpression="pastNumRefills"/>
<asp:BoundField DataField="Physician_id" HeaderText="Physician ID" SortExpression="Physician_id"/>
<asp:BoundField DataField="Medication_id" HeaderText="Medication ID" SortExpression="Medication_id"/>
<asp:BoundField DataField="Patient_id" HeaderText="Patient ID" SortExpression="Patient_id"/>
<asp:BoundField DataField="PrescriptionStart" HeaderText="Prescribed Date" SortExpression="PrescriptionStart" DataFormatString="{0:d}" HtmlEncode="False"/>
<asp:BoundField DataField="PrescriptionEnd" HeaderText="Experation Date" SortExpression="PrescriptionEnd" DataFormatString="{0:d}" HtmlEncode="False"/>
</Columns>
</asp:GridView></div>
<script type="text/javascript"> <script type="text/javascript">
document.oncontextmenu = rightClick; document.oncontextmenu = rightClick;
@ -88,16 +99,22 @@
</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="preNew.aspx">New</a> <asp:Button runat="server" CssClass="standardbtn" ID="btnPreNew" Text="New" OnClick="btnPreNew_OnClick"/>
</li> </li>
<li> <li style="height: 25px">
<a href="preEdit.aspx">Edit</a> <asp:Button runat="server" CssClass="standardbtn" ID="bntPreEdit" Text="Edit" OnClick="bntPreEdit_OnClick"/>
</li> </li>
<li> <li style="height: 25px">
<a href="#">Delete</a> <asp:Button runat="server" CssClass="standardbtn" ID="btnPreDelete" Text="Delete" OnClick="btnPreDelete_OnClick"/>
</li>
<li style="height: 25px">
<asp:Button runat="server" CssClass="standardbtn" ID="btnPreRefill" Text="Refill" OnClick="btnPreRefill_OnClick"/>
</li>
<li style="height: 25px">
<asp:Button runat="server" CssClass="standardbtn" ID="btnPreView" Text="View Refills" OnClick="btnPreView_OnClick"/>
</li> </li>
<%-- <asp:Button runat="server" Text="New" OnClick="btnNew_OnClick" /> --%> <%-- <asp:Button runat="server" Text="New" OnClick="btnNew_OnClick" /> --%>
@ -138,14 +155,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 {

View File

@ -1,5 +1,7 @@
using System; using System;
using System.Web.UI; using System.Web.UI;
using System.Data;
using System.Web.UI.WebControls;
namespace FWA_MAIN namespace FWA_MAIN
{ {
@ -8,19 +10,234 @@ namespace FWA_MAIN
protected void Page_Load(object sender, EventArgs e) 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);
}
}
private void BindData()
{
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 btnPreSearch_OnClick(object sender, EventArgs e) protected void btnPreSearch_OnClick(object sender, EventArgs e)
{ {
throw new NotImplementedException();
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)
{
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)
{
} }
protected void btnNew_OnClick(object sender, EventArgs e) }
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
{ {
Response.Redirect("preNew.aspx"); 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();
}
} }
} }
} }

View File

@ -42,40 +42,13 @@ namespace FWA_MAIN
protected global::System.Web.UI.WebControls.TextBox txtPatID; protected global::System.Web.UI.WebControls.TextBox txtPatID;
/// <summary> /// <summary>
/// txtNumRefill control. /// txtMedID 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.TextBox txtNumRefill; protected global::System.Web.UI.WebControls.TextBox txtMedID;
/// <summary>
/// txtPastRefill 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 txtPastRefill;
/// <summary>
/// txtStart 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 txtStart;
/// <summary>
/// txtPreEnd 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 txtPreEnd;
/// <summary> /// <summary>
/// btnPatSearch control. /// btnPatSearch control.
@ -87,13 +60,58 @@ namespace FWA_MAIN
protected global::System.Web.UI.WebControls.Button btnPatSearch; protected global::System.Web.UI.WebControls.Button btnPatSearch;
/// <summary> /// <summary>
/// gvPatient control. /// gvPrescription 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.GridView gvPatient; protected global::System.Web.UI.WebControls.GridView gvPrescription;
/// <summary>
/// btnPreNew 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 btnPreNew;
/// <summary>
/// bntPreEdit 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 bntPreEdit;
/// <summary>
/// btnPreDelete 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 btnPreDelete;
/// <summary>
/// btnPreRefill 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 btnPreRefill;
/// <summary>
/// btnPreView 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 btnPreView;
/// <summary> /// <summary>
/// Master property. /// Master property.

43
FWA_MAIN/RefEdit.aspx Normal file
View File

@ -0,0 +1,43 @@
<%@ Page Title="EditRefill" Language="C#" MasterPageFile="main.master" CodeBehind="RefEdit.aspx.cs" Inherits="FWA_MAIN.RefEdit" %>
<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
$("#<%= btnSaveRef.ClientID %>").click(); // Trigger the search button click
}
});
});
</script>
<link type="text/css" href="main.css"/>
<h1 style="text-align: center; font-size: 44px">Edit Refill</h1>
<div class="patDiv" style="margin-left: 300px">
<div class="patDiv">
<div class="patDiv" style="padding-left: 150px; padding-right: 5px;width: 100px">
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Refill ID: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Refill Date: </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">Medication ID: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Prescription ID: </label></div>
</div>
<div class="patDiv">
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtRefillID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtDate"></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="txtMedID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPreID"></asp:TextBox></div>
</div>
</div>
</div>
<br/>
<br/>
<br/>
<div class="patDiv" style="margin-left: 500px">
<div style="margin-right: 10px; display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnSaveRef" Text="Save" OnClick="btnSaveRef_OnClick"/></div>
<div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelRef" Text="Cancel" OnClick="btnCancelRef_OnClick"/></div>
</div>
</asp:Content>

65
FWA_MAIN/RefEdit.aspx.cs Normal file
View File

@ -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);
}
}
}

94
FWA_MAIN/RefEdit.aspx.designer.cs generated Normal file
View File

@ -0,0 +1,94 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FWA_MAIN
{
public partial class RefEdit
{
/// <summary>
/// txtRefillID 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 txtRefillID;
/// <summary>
/// txtDate 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 txtDate;
/// <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>
/// txtMedID 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 txtMedID;
/// <summary>
/// txtPreID 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 txtPreID;
/// <summary>
/// btnSaveRef 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 btnSaveRef;
/// <summary>
/// btnCancelRef 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 btnCancelRef;
/// <summary>
/// Master property.
/// </summary>
/// <remarks>
/// Auto-generated property.
/// </remarks>
public new FWA_MAIN.main Master
{
get
{
return ((FWA_MAIN.main)(base.Master));
}
}
}
}

113
FWA_MAIN/Refills.aspx Normal file
View File

@ -0,0 +1,113 @@
<%@ Page Title="Refills" Language="C#" EnableEventValidation="false" MasterPageFile="main.master" CodeBehind="Refills.aspx.cs" Inherits="FWA_MAIN.Refills" %>
<asp:Content runat="server" ContentPlaceHolderID="cph1">
<link type="text/css" href="main.css"/>
<h1 style="text-align: center; font-size: 44px">
Refills
</h1>
<div style="width: 80%; margin: 0 auto; align-content: center; horiz-align: center">
<asp:GridView runat="server" ID="gvRefills"
CssClass="gridview"
HeaderStyle-CssClass="headerstyle"
RowStyle-CssClass="rowstyle"
AlternatingRowStyle-CssClass="alternatingrowstyle"
SelectedRowStyle-CssClass="selectedrowstyle"
OnRowCommand="gvRefills_OnRowCommand"
AutoGenerateColumns="False"
OnRowDataBound="gvRefills_OnRowDataBound"
OnSelectedIndexChanged="gvRefills_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Refill_id" HeaderText="Refill ID"/>
<asp:BoundField DataField="RefillDate" HeaderText="Refill Date" DataFormatString="{0:d}" HtmlEncode="False"/>
<asp:BoundField DataField="Patient_id" HeaderText="Patient ID"/>
<asp:BoundField DataField="Medication_id" HeaderText="Medication ID"/>
<asp:BoundField DataField="RxNum_id" HeaderText="Prescription ID"/>
</Columns>
</asp:GridView></div>
<br/>
<br/>
<br/>
<div class="patDiv" style="margin-left: 500px">
<div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnBack" Text="Back" OnClick="btnBack_OnClick"/></div>
</div>
<script type="text/javascript">
document.oncontextmenu = rightClick;
function rightClick(clickEvent) {
clickEvent.preventDefault();
// return false;
}
</script>
<div id="contextMenu" class="context-menu"
style="display: none; width: auto">
<ul>
<li style="height: 25px">
<asp:Button runat="server" CssClass="standardbtn" ID="btnRefEdit" Text="Edit" OnClick="btnRefEdit_OnClick"/>
</li>
<li style="height: 25px">
<asp:Button runat="server" CssClass="standardbtn" ID="btnRefDelete" Text="Delete" OnClick="btnRefDelete_OnClick"/>
</li>
</ul>
</div>
<script>
document.onclick = hideMenu;
document.oncontextmenu = rightClick;
function hideMenu() {
document.getElementById("contextMenu")
.style.display = "none"
}
function rightClick(e) {
e.preventDefault();
if (document.getElementById("contextMenu").style.display == "block")
hideMenu();
else{
var menu = document.getElementById("contextMenu")
menu.style.display = 'block';
menu.style.left = e.pageX + "px";
menu.style.top = e.pageY + "px";
}
}
</script>
<style type="text/css">
.context-menu {
position: absolute;
text-align: center;
background: lightgray;
border: 1px solid black;
}
.context-menu ul {
padding: 0px;
margin: 0px;
/*min-width: 150px; */
list-style: none;
}
.context-menu ul li {
/*padding-bottom: 7px; */
/*padding-top: 7px; */
/*border: 1px solid black; */
}
.context-menu ul li a {
text-decoration: none;
color: black;
}
.context-menu ul li:hover {
background: darkgray;
}
</style>
</asp:Content>

98
FWA_MAIN/Refills.aspx.cs Normal file
View File

@ -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");
}
}
}

67
FWA_MAIN/Refills.aspx.designer.cs generated Normal file
View File

@ -0,0 +1,67 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FWA_MAIN
{
public partial class Refills
{
/// <summary>
/// gvRefills 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.GridView gvRefills;
/// <summary>
/// btnBack 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 btnBack;
/// <summary>
/// btnRefEdit 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 btnRefEdit;
/// <summary>
/// btnRefDelete 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 btnRefDelete;
/// <summary>
/// Master property.
/// </summary>
/// <remarks>
/// Auto-generated property.
/// </remarks>
public new FWA_MAIN.main Master
{
get
{
return ((FWA_MAIN.main)(base.Master));
}
}
}
}

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Data;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
namespace FWA_MAIN 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) public static DateTime Date(TextBox box)
{ {
try try
@ -69,6 +133,11 @@ namespace FWA_MAIN
DateTime date = DateTime.Parse(box.Text.Trim()); 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; return date;
} }

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
e89e31cdadf20fe7db48ef132bf217873437f194debfb0966ea84327b2ae8615 70b4448723339e99ed60f3c81dc6a5d1da61b1ddf61a97f8541739006170aed6

Binary file not shown.

Binary file not shown.

View File

@ -13,15 +13,26 @@
</files> </files>
</defaultDocument> </defaultDocument>
</system.webServer> </system.webServer>
<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" />
</connectionStrings>
<appSettings> <appSettings>
<add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" /> <add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" /> <add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings> </appSettings>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.8" />
</system.Web>
-->
<system.web> <system.web>
<compilation debug="true" targetFramework="4.8.1" /> <compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.8.1" /> <httpRuntime targetFramework="4.8" />
</system.web> </system.web>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

View File

@ -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{ .sidenavbutton{
background-color: #1D2125; background-color: #1D2125;
@ -34,7 +127,7 @@
.welcomepage{ .welcomepage{
background-color: #1b6d85; background-color: #1b6d85;
outline: solid 1px red; /*outline: solid 1px red;*/
} }
.standardcontentpage{ .standardcontentpage{

View File

@ -11,9 +11,9 @@
<body class="mainmaster"> <body class="mainmaster">
<form runat="server">
<nav class="sidenavdiv"> <nav class="sidenavdiv">
<form runat="server">
<div style="display: block; width: 8%"> <div style="display: block; width: 8%">
<%-- test --%> <%-- test --%>
<asp:Button runat="server" ID="btnHome" CssClass="sidenavbutton" Text="Home" OnClick="home_OnClick" /> <asp:Button runat="server" ID="btnHome" CssClass="sidenavbutton" Text="Home" OnClick="home_OnClick" />
@ -22,9 +22,8 @@
<asp:Button runat="server" ID="btnPhysician" CssClass="sidenavbutton" Text="Physicians" OnClick="btnPhysician_OnClick"/> <asp:Button runat="server" ID="btnPhysician" CssClass="sidenavbutton" Text="Physicians" OnClick="btnPhysician_OnClick"/>
<asp:Button runat="server" ID="btnMedication" CssClass="sidenavbutton" Text="Medications" OnClick="btnMedication_OnClick"/> <asp:Button runat="server" ID="btnMedication" CssClass="sidenavbutton" Text="Medications" OnClick="btnMedication_OnClick"/>
<asp:Button runat="server" ID="btnPrescription" CssClass="sidenavbutton" Text="Prescriptions" OnClick="btnPrescription_OnClick"/> <asp:Button runat="server" ID="btnPrescription" CssClass="sidenavbutton" Text="Prescriptions" OnClick="btnPrescription_OnClick"/>
</div></form>
</div>
</nav> </nav>
@ -32,6 +31,7 @@
<div class="standardcontentpage"> <div class="standardcontentpage">
<asp:ContentPlaceHolder id="cph1" runat="server"></asp:ContentPlaceHolder> <asp:ContentPlaceHolder id="cph1" runat="server"></asp:ContentPlaceHolder>
</div> </div>
</form>
</body> </body>
</html> </html>

View File

@ -1,7 +1,63 @@
<%@ Page Title="New Patient" Language="C#" MasterPageFile="main.master" CodeBehind="patNew.aspx.cs" Inherits="FWA_MAIN.patNew" %> <%@ Page Title="New Patient" Language="C#" MasterPageFile="main.master" CodeBehind="patNew.aspx.cs" Inherits="FWA_MAIN.patNew" %>
<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
$("#<%= btnSavePat.ClientID %>").click(); // Trigger the search button click
}
});
});
</script>
<link type="text/css" href="main.css"/>
<h1>New Patient</h1> <h1 style="text-align: center; font-size: 44px">New Patient</h1>
<div class="patDiv">
<div class="patDiv">
<div class="patDiv" style="padding-left: 150px; padding-right: 5px;width: 100px">
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Patient ID: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">First Name: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Last Name: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Middle Initial: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Weight (lbs): </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Height (Ft): </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Height (In): </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Date of Birth: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Gender (M/F): </label></div>
</div>
<div class="patDiv">
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPatID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtFNAME"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtLNAME"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtMidInit"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtWeight"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtHeightFt"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtHeightIn"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtDOB"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtGender"></asp:TextBox></div>
</div>
</div>
<div class="patDiv">
<div class="patDiv" style="padding-left: 150px; padding-right: 5px;width: 120px">
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">City: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Zip Code: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">State: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Phone Number: </label></div>
</div>
<div class="patDiv">
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtCity"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtZip"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtState"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPhoneNum"></asp:TextBox></div>
</div>
</div>
</div>
<br/>
<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" OnClick="btnSavePat_OnClick"/></div>
<div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelPat" Text="Cancel" OnClick="btnCancelPat_OnClick"/></div>
</div>
</asp:Content> </asp:Content>

View File

@ -1,84 +0,0 @@
<%@ Page Title="Patients" Language="C#" MasterPageFile="main.master" CodeBehind="patient.aspx.cs" Inherits="FWA_MAIN.patient" %>
<asp:Content runat="server" ContentPlaceHolderID="cph1">
<h1 style="text-align: center;">
Welcome to Pharmacy.
</h1>
<h1 style="text-align: center;">
Hi, We are creating a
custom context menu here.
</h1>
<script type="text/javascript">
document.oncontextmenu = rightClick;
function rightClick(clickEvent) {
clickEvent.preventDefault();
// return false;
}
</script>
<div id="contextMenu" class="context-menu"
style="display: none">
<ul>
<li><a href="patNew.aspx">New</a></li>
<li><a href="#">Edit</a></li>
<li><a href="#">Delete</a></li>
</ul>
</div>
<script>
document.onclick = hideMenu;
document.oncontextmenu = rightClick;
function hideMenu() {
document.getElementById("contextMenu")
.style.display = "none"
}
function rightClick(e) {
e.preventDefault();
if (document.getElementById("contextMenu").style.display == "block")
hideMenu();
else{
var menu = document.getElementById("contextMenu")
menu.style.display = 'block';
menu.style.left = e.pageX + "px";
menu.style.top = e.pageY + "px";
}
}
</script>
<style type="text/css">
.context-menu {
position: absolute;
text-align: center;
background: lightgray;
border: 1px solid black;
}
.context-menu ul {
padding: 0px;
margin: 0px;
min-width: 150px;
list-style: none;
}
.context-menu ul li {
padding-bottom: 7px;
padding-top: 7px;
border: 1px solid black;
}
.context-menu ul li a {
text-decoration: none;
color: black;
}
.context-menu ul li:hover {
background: darkgray;
}
</style>
</asp:Content>

View File

@ -1,28 +1,38 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0"?>
<!-- <!--
For more information on how to configure your ASP.NET application, please visit For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=301880 https://go.microsoft.com/fwlink/?LinkId=301880
--> -->
<configuration> <configuration>
<system.webServer> <system.webServer>
<defaultDocument> <defaultDocument>
<files> <files>
<clear /> <clear/>
<add value="Default.aspx" /> <!-- Or your specific default page --> <add value="Default.aspx"/>
<!-- Or your specific default page -->
</files> </files>
</defaultDocument> </defaultDocument>
</system.webServer> </system.webServer>
<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"/>
</connectionStrings>
<appSettings> <appSettings>
<add key="webpages:Version" value="3.0.0.0"/> <add key="webpages:Version" value="3.0.0.0"/>
<add key="webpages:Enabled" value="false"/> <add key="webpages:Enabled" value="false"/>
<add key="ClientValidationEnabled" value="true"/> <add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings> </appSettings>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.8" />
</system.Web>
-->
<system.web> <system.web>
<compilation debug="true" targetFramework="4.8.1"/> <compilation debug="true" targetFramework="4.8"/>
<httpRuntime targetFramework="4.8.1"/> <httpRuntime targetFramework="4.8"/>
</system.web> </system.web>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@ -58,12 +68,8 @@
</runtime> </runtime>
<system.codedom> <system.codedom>
<compilers> <compilers>
<compiler language="c#;cs;csharp" extension=".cs" <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
</compilers> </compilers>
</system.codedom> </system.codedom>
</configuration> </configuration>

View File

@ -13,15 +13,26 @@
</files> </files>
</defaultDocument> </defaultDocument>
</system.webServer> </system.webServer>
<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" />
</connectionStrings>
<appSettings> <appSettings>
<add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" /> <add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" /> <add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings> </appSettings>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.8" />
</system.Web>
-->
<system.web> <system.web>
<compilation debug="true" targetFramework="4.8.1" /> <compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.8.1" /> <httpRuntime targetFramework="4.8" />
</system.web> </system.web>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

View File

@ -12,6 +12,7 @@ namespace FWA_MAIN
patID = Crypt.Decrypt(Request.QueryString["ID"]); patID = Crypt.Decrypt(Request.QueryString["ID"]);
txtPatID.Enabled = false;
txtPatID.Text = patID; txtPatID.Text = patID;
} }

52
FWA_MAIN/preEdit.aspx Normal file
View File

@ -0,0 +1,52 @@
<%@ Page Title="Edit Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="preEdit.aspx.cs" Inherits="FWA_MAIN.preEdit" %>
<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
$("#<%= btnSavePat.ClientID %>").click(); // Trigger the search button click
}
});
});
</script>
<link type="text/css" href="main.css"/>
<h1 style="text-align: center; font-size: 44px">Edit Prescription</h1>
<div class="patDiv">
<div class="patDiv">
<div class="patDiv" style="padding-left: 450px; padding-right: 30px;width: 100px">
<div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Rx Number: </label></div>
<div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Patient 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; width: 120px"><label class="buttonLabel">Physician ID: </label></div>
<div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Refills Used: </label></div>
<div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Refills Allowed: </label></div>
<div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Date Prescribed: </label></div>
<div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Expiration Date: </label></div>
</div>
<div class="patDiv">
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtRxNum"></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="txtMedID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPhysID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtUsed"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtAllowed"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtStart"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtEnd"></asp:TextBox></div>
</div>
</div>
</div>
<br/> <br/>
<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" OnClick="btnSavePre_OnClick"/></div>
<div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelPat" Text="Cancel" OnClick="btnCancelPre_OnClick"/></div>
</div>
</asp:Content>

64
FWA_MAIN/preEdit.aspx.cs Normal file
View File

@ -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");
}
}
}

121
FWA_MAIN/preEdit.aspx.designer.cs generated Normal file
View File

@ -0,0 +1,121 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FWA_MAIN
{
public partial class preEdit
{
/// <summary>
/// txtRxNum 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 txtRxNum;
/// <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>
/// txtMedID 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 txtMedID;
/// <summary>
/// txtPhysID 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 txtPhysID;
/// <summary>
/// txtUsed 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 txtUsed;
/// <summary>
/// txtAllowed 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 txtAllowed;
/// <summary>
/// txtStart 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 txtStart;
/// <summary>
/// txtEnd 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 txtEnd;
/// <summary>
/// btnSavePat 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 btnSavePat;
/// <summary>
/// btnCancelPat 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 btnCancelPat;
/// <summary>
/// Master property.
/// </summary>
/// <remarks>
/// Auto-generated property.
/// </remarks>
public new FWA_MAIN.main Master
{
get
{
return ((FWA_MAIN.main)(base.Master));
}
}
}
}

View File

@ -1,32 +1,42 @@
<%@ Page Title="New Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="preNew.aspx.cs" Inherits="FWA_MAIN.preNew" %> <%@ Page Title="New Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="preNew.aspx.cs" Inherits="FWA_MAIN.preNew" %>
<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
$("#<%= btnSavePat.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 Prescription</h1> <h1 style="text-align: center; font-size: 44px">New Prescription</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">Rx Number: </label></div><br/> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Rx Number: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Number of Refills: </label></div><br/> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Patient ID: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Number of Past Refills: </label></div><br/> <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">Physician ID: </label></div><br/> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Physician ID: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Medication ID: </label></div><br/> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Refills Used: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Patient ID: </label></div><br/> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Refills Allowed: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Prescription Start Date: </label></div><br/> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Date Prescribed: </label></div>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Prescription End Date: </label></div><br/> <div class="indivPatDiv" style="text-align: right; width: 120px"><label class="buttonLabel">Expiration Date: </label></div>
</div> </div>
<div class="patDiv"> <div class="patDiv">
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtRxNum"></asp:TextBox></div><br/> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtRxNum"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtNumRefill"></asp:TextBox></div><br/> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPatID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPastRefill"></asp:TextBox></div><br/> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtMedID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPhysID"></asp:TextBox></div><br/> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPhysID"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtMedID"></asp:TextBox></div><br/> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtUsed"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPatID"></asp:TextBox></div><br/> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtAllowed"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPreStart"></asp:TextBox></div><br/> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtStart"></asp:TextBox></div>
<div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtPreEnd"></asp:TextBox></div><br/> <div class="indivPatDiv"><asp:TextBox runat="server" CssClass="defaultTXT" ID="txtEnd"></asp:TextBox></div>
</div> </div>
</div> </div>
@ -36,7 +46,7 @@
<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="btnSavePat" Text="Create" OnClick="btnSavePat_OnClick"/></div>
<div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelPat" Text="Cancel" OnClick="btnCancelPre_OnClick"/></div> <div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelPat" Text="Cancel" OnClick="btnCancelPre_OnClick"/></div>
</div> </div>
</asp:Content> </asp:Content>

View File

@ -5,14 +5,36 @@ namespace FWA_MAIN
{ {
public partial class preNew : Page public partial class preNew : Page
{ {
protected string preID;
protected void Page_Load(object sender, EventArgs e) 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) 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");
} }
} }
} }

View File

@ -24,31 +24,13 @@ namespace FWA_MAIN
protected global::System.Web.UI.WebControls.TextBox txtRxNum; protected global::System.Web.UI.WebControls.TextBox txtRxNum;
/// <summary> /// <summary>
/// txtNumRefill control. /// txtPatID 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.TextBox txtNumRefill; protected global::System.Web.UI.WebControls.TextBox txtPatID;
/// <summary>
/// txtPastRefill 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 txtPastRefill;
/// <summary>
/// txtPhysID 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 txtPhysID;
/// <summary> /// <summary>
/// txtMedID control. /// txtMedID control.
@ -60,31 +42,49 @@ namespace FWA_MAIN
protected global::System.Web.UI.WebControls.TextBox txtMedID; protected global::System.Web.UI.WebControls.TextBox txtMedID;
/// <summary> /// <summary>
/// txtPatID control. /// txtPhysID 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.TextBox txtPatID; protected global::System.Web.UI.WebControls.TextBox txtPhysID;
/// <summary> /// <summary>
/// txtPreStart control. /// txtUsed 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.TextBox txtPreStart; protected global::System.Web.UI.WebControls.TextBox txtUsed;
/// <summary> /// <summary>
/// txtPreEnd control. /// txtAllowed 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.TextBox txtPreEnd; protected global::System.Web.UI.WebControls.TextBox txtAllowed;
/// <summary>
/// txtStart 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 txtStart;
/// <summary>
/// txtEnd 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 txtEnd;
/// <summary> /// <summary>
/// btnSavePat control. /// btnSavePat control.