Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            chkHippa.Attributes.Add("onclick", "document.getElementById('" + txtHippaDate.ClientID + "').disabled=!this.checked;");

            if (Session["User"] == null || Session["Role"] == null)
                Response.Redirect("../Login.aspx");

            if ((string)Session["Role"] == "A")
            {
                ddlPatStatus.Enabled = true;
            }
            else
            {
                ddlPatStatus.Enabled = false;
            }
            RenderJSArrayWithCliendIds(txtMRN, txtSSN, txtDOB, txtDoctor, txtClinicFacility, txtPatientFName, txtPatientLName, txtAllergyTo, txtAllergyDesc, txtInsName,txtInsPhone, txtPID, txtGNO, txtBNO, txtIName, txtIDOB, txtISSN, txtIRel, rbtnIActive);
            if (!Page.IsPostBack)
            {
                setcontextkey();
                ddlPrimInsurance.Items.Insert(0, new ListItem("--Select--", "0"));

                ddlPrimInsurance.SelectedIndex = 0;
                if (Request.QueryString["patID"] != null)
                {
                    PatientInfoDAL Pat_Info = new PatientInfoDAL();

                    ddlPrimInsurance.DataSource = Pat_Info.get_PatInsNames(Request.QueryString["patID"].ToString());
                    ddlPrimInsurance.DataTextField = "Ins_Name";
                    ddlPrimInsurance.DataValueField = "Patient_Ins_ID";
                    ddlPrimInsurance.DataBind();
                    Filldata();
                    btnSave.Visible = false;
                    btnUpdate.Visible = true;
                    btnCancel.Visible = true;
                }
                if (Request.QueryString["patname"] != null)
                {
                    string[] patname = Request.QueryString["patname"].Split(',');
                    if (patname.Length == 2)
                    {
                        txtPatientLName.Text = patname[0];
                        txtPatientFName.Text = patname[1];
                    }
                    else
                    {
                        txtPatientLName.Text = patname[0];
                    }
                    btnSave.Visible = true;
                    btnUpdate.Visible = false;
                    btnCancel.Visible = true;
                }

                txtPatientFName.Focus();
                if (chkHippa.Checked == false)
                    txtHippaDate.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            objNLog.Error("Error :" + ex.Message);
        }
    }