Пример #1
0
        private void BindData()
        {
            PatientDataTier aDatatier = new PatientDataTier();

            string date = Convert.ToString(Session["date"]);



            if ((date.Length > 0))
            {
                DataSet aDataset = new DataSet();
                aDataset = aDatatier.SHOWBYDATE(date);
                if (aDataset.Tables[0].Rows.Count > 0)
                {
                    grdViewRefills.Visible    = true;
                    grdViewRefills.DataSource = aDataset.Tables[0];


                    if (Cache["StudentData"] == null)
                    {
                        Cache.Add("StudentData", new DataView(aDataset.Tables[0]), null, System.Web.Caching.Cache.NoAbsoluteExpiration,
                                  System.TimeSpan.FromMinutes(10), System.Web.Caching.CacheItemPriority.Default, null);
                        grdViewRefills.DataBind();
                    }
                }
                else
                {
                    grdViewRefills.Visible = false;
                }
            }
            else
            {
                grdViewRefills.Visible = false;
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try {
                PatientDataTier patDT   = new PatientDataTier();
                DataSet         ds      = new DataSet();
                string          pat_ID  = txtStuID.Text;
                string          fname   = txtFName.Text;
                string          midinit = textMiddleInitial.Text;
                string          lname   = txtLName.Text;
                //decimal salary = decimal.Parse(txtSalary.Text);
                string gender      = ddlGender.SelectedValue.ToString();
                string pat_state   = ddlState.SelectedValue.ToString();
                string dob         = calendarDOB.SelectedDate.ToString();
                string pat_address = txtAddress.Text;
                string city        = txtCity.Text;
                string zip         = textZipCode.Text;
                string phone       = textPhone.Text;
                string email       = textEmail.Text;
                string insurance   = textInsurance.Text;



                patDT.addPatient(pat_ID, fname, midinit, lname, gender, pat_state, dob, pat_address, city, zip, phone, email, insurance); //add patient with args
                lblComplete.Text = "Patient Added!";
            }
            catch (Exception ex) {
                lblException.Text = ex.Message.ToString();
            }
        }
Пример #3
0
 public void Delete_Click(object sender, CommandEventArgs e)
 {
     try
     {
         CheckBox        chk   = new CheckBox();
         Label           lbl   = new Label();
         string          patID = "";
         PatientDataTier ptd   = new PatientDataTier();
         Cache.Remove("StudentData");
         if (grdStudent.Rows.Count > 0)
         {
             foreach (GridViewRow row in grdStudent.Rows)
             {
                 chk = (CheckBox)row.FindControl("chkStudentID");
                 if (chk.Checked)
                 {
                     lbl   = (Label)row.Controls[0].FindControl("hidStudentID");
                     patID = lbl.Text.Trim();
                     ptd.deletePatients(patID);
                 }
             }
             BindData();
         }
     }
     catch (Exception ex)
     {
         lblException.Text = ex.Message.ToString();
     }
 }
Пример #4
0
        protected void btnAddPrescription_Click(object sender, EventArgs e)
        {
            try {
                PatientDataTier patDT        = new PatientDataTier();
                DataSet         ds           = new DataSet();
                string          patid        = txtPATID.Text;
                string          phyid        = txtPHYID.Text;
                string          rxnumber     = txtRXNUMBER.Text;
                string          dosage       = txtDOSAGE.Text;
                string          frequency    = txtFrequency.Text;
                string          intakemethod = txtIntakeMethod.Text;


                //ds = patDT.QUERYPHYSICIAN(phyid);

                //if (ds !=null)
                //{
                patDT.ADDPRESCRIPTION(patid, phyid, rxnumber, dosage, frequency, intakemethod);
                lblPrescriptionAdded.Text = "Prescription Added!";
                //}
                //else
                //{
                //MessageBox.Show("Please use a valid Physician ID");
                //}
            }
            catch (Exception ex) {
                lblException.Text = ex.Message.ToString();
            }
        }
Пример #5
0
        protected void btnClose_Click(object sender, EventArgs e)
        {
            PatientDataTier patDT   = new PatientDataTier();
            DataSet         ds      = new DataSet();
            string          pat_ID  = txtStuID.Text;
            string          fname   = txtFName.Text;
            string          midinit = textMiddleInitial.Text;
            string          lname   = txtLName.Text;
            //decimal salary = decimal.Parse(txtSalary.Text);
            string gender      = ddlGender.Text;
            string pat_state   = ddlState.Text;
            string dob         = (DateTime.Parse(txtDOB.Text.ToString())).ToShortDateString();
            string pat_address = txtAddress.Text;
            string city        = txtCity.Text;
            string zip         = textZipCode.Text;
            string phone       = textPhone.Text;
            string email       = textEmail.Text;
            string insurance   = textInsurance.Text;



            try
            {
                if (btnClose.Text.ToUpper() == "REFRESH")
                {
                    patDT.SHOWALLBYPATID(pat_ID); //add patient with args
                    //Session["GRIDREFRESH"] = "REFRESHDGRID";
                    //System.Text.StringBuilder cb = new System.Text.StringBuilder();
                    //cb.Append(" opener.location.href = 'Table.aspx';");
                    //cb.Append("var ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;");
                    //cb.Append(" if (ie7)");
                    //cb.Append(" { ");
                    //cb.Append("window.open('','_parent','');");
                    //cb.Append("window.close();");
                    //cb.Append(" } ");
                    //cb.Append(" else ");
                    //cb.Append(" { ");
                    //cb.Append(" this.focus();");
                    //cb.Append(" self.opener = this;");
                    //cb.Append(" self.close();");
                    //cb.Append(" } ");
                    //ClientScript.RegisterClientScriptBlock(this.GetType(), "CloseReloadScript", cb.ToString(), true);
                }
                else //if (btnClose.Text.ToUpper() == "CLOSE")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "closeform", "CloseMe()", true);
                }
            }
            catch (Exception ex)
            {
                lblException.Text = ex.Message.ToString();
            }
        }
