Merge remote-tracking branch 'origin/master'

# Conflicts:
#	.idea/.idea.FWA_MAIN/.idea/dataSources.xml
#	FWA_MAIN/bin/FWA_MAIN.dll
#	FWA_MAIN/bin/FWA_MAIN.pdb
#	FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache
#	FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache
#	FWA_MAIN/obj/Debug/FWA_MAIN.dll
#	FWA_MAIN/obj/Debug/FWA_MAIN.pdb
This commit is contained in:
netnobody19 2024-03-28 19:15:03 -04:00
commit 437ab80ba2
28 changed files with 1105 additions and 43 deletions

View File

@ -1,7 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="FinalProjectOfficialPharmacy@sql.eggtech.net" uuid="d1ce5fbb-beb4-4aa4-aa9b-0f789e3ed403">
<data-source source="LOCAL" name="College2@sql.eggtech.net" uuid="c2de8ef4-059e-44b0-a7e0-cca90bba5cf4">
<driver-ref>sqlserver.jb</driver-ref>
<synchronize>true</synchronize>
<configured-by-url>true</configured-by-url>
<jdbc-driver>com.jetbrains.jdbc.sqlserver.SqlServerDriver</jdbc-driver>
<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>
</data-source>
<data-source source="LOCAL" name="FinalProjectOfficialPharmacy@sql.eggtech.net" uuid="e9b9e528-a4c2-4f75-8a99-51124912d950">
<driver-ref>sqlserver.jb</driver-ref>
<synchronize>true</synchronize>
<configured-by-url>true</configured-by-url>

View File

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

77
FWA_MAIN/Crypt.cs Normal file
View File

@ -0,0 +1,77 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.UI.WebControls;
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Web;
namespace FWA_MAIN
{
public class Crypt
{
static private string encryptKey =
"CXvA@xsFmBik#E4#7tf4zY7JK^qaTUwFYw^QuC7sipSyBPfkS$qFFU%ZQmRb5GY85unfCmEw@dK7Bhiyt%3asL62yygk6x6D@@D8CUnJfF8@F$C9vtJgGwNhmSxvo#Lh";
static private string encryptSalt =
"gab-purgatory-studio-atlantic-ladle-challenge-slaw-unshaken-eastward-caring-deftly-devious-crudeness-walrus-glorifier-unsteady-sauciness-feminist-jailbreak-upside";
static public string Encrypt(string cleartext)
{
byte[] plainText = Encoding.UTF8.GetBytes(cleartext);
using (RijndaelManaged rijndaelCipher = new RijndaelManaged())
{
PasswordDeriveBytes secretKey = new PasswordDeriveBytes(Encoding.ASCII.GetBytes(encryptKey),
Encoding.ASCII.GetBytes(encryptSalt));
using (ICryptoTransform encryptor =
rijndaelCipher.CreateEncryptor(secretKey.GetBytes(32), secretKey.GetBytes(16)))
{
using (MemoryStream memoryStream = new MemoryStream())
{
using (CryptoStream cryptoStream =
new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write))
{
cryptoStream.Write(plainText, 0, plainText.Length);
cryptoStream.FlushFinalBlock();
string base64 = Convert.ToBase64String(memoryStream.ToArray());
// Generate a string that won't get screwed up when passed as a query string.
string urlEncoded = HttpUtility.UrlEncode(base64);
return urlEncoded;
}
}
}
}
}
static public string Decrypt(string cleartext)
{
byte[] encryptedData = Convert.FromBase64String(cleartext);
PasswordDeriveBytes secretKey = new PasswordDeriveBytes(Encoding.ASCII.GetBytes(encryptKey),
Encoding.ASCII.GetBytes(encryptSalt));
using (RijndaelManaged rijndaelCipher = new RijndaelManaged())
{
using (ICryptoTransform decryptor =
rijndaelCipher.CreateDecryptor(secretKey.GetBytes(32), secretKey.GetBytes(16)))
{
using (MemoryStream memoryStream = new MemoryStream(encryptedData))
{
using (CryptoStream cryptoStream =
new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read))
{
byte[] plainText = new byte[encryptedData.Length];
cryptoStream.Read(plainText, 0, plainText.Length);
string utf8 = Encoding.UTF8.GetString(plainText);
return utf8.Trim('\0');
}
}
}
}
}
}
}

View File

