2024-03-28 19:15:20 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Web.UI;
|
2024-03-29 09:47:23 -04:00
|
|
|
|
using System.Data;
|
2024-03-28 19:15:20 -04:00
|
|
|
|
|
|
|
|
|
namespace FWA_MAIN
|
|
|
|
|
{
|
|
|
|
|
public partial class preEdit : Page
|
|
|
|
|
{
|
2024-03-29 09:47:23 -04:00
|
|
|
|
protected string preID;
|
2024-03-28 19:15:20 -04:00
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-03-29 09:47:23 -04:00
|
|
|
|
preID = Crypt.Decrypt(Request.QueryString["ID"]);
|
|
|
|
|
|
|
|
|
|
txtRxNum.Enabled = false;
|
|
|
|
|
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
FillPrescription(preID);
|
|
|
|
|
}
|
2024-03-28 19:15:20 -04:00
|
|
|
|
}
|
2024-03-29 09:47:23 -04:00
|
|
|
|
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");
|
2024-03-28 19:15:20 -04:00
|
|
|
|
|
2024-03-29 09:47:23 -04:00
|
|
|
|
|
|
|
|
|
}
|
2024-03-28 19:15:20 -04:00
|
|
|
|
protected void btnSavePre_OnClick(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-03-29 09:47:23 -04:00
|
|
|
|
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");
|
|
|
|
|
|
2024-03-28 19:15:20 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void btnCancelPre_OnClick(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-03-29 09:47:23 -04:00
|
|
|
|
Response.Redirect("Prescription.aspx");
|
2024-03-28 19:15:20 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|