Пример #6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try {
                PatientDataTier dateDT      = new PatientDataTier();
                DataSet         ds          = new DataSet();
                string          rx_number   = txtRXNumber.Text;
                string          date_refill = txtDateRefill.Text;
                string          amount      = textAmount.Text;


                dateDT.UPDATERefill(rx_number, date_refill, amount);
            }
            catch (Exception ex)
            {
                lblException.Text = ex.Message.ToString();
            }
        }
Пример #7
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try {
                PatientDataTier patDT       = new PatientDataTier();
                DataSet         ds          = new DataSet();
                string          rx_number   = txtRX_NUMBER.Text;
                string          date_refill = txtDATE_REFILL.Text;
                string          amount      = txtAMOUNT.Text;



                patDT.ADDREFILL(rx_number, date_refill, amount);
                lblAdded.Text = "Refill Added!";
            }
            catch (Exception ex) {
                lblException.Text = ex.Message.ToString();
            }
        }
Пример #8
0
        protected void Delete_Click(object sender, CommandEventArgs e)
        {
            try
            {
                string date = "";
                date = (e.CommandArgument.ToString().Trim());
                PatientDataTier ptd = new PatientDataTier();
                Cache.Remove("StudentData");

                ptd.deleteRefill(date);
            }
            catch (Exception ex)
            {
                lblException.Text = ex.Message.ToString();
            }
            finally
            {
                Response.Redirect("Refills.aspx", true);
            }
        }
Пример #9
0
        public void BindData(string rx_number, string type)
        {
            PatientDataTier patRX = new PatientDataTier();

            //string myID = Convert.ToString(Session["vPATID"]);
            DataSet aDataset = new DataSet();

            aDataset = patRX.VIEWREFILLSBYPATID(rx_number);



            if (aDataset.Tables[0].Rows.Count > 0)
            {
                grdViewRefills.Visible    = true;
                grdViewRefills.DataSource = aDataset.Tables[0];
                grdViewRefills.DataBind();
            }
            else
            {
                grdViewRefills.Visible = false;
            }
        }
Пример #10
0
        private void BindData()
        {
            PatientDataTier aDatatier = new PatientDataTier();

            string myID  = Convert.ToString(Session["vPatID"]);
            string fname = Convert.ToString(Session["vFName"]);
            string lname = Convert.ToString(Session["vLName"]);

            txtPatientID.Text = myID;
            txtFName.Text     = fname;
            txtLName.Text     = lname;

            if ((myID.Length > 0) || (fname.Length > 0) || (lname.Length > 0))
            {
                DataSet aDataset = new DataSet();
                aDataset = aDatatier.GetPatients(myID, fname, lname);
                if (aDataset.Tables[0].Rows.Count > 0)
                {
                    grdStudent.Visible    = true;
                    grdStudent.DataSource = aDataset.Tables[0];


                    if (Cache["StudentData"] == null)
                    {
                        Cache.Add("StudentData", new DataView(aDataset.Tables[0]), null, System.Web.Caching.Cache.NoAbsoluteExpiration,
                                  System.TimeSpan.FromMinutes(10), System.Web.Caching.CacheItemPriority.Default, null);
                        grdStudent.DataBind();
                    }
                }
                else
                {
                    grdStudent.Visible = false;
                }
            }
            else
            {
                grdStudent.Visible = false;
            }
        }
Пример #11
0
        public void BindData(string pat_ID, string type)
        {
            PatientDataTier patDT = new PatientDataTier();

            //string myID = Convert.ToString(Session["vPATID"]);
            DataSet aDataset = new DataSet();

            aDataset = patDT.SHOWREFILLSBYPATID(pat_ID);



            if (aDataset.Tables[0].Rows.Count > 0)
            {
                grdRefills.Visible    = true;
                grdRefills.DataSource = aDataset.Tables[0];
                grdRefills.DataBind();
            }
            else
            {
                grdRefills.Visible = false;
            }
        }