@ -117,6 +117,7 @@
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="Crypt.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
@ -162,11 +163,11 @@
<Compile Include="patEdit.aspx.designer.cs">
<DependentUpon>patEdit.aspx</DependentUpon>
</Compile>
<Compile Include="patient.aspx.cs">
<Compile Include="patSearch.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>patient.aspx</DependentUpon>
<DependentUpon>patSearch.aspx</DependentUpon>
</Compile>
<Compile Include="patient.aspx.designer.cs" />
<Compile Include="patSearch.aspx.designer.cs" />
<Compile Include="patNew.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>patNew.aspx</DependentUpon>
@ -187,12 +188,19 @@
<Compile Include="physician.aspx.designer.cs">
<DependentUpon>physician.aspx</DependentUpon>
</Compile>
<Compile Include="physNew.aspx.cs">
<Compile Include="preNew.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>physNew.aspx</DependentUpon>
<DependentUpon>preNew.aspx</DependentUpon>
</Compile>
<Compile Include="physNew.aspx.designer.cs">
<DependentUpon>physNew.aspx</DependentUpon>
<Compile Include="preNew.aspx.designer.cs">
<DependentUpon>preNew.aspx</DependentUpon>
</Compile>
<Compile Include="Prescription.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>Prescription.aspx</DependentUpon>
</Compile>
<Compile Include="Prescription.aspx.designer.cs">
<DependentUpon>Prescription.aspx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="testpage.aspx.cs">
@ -206,6 +214,7 @@
<Compile Include="Default.aspx.designer.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>
<Compile Include="Val.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="cmutemplate.html" />
@ -224,11 +233,10 @@
<Content Include="MediSearch.aspx" />
<Content Include="medNew.aspx" />
<Content Include="patEdit.aspx" />
<Content Include="patient.aspx" />
<Content Include="patSearch.aspx" />
<Content Include="patNew.aspx" />
<Content Include="physEdit.aspx" />
<Content Include="physician.aspx" />
<Content Include="physNew.aspx" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="Default.aspx" />

View File

@ -831,7 +831,7 @@ namespace FWA_MAIN
}
public static double GetNextPatientID()
public static string GetNextPatientID()
{
try
{
@ -845,7 +845,6 @@ namespace FWA_MAIN
cmdString.CommandTimeout = 1500;
cmdString.CommandText = "GetNextPatientID";
// Define input parameter
cmdString.Parameters.Add("@TableName", SqlDbType.NVarChar, 128).Value = "PATIENT";
object result = cmdString.ExecuteScalar();
double value = 0;
@ -859,9 +858,15 @@ namespace FWA_MAIN
// MessageBox.Show("Error Getting next Patient ID","ERROR",MessageBoxButtons.OK);
}
string stringval = value.ToString();
while (stringval.Length < 8)
{
stringval = "0" + stringval;
}
// return dataSet
return value;
return stringval;
}
catch (Exception ex)
{

View File

@ -1,43 +1,78 @@
<%@ Page Title="Patients" Language="C#" MasterPageFile="main.master" CodeBehind="patient.aspx.cs" Inherits="FWA_MAIN.patient" %>
<%@ Page Title="Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="Prescription.aspx.cs" Inherits="FWA_MAIN.Prescription" %>
<asp:Content runat="server" ContentPlaceHolderID="cph1">
<link type="text/css" href="main.css"/>
<h1 style="text-align: center; font-size: 44px">
Patients
Prescriptions
</h1>
<div class="patDiv" style="padding-left: 400px">
<div class="patDiv" style="width: 100px; margin-right: 5px">
<div class="indivPatDiv" style="text-align: right;">
<label for="txtFNAME" class="buttonLabel">First Name: </label>
<label for="txtRxNum" class="buttonLabel">Rx Number: </label>
</div>
<br/>
<div class="indivPatDiv" style="text-align: right;">
<label for="txtLNAME" class="buttonLabel">Last Name: </label>
<label for="txtPhysID" class="buttonLabel">Physician ID: </label>
</div>
<br/>
<div class="indivPatDiv" style="text-align: right;">
<label for="txtPatID" class="buttonLabel">Patient ID: </label>
</div>
<br/>
<div class="indivPatDiv" style="text-align: right;">
<label for="txtNumRefill" class="buttonLabel">Number of refills: </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>
<br/>
</div>
<div class="patDiv" style="width: 400px">
<div class="indivPatDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtFNAME"></asp:TextBox>
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtRxNum"></asp:TextBox>
</div>
<br/>
<div class="indivPatDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtLNAME"></asp:TextBox>
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtPhysID"></asp:TextBox>
</div>
<br/>
<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="txtNumRefill"></asp:TextBox>
</div>
<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>
<br/>
<asp:Button runat="server" ID="btnPatSearch" Text="Search" CssClass="btnPatSearch" OnClick="btnPatSearch_OnClick"/>
<asp:Button runat="server" ID="btnPatSearch" Text="Search" CssClass="btnPatSearch" OnClick="btnPreSearch_OnClick"/>
</div>
@ -56,10 +91,10 @@
style="display: none">
<ul>
<li>
<a href="patNew.aspx">New</a>
<a href="preNew.aspx">New</a>
</li>
<li>
<a href="patEdit.aspx">Edit</a>
<a href="preEdit.aspx">Edit</a>
</li>
<li>
<a href="#">Delete</a>

View File

@ -3,22 +3,23 @@ using System.Web.UI;
namespace FWA_MAIN
{
public partial class patient : Page
public partial class Prescription : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnPreSearch_OnClick(object sender, EventArgs e)
{
throw new NotImplementedException();
}
protected void btnNew_OnClick(object sender, EventArgs e)
{
Response.Redirect("patNew.aspx");
}
protected void btnPatSearch_OnClick(object sender, EventArgs e)
{
Response.Redirect("preNew.aspx");
}
}

112
FWA_MAIN/Prescription.aspx.designer.cs generated Normal file
View File

@ -0,0 +1,112 @@
//------------------------------------------------------------------------------
// <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 Prescription
{
/// <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>
/// 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>
/// 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>
/// txtNumRefill 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 txtNumRefill;
/// <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>
/// btnPatSearch 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 btnPatSearch;
/// <summary>
/// gvPatient 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 gvPatient;
/// <summary>
/// Master property.
/// </summary>
/// <remarks>
/// Auto-generated property.
/// </remarks>
public new FWA_MAIN.main Master
{
get
{
return ((FWA_MAIN.main)(base.Master));
}
}
}
}

