diff --git a/.idea/config/applicationhost.config b/.idea/config/applicationhost.config index 15916dc..f5fa50f 100644 --- a/.idea/config/applicationhost.config +++ b/.idea/config/applicationhost.config @@ -155,7 +155,7 @@ - + diff --git a/FWA_MAIN/FWA_MAIN.csproj b/FWA_MAIN/FWA_MAIN.csproj index 2fe263f..707e7a3 100644 --- a/FWA_MAIN/FWA_MAIN.csproj +++ b/FWA_MAIN/FWA_MAIN.csproj @@ -195,6 +195,13 @@ physician.aspx + + ASPXCodeBehind + physnew02.aspx + + + physnew02.aspx + ASPXCodeBehind preEdit.aspx @@ -266,6 +273,7 @@ + diff --git a/FWA_MAIN/PharmactDataTier.cs b/FWA_MAIN/PharmactDataTier.cs index d8298cc..bf89c0c 100644 --- a/FWA_MAIN/PharmactDataTier.cs +++ b/FWA_MAIN/PharmactDataTier.cs @@ -879,7 +879,7 @@ namespace FWA_MAIN } - public static double GetNextPhysicianID() + public static string GetNextPhysicianID() { try { @@ -907,7 +907,26 @@ namespace FWA_MAIN // return dataSet - return value; + value = 0; + try + { + value = Convert.ToDouble(result); + + } + catch(Exception e) + { + // MessageBox.Show("Error Getting next Patient ID","ERROR",MessageBoxButtons.OK); + } + + string stringval = value.ToString(); + + while (stringval.Length < 8) + { + stringval = "0" + stringval; + } + + // return dataSet + return stringval; } catch (Exception ex) { diff --git a/FWA_MAIN/bin/FWA_MAIN.dll b/FWA_MAIN/bin/FWA_MAIN.dll index b7ddfb4..54adca1 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 ff34a1d..23f316c 100644 Binary files a/FWA_MAIN/bin/FWA_MAIN.pdb and b/FWA_MAIN/bin/FWA_MAIN.pdb differ diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache index 406c024..187d440 100644 Binary files a/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache and b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.AssemblyReference.cache differ diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache index fb81b31..d8b3066 100644 --- a/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache +++ b/FWA_MAIN/obj/Debug/FWA_MAIN.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -70b4448723339e99ed60f3c81dc6a5d1da61b1ddf61a97f8541739006170aed6 +5b828ddd595982ac7c99d94544530dbfda605a4e26706582ffd171296255f6b4 diff --git a/FWA_MAIN/obj/Debug/FWA_MAIN.dll b/FWA_MAIN/obj/Debug/FWA_MAIN.dll index b7ddfb4..54adca1 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 ff34a1d..23f316c 100644 Binary files a/FWA_MAIN/obj/Debug/FWA_MAIN.pdb and b/FWA_MAIN/obj/Debug/FWA_MAIN.pdb differ diff --git a/FWA_MAIN/physEdit.aspx b/FWA_MAIN/physEdit.aspx index 39107a3..0f8c04d 100644 --- a/FWA_MAIN/physEdit.aspx +++ b/FWA_MAIN/physEdit.aspx @@ -1,6 +1,18 @@ <%@ Page Title="Title" Language="C#" MasterPageFile="main.master" CodeBehind="physEdit.aspx.cs" Inherits="FWA_MAIN.physEdit" %> + + + @@ -51,7 +63,8 @@
-
-
+
+
-
\ No newline at end of file + + diff --git a/FWA_MAIN/physEdit.aspx.cs b/FWA_MAIN/physEdit.aspx.cs index d75e0d8..920d546 100644 --- a/FWA_MAIN/physEdit.aspx.cs +++ b/FWA_MAIN/physEdit.aspx.cs @@ -1,18 +1,74 @@ using System; using System.Web.UI; +using System.Data; namespace FWA_MAIN { public partial class physEdit : Page { + + protected string physID; protected void Page_Load(object sender, EventArgs e) { txtPhysID.Enabled = false; + physID = Crypt.Decrypt(Request.QueryString["ID"]); + + if (!IsPostBack) + { + + FillPhysician(physID); + } + + } + + + protected void FillPhysician(string id) + { + + var ds = new DataSet(); + ds = PharmacyDataTier.PhysicianInfoSearch(physID); + + txtPhysID.Text = ds.Tables[0].Rows[0]["Physician_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(); + txtZip.Text = ds.Tables[0].Rows[0]["Zip"].ToString(); + txtCity.Text = ds.Tables[0].Rows[0]["City"].ToString(); + txtState.Text = ds.Tables[0].Rows[0]["UsState"].ToString(); + DateTime date = DateTime.Parse(ds.Tables[0].Rows[0]["DOB"].ToString()); + txtDOB.Text = date.ToString("d"); + txtPhone.Text = ds.Tables[0].Rows[0]["PhoneNumber"].ToString(); + txtGender.Text = ds.Tables[0].Rows[0]["Gender"].ToString(); + txtSpecialty.Text = ds.Tables[0].Rows[0]["Specialty"].ToString(); + + } - protected void btnCancelPat_OnClick(object sender, EventArgs e) + + protected void btnCancelPhys_OnClick(object sender, EventArgs e) { - throw new NotImplementedException(); + Response.Redirect("physician.aspx"); } + + protected void btnSavePhys_OnClick(object sender, EventArgs e) + { + + string id = Val.varchar(txtPhysID, 8); + string FNAME = Val.varchar(txtFNAME, 30); + string LNAME = Val.varchar(txtLNAME, 30); + string MidInit = Val.varchar(txtMidInit, 1); + short zip = Val.SmallIntType(txtZip); + string city = Val.varchar(txtCity, 30); + string state = Val.varchar(txtState, 2); + DateTime date = Val.Date(txtDOB); + string phone = Val.varchar(txtPhone, 14); + string gender = Val.varchar(txtGender, 1); + string specialty = Val.varchar(txtSpecialty, 100); + + PharmacyDataTier.UpdatePhysician(id,FNAME,LNAME,MidInit,date,gender,city,zip,state,phone,specialty); + + Response.Redirect("physician.aspx"); + } + } } \ No newline at end of file diff --git a/FWA_MAIN/physEdit.aspx.designer.cs b/FWA_MAIN/physEdit.aspx.designer.cs new file mode 100644 index 0000000..20d738d --- /dev/null +++ b/FWA_MAIN/physEdit.aspx.designer.cs @@ -0,0 +1,148 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FWA_MAIN +{ + + + public partial class physEdit + { + + /// + /// 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; + + /// + /// txtFNAME control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFNAME; + + /// + /// txtLNAME control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtLNAME; + + /// + /// txtMidInit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMidInit; + + /// + /// txtZip control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtZip; + + /// + /// txtCity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCity; + + /// + /// txtState control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtState; + + /// + /// txtDOB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDOB; + + /// + /// txtPhone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPhone; + + /// + /// txtGender control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGender; + + /// + /// txtSpecialty control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSpecialty; + + /// + /// btnSavePhys control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSavePhys; + + /// + /// btnCancelPhys control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelPhys; + + /// + /// Master property. + /// + /// + /// Auto-generated property. + /// + public new FWA_MAIN.main Master + { + get + { + return ((FWA_MAIN.main)(base.Master)); + } + } + } +} diff --git a/FWA_MAIN/physician.aspx b/FWA_MAIN/physician.aspx index d2ed25b..047cf2d 100644 --- a/FWA_MAIN/physician.aspx +++ b/FWA_MAIN/physician.aspx @@ -1,9 +1,8 @@ -<%@ Page Title="Physicians" Language="C#" MasterPageFile="main.master" CodeBehind="physician.aspx.cs" Inherits="FWA_MAIN.physician" %> +<%@ Page Title="Physicians" EnableEventValidation="false" Language="C#" MasterPageFile="main.master" CodeBehind="physician.aspx.cs" Inherits="FWA_MAIN.physician" %> -

Physicians

@@ -18,7 +17,7 @@
- +

@@ -33,16 +32,70 @@
- +


- - + + +
+
+
+
- +
+ + + + + + + + + + + + + + +
+ + + + - +
\ No newline at end of file diff --git a/FWA_MAIN/physician.aspx.cs b/FWA_MAIN/physician.aspx.cs index fc73628..8bda197 100644 --- a/FWA_MAIN/physician.aspx.cs +++ b/FWA_MAIN/physician.aspx.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Web; using System.Web.UI; @@ -11,7 +12,200 @@ namespace FWA_MAIN { protected void Page_Load(object sender, EventArgs e) { + if (!IsPostBack) + { + + txtPhysID.Text = Convert.ToString(Session["vPhysPhysID"]); + txtFNAME.Text = Convert.ToString(Session["vPhysFNAME"]); + txtLNAME.Text = Convert.ToString(Session["vPhysLNAME"]); + + btnPhySearch_OnClick(sender,e); + } + } + + + private void BindData() + { + + DataSet ds = new DataSet(); + + string physID = Convert.ToString(Session["vPhysPhysID"]); + string LNAME = Convert.ToString(Session["vPhysLNAME"]); + string FNAME = Convert.ToString(Session["vPhysFNAME"]); + + txtPhysID.Text = physID; + txtFNAME.Text = FNAME; + txtLNAME.Text = LNAME; + + // if (textHasValues) + // { + ds = PharmacyDataTier.PhysicianInfoSearch(FNAME, LNAME, physID); + // } + + + // ds = dt.GetStudents(); + gvPhysician.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); + } + gvPhysician.DataBind(); + + } + + + + + protected void btnPhysDelete_OnClick(object sender, EventArgs e) + { + try + { + + PharmacyDataTier.DeletePhysician(gvPhysician.SelectedRow.Cells[0].Text); + BindData(); + } + catch (Exception exception) + { + + } + } + + protected void bntPhysEdit_OnClick(object sender, EventArgs e) + { + string physicianID = "0"; + Int64 mEditedRecord = 0; + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + + try + { + Session["vPhysPhysID"] = txtPhysID.Text.Trim(); + Session["vPhysFNAME"] = txtFNAME.Text.Trim(); + Session["vPhysLNAME"] = txtLNAME.Text.Trim(); + + + try + { + + physicianID = Crypt.Encrypt(gvPhysician.SelectedRow.Cells[0].Text); + Response.Redirect("physedit.aspx" + "?" + "ID=" + physicianID, false); + } + catch (Exception exception) + { + } + + // Use the patientID value as needed + + + + } + catch (Exception ex) + { + throw new Exception(ex.Message, ex.InnerException); + } + } + + protected void btnPhysNew_OnClick(object sender, EventArgs e) + { + string physicianID; + + try + { + Session["vPhysPhysID"] = txtPhysID.Text.Trim(); + Session["vPhysFNAME"] = txtFNAME.Text.Trim(); + Session["vPhysLNAME"] = txtLNAME.Text.Trim(); + + // Use the patientID value as needed + try + { + + physicianID = PharmacyDataTier.GetNextPhysicianID(); + physicianID = Crypt.Encrypt(physicianID); + Response.Redirect("physnew02.aspx" + "?" + "ID=" + physicianID, false); + } + catch (Exception exception) + { + } + } + catch (Exception exception) + { + + } + } + + protected void btnPhySearch_OnClick(object sender, EventArgs e) + { + if (txtPhysID.Text.Trim().Length > 0 || txtFNAME.Text.Trim().Length > 0 || txtLNAME.Text.Trim().Length > 0) + { + + + try + { + + Session["vPhysPhysID"] = txtPhysID.Text.Trim(); + Session["vPhysFNAME"] = txtFNAME.Text.Trim(); + Session["vPhysLNAME"] = txtLNAME.Text.Trim(); + + Cache.Remove("StudentData"); + BindData(); + + + + } + catch (Exception exception) + { + + + + } + + } + } + + + + + + protected void gvPhysician_OnRowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(gvPhysician, "Select$" + e.Row.RowIndex); + e.Row.ToolTip = "Click to select this row."; + } + } + + protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) + { + BindData(); + } + + protected void gvPhysician_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 (gvPhysician.SelectedIndex == index) + { + // Deselect the row + gvPhysician.SelectedIndex = -1; + } + else + { + // Select the row + gvPhysician.SelectedIndex = index; + } + + // Refresh the GridView to update the style + gvPhysician.DataBind(); + } } } } \ No newline at end of file diff --git a/FWA_MAIN/physician.aspx.designer.cs b/FWA_MAIN/physician.aspx.designer.cs index e3a2c10..b8e8c79 100644 --- a/FWA_MAIN/physician.aspx.designer.cs +++ b/FWA_MAIN/physician.aspx.designer.cs @@ -33,13 +33,13 @@ namespace FWA_MAIN protected global::System.Web.UI.WebControls.TextBox txtLNAME; /// - /// 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; /// /// btnPhySearch control. @@ -58,5 +58,46 @@ namespace FWA_MAIN /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.GridView gvPhysician; + + /// + /// btnPhysNew control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnPhysNew; + + /// + /// bntPhysEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button bntPhysEdit; + + /// + /// btnPhysDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnPhysDelete; + + /// + /// Master property. + /// + /// + /// Auto-generated property. + /// + public new FWA_MAIN.main Master + { + get + { + return ((FWA_MAIN.main)(base.Master)); + } + } } } diff --git a/FWA_MAIN/physnew02.aspx b/FWA_MAIN/physnew02.aspx new file mode 100644 index 0000000..6193b35 --- /dev/null +++ b/FWA_MAIN/physnew02.aspx @@ -0,0 +1,55 @@ +<%@ Page Title="Title" Language="C#" MasterPageFile="main.master" CodeBehind="physnew02.aspx.cs" Inherits="FWA_MAIN.physnew02" %> + + + + + + +

New Physician

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/FWA_MAIN/physnew02.aspx.cs b/FWA_MAIN/physnew02.aspx.cs new file mode 100644 index 0000000..74eb2b7 --- /dev/null +++ b/FWA_MAIN/physnew02.aspx.cs @@ -0,0 +1,48 @@ +using System; +using System.Web.UI; + +namespace FWA_MAIN +{ + public partial class physnew02 : Page + { + protected string physID; + + protected void Page_Load(object sender, EventArgs e) + { + + physID = Crypt.Decrypt(Request.QueryString["ID"]); + + txtPhysID.Enabled = false; + txtPhysID.Text = physID; + + } + + + + + protected void btnCancelPhys_OnClick(object sender, EventArgs e) + { + Response.Redirect("physician.aspx"); + } + + protected void btnSavePhys_OnClick(object sender, EventArgs e) + { + string id = Val.varchar(txtPhysID, 8); + string FNAME = Val.varchar(txtFNAME, 30); + string LNAME = Val.varchar(txtLNAME, 30); + string MidInit = Val.varchar(txtMidInit, 1); + Int16 zip = Val.SmallIntType(txtZip); + string city = Val.varchar(txtCity, 30); + string state = Val.varchar(txtState, 2); + DateTime date = Val.Date(txtDOB); + string phone = Val.varchar(txtPhone, 14); + string gender = Val.varchar(txtGender, 1); + string specialty = Val.varchar(txtSpecialty, 100); + + + PharmacyDataTier.CreatePhysician(id,FNAME,LNAME,MidInit,date,gender,city,zip,state,phone,specialty); + + Response.Redirect("physician.aspx"); + } + } +} \ No newline at end of file diff --git a/FWA_MAIN/physnew02.aspx.designer.cs b/FWA_MAIN/physnew02.aspx.designer.cs new file mode 100644 index 0000000..8743720 --- /dev/null +++ b/FWA_MAIN/physnew02.aspx.designer.cs @@ -0,0 +1,148 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FWA_MAIN +{ + + + public partial class physnew02 + { + + /// + /// 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; + + /// + /// txtFNAME control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFNAME; + + /// + /// txtLNAME control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtLNAME; + + /// + /// txtMidInit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMidInit; + + /// + /// txtZip control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtZip; + + /// + /// txtCity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCity; + + /// + /// txtState control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtState; + + /// + /// txtDOB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDOB; + + /// + /// txtPhone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPhone; + + /// + /// txtGender control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGender; + + /// + /// txtSpecialty control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSpecialty; + + /// + /// btnSavePhys control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSavePhys; + + /// + /// btnCancelPhys control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelPhys; + + /// + /// Master property. + /// + /// + /// Auto-generated property. + /// + public new FWA_MAIN.main Master + { + get + { + return ((FWA_MAIN.main)(base.Master)); + } + } + } +}