Пример #12
0
        public void GetRefill(string date_refill, string type)
        {
            PatientDataTier phyDT = new PatientDataTier();
            DataSet         ds    = new DataSet();
            string          gender;

            //Home record = new Home();
            //DataSet recordTBE = new DataSet();
            //string recordToBeEdited = recordToBeEdited;

            //record.decryptQueryString(recordToBeEdited.ToString());

            ds = phyDT.SHOWBYDATE(date_refill);

            if (ds.Tables[0].Rows.Count > 0)
            {
                txtRXNumber.Text   = ds.Tables[0].Rows[0]["rx_number"].ToString();
                txtDateRefill.Text = ds.Tables[0].Rows[0]["date_refill"].ToString();
                textAmount.Text    = ds.Tables[0].Rows[0]["amount"].ToString();



                if (type.ToUpper() == "EDIT")
                {
                    txtRXNumber.Enabled   = false;
                    txtDateRefill.Enabled = true;
                    textAmount.Enabled    = true;


                    btnSave.Visible    = true;
                    btnClose.Visible   = true;
                    btnSave.Text       = "UPDATE";
                    btnClose.Text      = "REFRESH";
                    btnSave.ForeColor  = Color.Red;
                    btnClose.ForeColor = Color.Blue;
                }
            }
        }
Пример #13
0
        public void GetPatient(string pat_ID, string type)
        {
            PatientDataTier patDT = new PatientDataTier();
            DataSet         ds    = new DataSet();
            string          gender;

            //Home record = new Home();
            //DataSet recordTBE = new DataSet();
            //string recordToBeEdited = recordToBeEdited;

            //record.decryptQueryString(recordToBeEdited.ToString());

            ds = patDT.SHOWALLBYPATID(pat_ID);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DateTime dateConvert = DateTime.Parse(ds.Tables[0].Rows[0]["dob"].ToString());

                txtStuID.Text = ds.Tables[0].Rows[0]["pat_ID"].ToString();
                txtFName.Text = ds.Tables[0].Rows[0]["fname"].ToString();
                txtLName.Text = ds.Tables[0].Rows[0]["lname"].ToString();
                txtDOB.Text   = dateConvert.ToShortDateString().ToString();
                //txtSalary.Text = ds.Tables[0].Rows[0]["salary"].ToString();
                txtAddress.Text        = ds.Tables[0].Rows[0]["pat_address"].ToString();
                txtCity.Text           = ds.Tables[0].Rows[0]["city"].ToString();
                textMiddleInitial.Text = ds.Tables[0].Rows[0]["midint"].ToString();
                textZipCode.Text       = ds.Tables[0].Rows[0]["zip"].ToString();
                textInsurance.Text     = ds.Tables[0].Rows[0]["insurance"].ToString();
                textEmail.Text         = ds.Tables[0].Rows[0]["email"].ToString();
                textPhone.Text         = ds.Tables[0].Rows[0]["phone"].ToString();


                gender = ds.Tables[0].Rows[0]["gender"].ToString().Trim();
                if (gender.ToUpper() == "FEMALE")
                {
                    ddlGender.SelectedItem.Text = "Female";
                }
                else
                {
                    ddlGender.SelectedItem.Text = "Male";
                }
                //ddlGender.Enabled = false;
                ddlState.DataSource     = StateManager.getStates();
                ddlState.DataTextField  = "FullAndAbbrev";
                ddlState.DataValueField = "Abbreviation";
                ddlState.SelectedValue  = "PA";
                ddlState.DataBind();

                ddlState.SelectedValue = ds.Tables[0].Rows[0]["pat_state"].ToString();
                if (type.ToUpper() == "VIEW")
                {
                    txtStuID.Enabled          = false;
                    txtFName.Enabled          = false;
                    txtLName.Enabled          = false;
                    txtDOB.Enabled            = false;
                    txtAddress.Enabled        = false;
                    txtCity.Enabled           = false;
                    textEmail.Enabled         = false;
                    textInsurance.Enabled     = false;
                    textMiddleInitial.Enabled = false;
                    textPhone.Enabled         = false;
                    textZipCode.Enabled       = false;
                    //txtSalary.Enabled = false;
                    ddlGender.Enabled = false;
                    ddlState.Enabled  = false;
                    btnSave.Visible   = false;
                    btnClose.Visible  = false;
                }
                else if (type.ToUpper() == "EDIT")
                {
                    txtStuID.Enabled   = false;
                    txtFName.Enabled   = true;
                    txtLName.Enabled   = true;
                    txtDOB.Enabled     = true;
                    txtAddress.Enabled = true;
                    txtCity.Enabled    = true;
                    // txtSalary.Enabled = true;
                    ddlGender.Enabled  = false;
                    ddlState.Enabled   = true;
                    btnSave.Visible    = true;
                    btnClose.Visible   = true;
                    btnSave.Text       = "UPDATE";
                    btnClose.Text      = "REFRESH";
                    btnSave.ForeColor  = Color.Red;
                    btnClose.ForeColor = Color.Blue;
                }
            }
        }