81
FWA_MAIN/Val.cs Normal file
View File

@ -0,0 +1,81 @@
using System;
using System.Web.UI.WebControls;
namespace FWA_MAIN
{
public class Val
{
public static string varchar(TextBox box, int length)
{
if (box.Text.Length <= length)
{
return box.Text.Trim();
}
else
{
return "";
}
}
public static int IntType(TextBox box)
{
try
{
return int.Parse(box.Text.Trim());
}
catch (Exception e)
{
return 0;
}
}
public static short SmallIntType(TextBox box)
{
try
{
if (box.Text.Length > 0)
{
if (double.Parse(box.Text) < 65535 && double.Parse(box.Text) >= 0)
{
return short.Parse(box.Text.Trim());
}
else
{
return 0;
}
}
else
{
return 0;
}
}
catch (Exception e)
{
return 0;
}
}
public static DateTime Date(TextBox box)
{
try
{
DateTime date = DateTime.Parse(box.Text.Trim());
return date;
}
catch (Exception e)
{
return new DateTime(3000, 1, 1);
}
}
}
}

Binary file not shown.

View File

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

Binary file not shown.

View File

@ -40,7 +40,7 @@ namespace FWA_MAIN
protected void btnPatient_OnClick(object sender, EventArgs e)
{
Response.Redirect("patient.aspx");
Response.Redirect("patSearch.aspx");
}
@ -56,7 +56,7 @@ namespace FWA_MAIN
protected void btnPrescription_OnClick(object sender, EventArgs e)
{
throw new NotImplementedException();
Response.Redirect("Prescription.aspx");
}
}
}

View File

@ -13,6 +13,51 @@
}
.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;

View File

@ -1 +1 @@
45d3d63d138360e7ab73dd1d2eec4fe816552351495d36e6dec0aaff47df2394
e89e31cdadf20fe7db48ef132bf217873437f194debfb0966ea84327b2ae8615

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,17 @@
<%@ Page Title="Edit Patient" Language="C#" MasterPageFile="main.master" CodeBehind="patEdit.aspx.cs" Inherits="FWA_MAIN.patEdit" %>
<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 Patient</h1>
@ -47,7 +57,7 @@
</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="Save"/></div>
<div style="margin-right: 10px; display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnSavePat" Text="Save" 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>

View File

