CNSA-216-FP/FWA_MAIN/MediSearch.aspx

173 lines
6.2 KiB
Plaintext
Raw Normal View History

2024-03-21 18:17:57 -04:00
<%@ Page Title="Medication" Language="C#" MasterPageFile="main.master" CodeBehind="MediSearch.aspx.cs" Inherits="FWA_MAIN.MediSearch" %>
2024-03-21 17:26:50 -04:00
2024-03-21 18:17:57 -04:00
<asp:Content runat="server" ContentPlaceHolderID="cph1">
2024-03-21 18:17:57 -04:00
<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
$("#<%= btnMediSearch.ClientID %>").click(); // Trigger the search button click
2024-03-21 18:17:57 -04:00
}
});
});
2024-03-21 18:17:57 -04:00
</script>
<link type="text/css" href="main.css"/>
2024-03-21 18:17:57 -04:00
<h1 style="text-align: center; font-size: 44px">
Medications
</h1>
<div class="medDiv" style="padding-left: 400px">
<div class="medDiv" style="width: 100px; margin-right: 5px">
<div class="indivMedDiv" style="text-align: right;">
<label for="txtFNAME" class="buttonLabel">Medication ID: </label>
2024-03-21 18:17:57 -04:00
</div>
<br/>
<div class="indivMedDiv" style="text-align: right;">
<label for="txtLNAME" class="buttonLabel">Medication Name: </label>
2024-03-21 18:17:57 -04:00
</div>
<br/>
<div class="indivMedDiv" style="text-align: right;">
<label for="txtMedID" class="buttonLabel">Rx Number: </label>
2024-03-21 18:17:57 -04:00
</div>
<br/>
</div>
<div class="medDiv" style="width: 400px">
<div class="indivMedDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtMedID"></asp:TextBox>
2024-03-21 18:17:57 -04:00
</div>
<br/>
<div class="indivMedDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtMedName"></asp:TextBox>
2024-03-21 18:17:57 -04:00
</div>
<br/>
<div class="indivMedDiv">
<asp:TextBox runat="server" CssClass="defaultTXT" id="txtRxNum"></asp:TextBox>
2024-03-21 18:17:57 -04:00
</div>
<br/>
</div>
<br/>
2024-04-02 17:30:32 -04:00
<asp:Button runat="server" ID="btnMediSearch" Text="Search" CssClass="btnPatSearch" OnClick="btnMediSearch_OnClick" />
2024-03-21 18:17:57 -04:00
</div>
2024-04-02 17:30:32 -04:00
<div style="width: 75%; margin: 0 auto; align-content: center; horiz-align: center">
<asp:GridView runat="server" ID="gvMedication" CssClass="gridview"
HeaderStyle-CssClass="headerstyle"
RowStyle-CssClass="rowstyle"
AlternatingRowStyle-CssClass="alternatingrowstyle"
SelectedRowStyle-CssClass="selectedrowstyle"
OnRowCommand="gvMedication_OnRowCommand"
AutoGenerateColumns="False"
OnRowDataBound="gvMedication_OnRowDataBound"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
2024-03-21 18:17:57 -04:00
<Columns>
<asp:BoundField DataField="Medication_id" HeaderText="Medication ID" ItemStyle-Width="100px"/>
<asp:BoundField DataField="MedicationName" HeaderText="Medication Name" ItemStyle-Width="100px"/>
<asp:BoundField DataField="IntakeMethod" HeaderText="Intake Method" ItemStyle-Width="100px"/>
<asp:BoundField DataField="Frequency" HeaderText="Frequency" ItemStyle-Width="100px"/>
<asp:BoundField DataField="Dosage" HeaderText="Dosage" ItemStyle-Width="100px"/>
<asp:BoundField DataField="Purpose" HeaderText="Purpose" ItemStyle-Width="100px"/>
<asp:BoundField DataField="RxNum" HeaderText="RxNum" ItemStyle-Width="100px"/>
2024-03-21 18:17:57 -04:00
</Columns>
2024-04-02 17:30:32 -04:00
</asp:GridView></div>
2024-03-21 18:17:57 -04:00
<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="medNew.aspx">New</a>
</li>
<li>
<a href="medEdit.aspx">Edit</a>
</li>
<li>
<a href="medDelete.aspx">Delete</a>
2024-03-21 18:17:57 -04:00
</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>
<script type="text/javascript">
window.onload = function() {
var grid = document.getElementById("<%= gvMedication.ClientID %>");
var rows = grid.getElementsByTagName("tr");
for (var i = 0; i < rows.length; i++) {
rows[i].onclick = function() {
// Assuming the first cell in every row contains the unique ID
var id = this.cells[0].innerText;
__doPostBack('Select$', id);
};
}
};
</script>
</asp:Content>