diff --git a/FWA_MAIN/preEdit.aspx.cs b/FWA_MAIN/preEdit.aspx.cs
index ddf8383..e21d22b 100644
--- a/FWA_MAIN/preEdit.aspx.cs
+++ b/FWA_MAIN/preEdit.aspx.cs
@@ -1,23 +1,63 @@
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)
{
- throw new NotImplementedException();
+ 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);
+
+ Response.Redirect("Prescription.aspx");
+
}
protected void btnCancelPre_OnClick(object sender, EventArgs e)
{
- throw new NotImplementedException();
+ Response.Redirect("Prescription.aspx");
}
}
}
\ No newline at end of file
diff --git a/FWA_MAIN/preEdit.aspx.designer.cs b/FWA_MAIN/preEdit.aspx.designer.cs
index 8300def..8216f4f 100644
--- a/FWA_MAIN/preEdit.aspx.designer.cs
+++ b/FWA_MAIN/preEdit.aspx.designer.cs
@@ -68,6 +68,24 @@ namespace FWA_MAIN
///
protected global::System.Web.UI.WebControls.TextBox txtAllowed;
+ ///
+ /// txtStart control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtStart;
+
+ ///
+ /// txtEnd control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtEnd;
+
///
/// btnSavePat control.
///
diff --git a/FWA_MAIN/preNew.aspx b/FWA_MAIN/preNew.aspx
index c989a64..724f99d 100644
--- a/FWA_MAIN/preNew.aspx
+++ b/FWA_MAIN/preNew.aspx
@@ -7,27 +7,27 @@
New Prescription
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -36,7 +36,7 @@
\ No newline at end of file
diff --git a/FWA_MAIN/preNew.aspx.cs b/FWA_MAIN/preNew.aspx.cs
index 3ebd8c1..522a045 100644
--- a/FWA_MAIN/preNew.aspx.cs
+++ b/FWA_MAIN/preNew.aspx.cs
@@ -5,14 +5,35 @@ namespace FWA_MAIN
{
public partial class preNew : Page
{
+
+ protected string preID;
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)
{
- 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);
+
+ Response.Redirect("Prescription.aspx");
}
}
}
\ No newline at end of file
diff --git a/FWA_MAIN/preNew.aspx.designer.cs b/FWA_MAIN/preNew.aspx.designer.cs
index 7678379..3c48633 100644
--- a/FWA_MAIN/preNew.aspx.designer.cs
+++ b/FWA_MAIN/preNew.aspx.designer.cs
@@ -24,31 +24,13 @@ namespace FWA_MAIN
protected global::System.Web.UI.WebControls.TextBox txtRxNum;
///
- /// txtNumRefill control.
+ /// txtPatID control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.TextBox txtNumRefill;
-
- ///
- /// txtPastRefill control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.TextBox txtPastRefill;
-
- ///
- /// txtPhysID control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.TextBox txtPhysID;
+ protected global::System.Web.UI.WebControls.TextBox txtPatID;
///
/// txtMedID control.
@@ -60,31 +42,49 @@ namespace FWA_MAIN
protected global::System.Web.UI.WebControls.TextBox txtMedID;
///
- /// txtPatID control.
+ /// txtPhysID control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.TextBox txtPatID;
+ protected global::System.Web.UI.WebControls.TextBox txtPhysID;
///
- /// txtPreStart control.
+ /// txtUsed control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.TextBox txtPreStart;
+ protected global::System.Web.UI.WebControls.TextBox txtUsed;
///
- /// txtPreEnd control.
+ /// txtAllowed control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.TextBox txtPreEnd;
+ protected global::System.Web.UI.WebControls.TextBox txtAllowed;
+
+ ///
+ /// txtStart control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtStart;
+
+ ///
+ /// txtEnd control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtEnd;
///
/// btnSavePat control.