@ -1,18 +1,78 @@
using System;
using System.Web.UI;
using System.Data;
namespace FWA_MAIN
{
public partial class patEdit : Page
{
protected string patID;
protected void Page_Load(object sender, EventArgs e)
{
patID = Crypt.Decrypt(Request.QueryString["ID"]);
txtPatID.Enabled = false;
if (!IsPostBack)
{
FillPatient(patID);
}
}
protected void FillPatient(string id)
{
var ds = new DataSet();
ds = PharmacyDataTier.PatientInfoSearch(patID);
txtPatID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString();
txtFNAME.Text = ds.Tables[0].Rows[0]["FirstName"].ToString();
txtLNAME.Text = ds.Tables[0].Rows[0]["LastName"].ToString();
txtMidInit.Text = ds.Tables[0].Rows[0]["MiddleIntials"].ToString();
txtWeight.Text = ds.Tables[0].Rows[0]["lbs"].ToString();
txtHeightFt.Text = ds.Tables[0].Rows[0]["Height_feet"].ToString();
txtHeightIn.Text = ds.Tables[0].Rows[0]["Height_inches"].ToString();
DateTime date = DateTime.Parse(ds.Tables[0].Rows[0]["DOB"].ToString());
txtDOB.Text = date.ToString("d");
txtGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString();
txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString();
txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString();
txtState.Text = ds.Tables[0].Rows[0]["UsState"].ToString();
txtPhoneNum.Text = ds.Tables[0].Rows[0]["PhoneNumber"].ToString();
}
protected void btnCancelPat_OnClick(object sender, EventArgs e)
{
Response.Redirect("patient.aspx");
Response.Redirect("patSearch.aspx");
}
protected void btnSavePat_OnClick(object sender, EventArgs e)
{
string id = Val.varchar(txtPatID, 8);
string FNAME = Val.varchar(txtFNAME, 30);
string LNAME = Val.varchar(txtLNAME, 30);
string MidInit = Val.varchar(txtMidInit, 1);
int Weight = Val.IntType(txtWeight);
int HeightFt = Val.IntType(txtHeightFt);
int HeightIn = Val.IntType(txtHeightIn);
DateTime date = Val.Date(txtDOB);
string gender = Val.varchar(txtGender, 1);
string city = Val.varchar(txtCity, 30);
short zip = Val.SmallIntType(txtZip);
string state = Val.varchar(txtState, 2);
string phone = Val.varchar(txtPhoneNum, 14);
PharmacyDataTier.UpdatePatient(id,FNAME,LNAME,MidInit,Weight,HeightFt,HeightIn,date,gender,city,zip,state,phone);
Response.Redirect("patSearch.aspx");
}
}
}

View File

@ -1,7 +1,17 @@
<%@ Page Title="New Patient" Language="C#" MasterPageFile="main.master" CodeBehind="patNew.aspx.cs" Inherits="FWA_MAIN.patNew" %>
<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">New Patient</h1>
@ -47,7 +57,7 @@
</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"/></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="btnCancelPat_OnClick"/></div>
</div>
</asp:Content>

View File

@ -5,14 +5,41 @@ namespace FWA_MAIN
{
public partial class patNew : Page
{
protected string patID;
protected void Page_Load(object sender, EventArgs e)
{
patID = Crypt.Decrypt(Request.QueryString["ID"]);
txtPatID.Text = patID;
}
protected void btnCancelPat_OnClick(object sender, EventArgs e)
{
Response.Redirect("patient.aspx");
Response.Redirect("patSearch.aspx");
}
protected void btnSavePat_OnClick(object sender, EventArgs e)
{
string id = Val.varchar(txtPatID, 8);
string FNAME = Val.varchar(txtFNAME, 30);
string LNAME = Val.varchar(txtLNAME, 30);
string MidInit = Val.varchar(txtMidInit, 1);
int Weight = Val.IntType(txtWeight);
int HeightFt = Val.IntType(txtHeightFt);
int HeightIn = Val.IntType(txtHeightIn);
DateTime date = Val.Date(txtDOB);
string gender = Val.varchar(txtGender, 1);
string city = Val.varchar(txtCity, 30);
Int16 zip = Val.SmallIntType(txtZip);
string state = Val.varchar(txtState, 2);
string phone = Val.varchar(txtPhoneNum, 14);
PharmacyDataTier.CreatePatient(id,FNAME,LNAME,MidInit,Weight,HeightFt,HeightIn,date,gender,city,zip,state,phone);
Response.Redirect("patSearch.aspx");
}
}
}

162
FWA_MAIN/patSearch.aspx Normal file
View File

