diff --git a/FWA_MAIN/MediSearch.aspx b/FWA_MAIN/MediSearch.aspx index 183ae7a..38fa394 100644 --- a/FWA_MAIN/MediSearch.aspx +++ b/FWA_MAIN/MediSearch.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="Medication" Language="C#" MasterPageFile="main.master" CodeBehind="MediSearch.aspx.cs" Inherits="FWA_MAIN.MediSearch" %> +<%@ Page Title="Medication" Language="C#" EnableEventValidation="false" MasterPageFile="main.master" CodeBehind="MediSearch.aspx.cs" Inherits="FWA_MAIN.MediSearch" %> @@ -87,21 +87,21 @@ + style="display: none; width: auto"> + + - + .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; + } + +<%-- --%> diff --git a/FWA_MAIN/MediSearch.aspx.cs b/FWA_MAIN/MediSearch.aspx.cs index 674758d..e2d0d98 100644 --- a/FWA_MAIN/MediSearch.aspx.cs +++ b/FWA_MAIN/MediSearch.aspx.cs @@ -123,6 +123,50 @@ namespace FWA_MAIN } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) + { + BindData(); + } + + protected void btnMedNew_OnClick(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + + protected void bntMedEdit_OnClick(object sender, EventArgs e) + { + string medicationID = "0"; + //Int64 mEditedRecord = 0; + //System.Text.StringBuilder sb = new System.Text.StringBuilder(); + + try + { + Session["vMedID"] = txtMedID.Text.Trim(); + Session["vMedName"] = txtMedName.Text.Trim(); + Session["vRxNum"] = txtRxNum.Text.Trim(); + + + try + { + + medicationID = Crypt.Encrypt(gvMedication.SelectedRow.Cells[0].Text); + Response.Redirect("patEdit.aspx" + "?" + "ID=" + medicationID, false); + } + catch (Exception exception) + { + } + + // Use the patientID value as needed + + + + } + catch (Exception ex) + { + throw new Exception(ex.Message, ex.InnerException); + } + } + + protected void btnMedDelete_OnClick(object sender, EventArgs e) { throw new NotImplementedException(); } diff --git a/FWA_MAIN/MediSearch.aspx.designer.cs b/FWA_MAIN/MediSearch.aspx.designer.cs index 5088cfe..09af69f 100644 --- a/FWA_MAIN/MediSearch.aspx.designer.cs +++ b/FWA_MAIN/MediSearch.aspx.designer.cs @@ -59,6 +59,33 @@ namespace FWA_MAIN /// protected global::System.Web.UI.WebControls.GridView gvMedication; + /// + /// btnMedNew control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnMedNew; + + /// + /// bntMedEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button bntMedEdit; + + /// + /// btnMedDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnMedDelete; + /// /// Master property. /// diff --git a/FWA_MAIN/PharmactDataTier.cs b/FWA_MAIN/PharmactDataTier.cs index d8298cc..40e52b1 100644 --- a/FWA_MAIN/PharmactDataTier.cs +++ b/FWA_MAIN/PharmactDataTier.cs @@ -236,6 +236,7 @@ namespace FWA_MAIN string Medication_id, string MedicationName, string IntakeMethod, + string Patient_id, string Frequency, string Dosage, string Purpose, diff --git a/FWA_MAIN/bin/FWA_MAIN.dll b/FWA_MAIN/bin/FWA_MAIN.dll index 1eab801..f86843d 100644 Binary files a/FWA_MAIN/bin/FWA_MAIN.dll and b/FWA_MAIN/bin/FWA_MAIN.dll differ diff --git a/FWA_MAIN/bin/FWA_MAIN.pdb b/FWA_MAIN/bin/FWA_MAIN.pdb index 71347d1..4d965f5 100644 Binary files a/FWA_MAIN/bin/FWA_MAIN.pdb and b/FWA_MAIN/bin/FWA_MAIN.pdb differ diff --git a/FWA_MAIN/medEdit.aspx b/FWA_MAIN/medEdit.aspx index a22fa17..9e5ba00 100644 --- a/FWA_MAIN/medEdit.aspx +++ b/FWA_MAIN/medEdit.aspx @@ -1,7 +1,17 @@ <%@ Page Title="Edit Medication" Language="C#" MasterPageFile="main.master" CodeBehind="medEdit.aspx.cs" Inherits="FWA_MAIN.medEdit" %> - + +

Edit Medication

@@ -32,7 +42,7 @@
-
-
+
+
\ No newline at end of file diff --git a/FWA_MAIN/medEdit.aspx.cs b/FWA_MAIN/medEdit.aspx.cs index bcab2df..14e3ec5 100644 --- a/FWA_MAIN/medEdit.aspx.cs +++ b/FWA_MAIN/medEdit.aspx.cs @@ -1,18 +1,71 @@ using System; +using System.Data; using System.Web.UI; namespace FWA_MAIN { public partial class medEdit : Page { + + protected string medID; protected void Page_Load(object sender, EventArgs e) { + medID = Crypt.Decrypt(Request.QueryString["ID"]); + + + txtMedID.Enabled = false; + if (!IsPostBack) + { + + FillMedication(medID); + } } - protected void btnCancelPat_OnClick(object sender, EventArgs e) + + + protected void FillMedication(string id) { - throw new NotImplementedException(); + + var ds = new DataSet(); + ds = PharmacyDataTier.MedicationInfoSearch(medID); + + txtMedID.Text = ds.Tables[0].Rows[0]["Medication_id"].ToString(); + txtMedName.Text = ds.Tables[0].Rows[0]["MedicationName"].ToString(); + txtIntake.Text = ds.Tables[0].Rows[0]["IntakeMethod"].ToString(); + txtPatID.Text = ds.Tables[0].Rows[0]["Patient_id"].ToString(); + txtFrequency.Text = ds.Tables[0].Rows[0]["Frequency"].ToString(); + txtDosage.Text = ds.Tables[0].Rows[0]["Dosage"].ToString(); + txtPurpose.Text = ds.Tables[0].Rows[0]["Purpose"].ToString(); + txtRxNum.Text = ds.Tables[0].Rows[0]["RxNum"].ToString(); + + + } + + + + + protected void btnCancelMed_OnClick(object sender, EventArgs e) + { + Response.Redirect("mediSearch.aspx"); + } + + + protected void btnSaveMed_OnClick(object sender, EventArgs e) + { + string id = Val.varchar(txtMedID, 7); + string medName = Val.varchar(txtMedName, 60); + string intake = Val.varchar(txtIntake, 30); + string patID = Val.varchar(txtPatID, 1); + string frequency = Val.varchar(txtFrequency, length:30); + string dosage = Val.varchar(txtDosage, length:30); + string purpose = Val.varchar(txtPurpose, length:100); + string rxNum = Val.varchar(txtRxNum, 30); + + + PharmacyDataTier.UpdateMedication(id, MedicationName:medName, IntakeMethod: intake, Patient_id:patID, Frequency: frequency, Dosage: dosage, Purpose: purpose, RxNum: rxNum); + Response.Redirect("mediSearch.aspx"); + } } } \ No newline at end of file diff --git a/FWA_MAIN/medEdit.aspx.designer.cs b/FWA_MAIN/medEdit.aspx.designer.cs index 509e8ab..bb16a8e 100644 --- a/FWA_MAIN/medEdit.aspx.designer.cs +++ b/FWA_MAIN/medEdit.aspx.designer.cs @@ -87,22 +87,22 @@ namespace FWA_MAIN protected global::System.Web.UI.WebControls.TextBox txtRxNum; /// - /// btnSavePat control. + /// btnSaveMed control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Button btnSavePat; + protected global::System.Web.UI.WebControls.Button btnSaveMed; /// - /// btnCancelPat control. + /// btnCancelMed control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Button btnCancelPat; + protected global::System.Web.UI.WebControls.Button btnCancelMed; /// /// Master property. diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.dll b/FWA_MAIN/obj/Debug/FWA_MAIN.dll index 1eab801..f86843d 100644 Binary files a/FWA_MAIN/obj/Debug/FWA_MAIN.dll and b/FWA_MAIN/obj/Debug/FWA_MAIN.dll differ diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.pdb b/FWA_MAIN/obj/Debug/FWA_MAIN.pdb index 71347d1..4d965f5 100644 Binary files a/FWA_MAIN/obj/Debug/FWA_MAIN.pdb and b/FWA_MAIN/obj/Debug/FWA_MAIN.pdb differ