@ -0,0 +1,162 @@
<%@ Page Title="Patients" EnableEventValidation="false" Language="C#" MasterPageFile="main.master" CodeBehind="~/patSearch.aspx.cs" Inherits="FWA_MAIN.patSearch" %>
<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
$("#<%= btnPatSearch.ClientID %>").click(); // Trigger the search button click
}
});
});
</script>
<link type="text/css" href="main.css"/>
<h1 style="text-align: center; font-size: 44px">
Patients
</h1>
<div class="patDiv" style="padding-left: 400px">
<div class="patDiv" style="width: 100px; margin-right: 5px">
<div class="indivPatDiv" style="text-align: right;">
<label for="txtFNAME" class="buttonLabel">First Name: </label>
</div>
<br/>
<div class="indivPatDiv" style="text-align: right;">
<label for="txtLNAME" class="buttonLabel">Last Name: </label>
</div>
<br/>
<div class="indivPatDiv" style="text-align: right;">
<label for="txtPatID" class="buttonLabel">Patient ID: </label>
</div>
<br/>
</div>
<div class="patDiv" style="width: 400px">
<div class="indivPatDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtFNAME"></asp:TextBox>
</div>
<br/>
<div class="indivPatDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtLNAME"></asp:TextBox>
</div>
<br/>
<div class="indivPatDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtPatID"></asp:TextBox>
</div>
<br/>
</div>
<br/>
<asp:Button runat="server" ID="btnPatSearch" Text="Search" CssClass="btnPatSearch" OnClick="btnPatSearch_OnClick"/>
</div>
<br/>
<br/>
<br/>
<br/>
<div style="width: 75%; margin: 0 auto; align-content: center; horiz-align: center">
<asp:GridView runat="server" ID="gvPatient"
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="Patient_id" HeaderText="Patient ID" SortExpression="Patient_id"/>
<asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName"/>
<asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName"/>
<asp:BoundField DataField="DOB" HeaderText="Date of Birth" SortExpression="DOB" DataFormatString="{0:d}" HtmlEncode="False"/>
<asp:BoundField DataField="Gender" HeaderText="Gender" SortExpression="Gender"/>
<asp:BoundField DataField="PhoneNumber" HeaderText="Phone Number" SortExpression="PhoneNumber"/>
<asp:BoundField DataField="Zip" HeaderText="Zip Code" SortExpression="Zip"/>
</Columns>
</asp:GridView></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="btnPatNew" Text="New" OnClick="btnPatNew_OnClick"/>
</li>
<li style="height: 25px">
<asp:Button runat="server" CssClass="standardbtn" ID="bntPatEdit" Text="Edit" OnClick="bntPatEdit_OnClick"/>
</li>
<li style="height: 25px">
<asp:Button runat="server" CssClass="standardbtn" ID="btnPatDelete" Text="Delete" OnClick="btnPatDelete_OnClick"/>
</li>
<%-- <asp:Button runat="server" Text="New" OnClick="btnNew_OnClick" /> --%>
</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>

213
FWA_MAIN/patSearch.aspx.cs Normal file
View File

@ -0,0 +1,213 @@
using System;
using System.Web.UI;
using System.Data;
using System.Drawing;
using System.Web.UI.WebControls;
namespace FWA_MAIN
{
public partial class patSearch : Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
txtPatID.Text = Convert.ToString(Session["vPatID"]);
txtFNAME.Text = Convert.ToString(Session["vFNAME"]);
txtLNAME.Text = Convert.ToString(Session["vLNAME"]);
btnPatSearch_OnClick(sender,e);
}
}
protected void btnNew_OnClick(object sender, EventArgs e)
{
Response.Redirect("patNew.aspx");
}
private void BindData()
{
DataSet ds = new DataSet();
string patID = Convert.ToString(Session["vPatID"]);
string LNAME = Convert.ToString(Session["vLNAME"]);
string FNAME = Convert.ToString(Session["vFNAME"]);
txtPatID.Text = patID;
txtFNAME.Text = FNAME;
txtLNAME.Text = LNAME;
// if (textHasValues)
// {
ds = PharmacyDataTier.PatientInfoSearch(patID, LNAME, FNAME);
// }
// ds = dt.GetStudents();
gvPatient.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);
}
gvPatient.DataBind();
}
protected void btnPatSearch_OnClick(object sender, EventArgs e)
{
if (txtPatID.Text.Trim().Length > 0 || txtFNAME.Text.Trim().Length > 0 || txtLNAME.Text.Trim().Length > 0)
{
try
{
Session["vPatID"] = txtPatID.Text.Trim();
Session["vFNAME"] = txtFNAME.Text.Trim();
Session["vLNAME"] = txtLNAME.Text.Trim();
Cache.Remove("StudentData");
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(gvPatient, "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 (gvPatient.SelectedIndex == index)
{
// Deselect the row
gvPatient.SelectedIndex = -1;
}
else
{
// Select the row
gvPatient.SelectedIndex = index;
}
// Refresh the GridView to update the style
gvPatient.DataBind();
}
}
protected void btnPatNew_OnClick(object sender, EventArgs e)
{
string patientID;
try
{
Session["vPatID"] = txtPatID.Text.Trim();
Session["vFNAME"] = txtFNAME.Text.Trim();
Session["vLNAME"] = txtLNAME.Text.Trim();
// Use the patientID value as needed
try
{
patientID = PharmacyDataTier.GetNextPatientID();
patientID = Crypt.Encrypt(patientID);
Response.Redirect("patNew.aspx" + "?" + "ID=" + patientID, false);
}
catch (Exception exception)
{
}
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex.InnerException);
}
}
protected void bntPatEdit_OnClick(object sender, EventArgs e)
{
string patientID = "0";
Int64 mEditedRecord = 0;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
try
{
Session["vPatID"] = txtPatID.Text.Trim();
Session["vFNAME"] = txtFNAME.Text.Trim();
Session["vLNAME"] = txtLNAME.Text.Trim();
try
{
patientID = Crypt.Encrypt(gvPatient.SelectedRow.Cells[0].Text);
Response.Redirect("patEdit.aspx" + "?" + "ID=" + patientID, false);
}
catch (Exception exception)
{
}
// Use the patientID value as needed
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex.InnerException);
}
}
protected void btnPatDelete_OnClick(object sender, EventArgs e)
{
try
{
PharmacyDataTier.DeletePatient(gvPatient.SelectedRow.Cells[0].Text);
BindData();
}
catch (Exception exception)
{
}
}
}
}

View File

@ -11,7 +11,7 @@ namespace FWA_MAIN
{
public partial class patient
public partial class patSearch
{
/// <summary>
@ -59,6 +59,33 @@ namespace FWA_MAIN
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gvPatient;
/// <summary>
/// btnPatNew 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 btnPatNew;
/// <summary>
/// bntPatEdit 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 bntPatEdit;
/// <summary>
/// btnPatDelete 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 btnPatDelete;
/// <summary>
/// Master property.
/// </summary>

42
FWA_MAIN/preNew.aspx Normal file
View File

@ -0,0 +1,42 @@
<%@ Page Title="New Prescription" Language="C#" MasterPageFile="main.master" CodeBehind="preNew.aspx.cs" Inherits="FWA_MAIN.preNew" %>
<asp:Content runat="server" ContentPlaceHolderID="cph1">
<link type="text/css" href="main.css"/>
<h1 style="text-align: center; font-size: 44px">New Prescription</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">Rx Number: </label></div><br/>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Number of Refills: </label></div><br/>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Number of Past Refills: </label></div><br/>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Physician ID: </label></div><br/>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Medication ID: </label></div><br/>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Patient ID: </label></div><br/>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Prescription Start Date: </label></div><br/>
<div class="indivPatDiv" style="text-align: right"><label class="buttonLabel">Prescription End Date: </label></div><br/>
</div>
<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="txtNumRefill"></asp:TextBox></div><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="txtPhysID"></asp:TextBox></div><br/>
<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="txtPatID"></asp:TextBox></div><br/>
<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="txtPreEnd"></asp:TextBox></div><br/>
</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"/></div>
<div style="display: inline-block"><asp:Button runat="server" CssClass="standardbtn" ID="btnCancelPat" Text="Cancel" OnClick="btnCancelPre_OnClick"/></div>
</div>
</asp:Content>

18
FWA_MAIN/preNew.aspx.cs Normal file
View File

@ -0,0 +1,18 @@
using System;
using System.Web.UI;
namespace FWA_MAIN
{
public partial class preNew : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnCancelPre_OnClick(object sender, EventArgs e)
{
throw new NotImplementedException();
}
}
}

121
FWA_MAIN/preNew.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 preNew
{
/// <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>
/// txtNumRefill 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 txtNumRefill;
/// <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>
/// 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>
/// 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>
/// txtPreStart 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 txtPreStart;
/// <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>
/// 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));
}
}
}
}