Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["id"] != null)
            {
                string id = Request.QueryString["id"];
                BindGroupDetails(id);
                DataSet ds = db.selectData("select page_id from tblGroups  where id=" + Request["id"].ToString());

                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    string pages = ds.Tables[0].Rows[0][0].ToString();

                    for (int i = 0; i < chkPages.Items.Count; i++)
                    {
                        if (pages.ToString().Contains(chkPages.Items[i].Value))
                        {
                            chkPages.Items[i].Selected = true;
                        }
                    }
                }
            }

            GetLocations();
            GetReports();
            GetRole();
        }
    }
    protected void bind()
    {
        Session["MCODE"] = Request.QueryString["MCODE"].ToString();
        Session["pid"]   = Request.QueryString["id"].ToString();
        string pid = "'" + Session["pid"].ToString() + "'";

        DataSet ds  = new DataSet();
        DataSet ds2 = new DataSet();

        ds = db.selectData("select * from tblProceduresDetail where ProcedureDetail_ID = " + pid);
        if (ds.Tables[0].Rows.Count > 0)
        {
            Session["PatientIE_ID"] = ds.Tables[0].Rows[0]["PatientIE_ID"].ToString();
            Session["BodyPart"]     = ds.Tables[0].Rows[0]["BodyPart"].ToString();
            if (ds.Tables[0].Rows[0]["MCODE"].ToString() == null)
            {
                txtmcode.Text = string.Empty;
            }
            else
            {
                txtmcode.Text = ds.Tables[0].Rows[0]["MCODE"].ToString();
            }
            if (ds.Tables[0].Rows[0]["Requested"].ToString() == string.Empty)
            {
                txtDate1.Text = string.Empty;
            }
            else
            {
                txtDate1.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["Requested"].ToString()).ToString("MM/dd/yyyy");
            }

            if (ds.Tables[0].Rows[0]["Scheduled"].ToString() == string.Empty)
            {
                txtDate2.Text = string.Empty;
            }
            else
            {
                txtDate2.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["Scheduled"].ToString()).ToString("MM/dd/yyyy");
            }
            if (ds.Tables[0].Rows[0]["Executed"].ToString() == string.Empty)
            {
                txtDate3.Text = string.Empty;
            }
            else
            {
                txtDate3.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["Executed"].ToString()).ToString("MM/dd/yyyy");
            }
        }
        else
        {
            ds2 = db.selectData("select * from tblProcedures where MCODE='" + Session["MCODE"].ToString() + "'");
            Session["PatientIE_ID"] = Session["pid"].ToString();
            Session["pid"]          = ds2.Tables[0].Rows[0]["Procedure_ID"].ToString();
            Session["BodyPart"]     = ds2.Tables[0].Rows[0]["BodyPart"].ToString();
            txtmcode.Text           = Session["MCODE"].ToString();
            txtDate1.Text           = string.Empty;
            txtDate2.Text           = string.Empty;
            txtDate3.Text           = string.Empty;
        }
    }
    private void getData()
    {
        try
        {
            if (ViewState["pid"] != null)
            {
                string query = "";

                if (this.checkMutipleIE(ViewState["pid"].ToString()))
                {
                    query = ("select * from tblPatientDocument where PatientID= " + ViewState["pid"] + " AND DOA between'" + ViewState["doa"] + "' and '" + ViewState["doa"] + "'");
                }
                else
                {
                    query = "select * from tblPatientDocument where PatientID=" + ViewState["pid"];
                }

                DataSet ds = db.selectData(query);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    gvDocument.DataSource = ds;
                    gvDocument.DataBind();
                }
                else
                {
                    gvDocument.DataSource = null;
                    gvDocument.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 4
0
    private void bindgridPoup()
    {
        try
        {
            string    _CurBodyPart = _CurBP;
            string    _SKey        = "WHERE tblDiagCodes.Description LIKE '%" + txDesc.Text.Trim() + "%' AND BodyPart LIKE '%" + _CurBodyPart + "%'";
            DataSet   ds           = new DataSet();
            DataTable Standards    = new DataTable();
            string    SqlStr       = "";
            if (_CurIEid != "")
            {
                SqlStr = "Select tblDiagCodes.*, dbo.DIAGEXISTS(" + _CurIEid + ", DiagCode_ID, '%" + _CurBodyPart + "%') as IsChkd FROM tblDiagCodes " + _SKey + " Order By BodyPart, Description";
            }
            else
            {
                SqlStr = "Select tblDiagCodes.*, dbo.DIAGEXISTS('0', DiagCode_ID, '%" + _CurBodyPart + "%') as IsChkd FROM tblDiagCodes " + _SKey + " Order By BodyPart, Description";
            }
            ds = gDbhelperobj.selectData(SqlStr);

            dgvDiagCodesPopup.DataSource = ds;
            dgvDiagCodesPopup.DataBind();
        }
        catch (Exception ex)
        {
            log.Error(ex.Message);
        }
    }
Exemplo n.º 5
0
    public void GetDesignations()
    {
        try
        {
            DataSet ds = db.selectData("select * from tbl_designation");

            ddlDesig.DataSource = ds;
            ddlDesig.DataBind();
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 6
0
    private void bindLocation()
    {
        DataSet ds = new DataSet();

        ds = db.selectData("select Location,Location_ID from tblLocations Order By Location");
        if (ds.Tables[0].Rows.Count > 0)
        {
            ddl_location.DataValueField = "Location_ID";
            ddl_location.DataTextField  = "Location";
            ddl_location.DataSource     = ds;
            ddl_location.DataBind();
            ddl_location.Items.Add(new System.Web.UI.WebControls.ListItem("ALL", "ALL"));
            ddl_location.SelectedValue = "ALL";
        }
    }
Exemplo n.º 7
0
    private void bindgrid()
    {
        try
        {
            DataSet   ds        = new DataSet();
            DataTable Standards = new DataTable();
            string    SqlStr    = "";
            if (_CurIEid != "")
            {
                SqlStr = "Select tblDiagCodes.*, dbo.DIAGEXISTS(" + _CurIEid + ", DiagCode_ID, '%" + _CurBodyPart + "%') as IsChkd FROM tblDiagCodes " + _SKey + " Order By BodyPart, Description";
            }
            else
            {
                SqlStr = "Select tblDiagCodes.*, dbo.DIAGEXISTS('0', DiagCode_ID, '%" + _CurBodyPart + "%') as IsChkd FROM tblDiagCodes " + _SKey + " Order By BodyPart, Description";
            }
            ds = db.selectData(SqlStr);

            dgvDiagCodes.DataSource = ds;
            dgvDiagCodes.DataBind();
        }
        catch (Exception ex)
        {
            log.Error(ex.Message);
        }
    }
Exemplo n.º 8
0
    private void bindEditData(string PatientIEid)
    {
        try
        {
            Session["PatientIE_ID"] = PatientIEid;
            string query = "select * from View_PatientIE where PatientIE_ID=" + PatientIEid;

            DataSet ds = db.selectData(query);
            if (ds.Tables[0].Rows.Count > 0)
            {
                txt_fname.Text  = ds.Tables[0].Rows[0]["FirstName"].ToString();
                txt_fname2.Text = ds.Tables[0].Rows[0]["FirstName"].ToString();
                txt_lname.Text  = ds.Tables[0].Rows[0]["LastName"].ToString();
                txt_lname2.Text = ds.Tables[0].Rows[0]["LastName"].ToString();
                txt_SSN.Text    = ds.Tables[0].Rows[0]["SSN"].ToString();
                ddl_gender.ClearSelection();
                ddl_gender.Items.FindByValue(ds.Tables[0].Rows[0]["Sex"].ToString()).Selected = true;
                txt_add.Text    = ds.Tables[0].Rows[0]["Address1"].ToString();
                txt_mobile.Text = ds.Tables[0].Rows[0]["Phone2"].ToString();
                if (ds.Tables[0].Rows[0]["DOB"] != DBNull.Value)
                {
                    DateTime dob = Convert.ToDateTime(ds.Tables[0].Rows[0]["DOB"].ToString());
                    txt_DOB.Text = dob.ToString("dd/MM/yyyy");
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 9
0
    private void bindLocation()
    {
        DataSet       ds = new DataSet();
        DBHelperClass db = new DBHelperClass();

        string query = "select Location,Location_ID from tblLocations ";

        if (!string.IsNullOrEmpty(Session["Locations"].ToString()))
        {
            query = query + " where Location_ID in (" + Session["Locations"] + ")";
        }
        query = query + " Order By Location";

        ds = db.selectData(query);
        if (ds.Tables[0].Rows.Count > 0)
        {
            ddl_location.DataValueField = "Location_ID";
            ddl_location.DataTextField  = "Location";

            ddl_location.DataSource = ds;
            ddl_location.DataBind();

            ddl_location.Items.Insert(0, new ListItem("-- All --", "0"));
        }
    }
Exemplo n.º 10
0
    private void bindLocation()
    {
        DataSet ds = new DataSet();


        ds = db.selectData("select Location,Location_ID from tblLocations Order By Location");
        if (ds.Tables[0].Rows.Count > 0)
        {
            ddl_location.DataValueField = "Location_ID";
            ddl_location.DataTextField  = "Location";

            ddl_location.DataSource = ds;
            ddl_location.DataBind();

            ddl_location.Items.Insert(0, new ListItem("-- Location --", "0"));

            DataSet locds = new DataSet();
            locds.ReadXml(Server.MapPath("~/LocationXML.xml"));

            //if (locds.Tables[0].Rows[0][0].ToString() == System.DateTime.Now.ToString("MM-dd-yyyy"))
            //{
            ddl_location.ClearSelection();
            ddl_location.Items.FindByValue(locds.Tables[0].Rows[0][1].ToString()).Selected = true;
            //}
        }
    }
Exemplo n.º 11
0
    public static string[] getFirstName(string prefix)
    {
        DBHelperClass db      = new DBHelperClass();
        List <string> patient = new List <string>();

        if (prefix.IndexOf("'") > 0)
        {
            prefix = prefix.Replace("'", "''");
        }

        DataSet ds = db.selectData("select Patient_ID, LastName, FirstName from tblPatientMaster where FirstName like '%" + prefix + "%' OR LastName Like '%" + prefix + "%'");

        if (ds.Tables[0].Rows.Count > 0)
        {
            string name = "";
            for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
            {
                name = ds.Tables[0].Rows[i]["LastName"].ToString();
                patient.Add(string.Format("{0}-{1}", name, ds.Tables[0].Rows[i]["Patient_ID"].ToString()));
            }
            name = "";
            for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
            {
                name = ds.Tables[0].Rows[i]["FirstName"].ToString();
                patient.Add(string.Format("{0}-{1}", name, ds.Tables[0].Rows[i]["Patient_ID"].ToString()));
            }
        }

        return(patient.ToArray());
    }
Exemplo n.º 12
0
 private void bindEditData()
 {
     try
     {
         string  query = "select PatientIE_ID,FirstName,LastName,Compensation,InsCo,Adjuster,WCBGroup,ClaimNumber,policy_no,DOA,DOB from View_PatientIE";
         DataSet ds    = db.selectData(query);
         ViewState["DataTable"] = ds.Tables[0];
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 13
0
    protected void btnPreview_Click(object sender, EventArgs e)
    {
        DBHelperClass db    = new DBHelperClass();
        Button        btn   = sender as Button;
        string        query = "select * from tblPatientDocument where Document_ID=" + btn.CommandArgument;
        DataSet       ds    = db.selectData(query);

        string path = @"https://docs.google.com/viewer?url=#url&embedded=true";
        string url  = "http://aeiuat.dynns.com:82/V3_Test" + ds.Tables[0].Rows[0]["path"].ToString().Replace("~", "");

        path = path.Replace("#url", url);
        //iframeDocument.Src = path;

        // iframeDocument.Src = @"https://docs.google.com/viewer?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true";

        // ClientScript.RegisterStartupScript(this.GetType(), "Popup", "openPopup();", true);
    }
Exemplo n.º 14
0
    private void bindgrid()
    {
        DataSet   ds        = new DataSet();
        DataTable Standards = new DataTable();
        string    SqlStr    = "";

        if (!string.IsNullOrEmpty(_CurIEid))
        {
            SqlStr = "Select tblMedicines.*, dbo.MEDEXISTS(" + _CurIEid + ", Medicine_ID) as IsChkd FROM tblMedicines " + _SKey + " Order By Medicine";
        }
        else
        {
            SqlStr = "Select tblMedicines.*, dbo.MEDEXISTS('0', Medicine_ID) as IsChkd FROM tblMedicines " + _SKey + " Order By Medicine";
        }
        ds = db.selectData(SqlStr);
        dgvMedi.DataSource = ds;
        dgvMedi.DataBind();
    }
Exemplo n.º 15
0
 private void getData()
 {
     try
     {
         if (Session["PatientId"] != null)
         {
             string  query = ("select * from tblPatientDocument where PatientID= " + ViewState["pid"] + "");
             DataSet ds    = db.selectData(query);
             if (ds != null && ds.Tables[0].Rows.Count > 0)
             {
                 gvDocument.DataSource = ds;
                 gvDocument.DataBind();
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 16
0
    private void bindEditData(string PatientIEid)
    {
        try
        {
            Session["PatientIE_ID"] = PatientIEid;
            string query = "select * from View_PatientIE where PatientIE_ID=" + PatientIEid;

            DataSet ds = db.selectData(query);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Session["fname"] = ds.Tables[0].Rows[0]["FirstName"].ToString();
                Session["lname"] = ds.Tables[0].Rows[0]["LastName"].ToString();
                Session["DOA"]   = ds.Tables[0].Rows[0]["DOA"].ToString();
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 17
0
    private void bindgrid()
    {
        DataSet   ds        = new DataSet();
        DataTable Standards = new DataTable();
        string    SqlStr    = "";

        if (!string.IsNullOrEmpty(_CurIEid))
        {
            SqlStr = "Select tblMacrosMaster.*, dbo.STDEXISTS(" + _CurIEid + ", Macro_ID, '%" + _CurBodyPart + "%') as IsChkd FROM tblMacrosMaster " + _SKey + " Order By BodayParts,Heading";
        }
        else
        {
            SqlStr = "Select tblMacrosMaster.*, dbo.STDEXISTS('0', Macro_ID, '%" + _CurBodyPart + "%') as IsChkd FROM tblMacrosMaster " + _SKey + " Order By BodayParts,Heading";
        }

        ds = db.selectData(SqlStr);

        dgvStandards.DataSource = ds;
        dgvStandards.DataBind();
    }
Exemplo n.º 18
0
    protected void bindLocation()
    {
        //BusinessLogic _bl = new BusinessLogic();
        //ddLocation.Items.Clear();
        //ddLocation.Items.Add(new ListItem("Please Select", "Please Select"));
        //foreach (string[] _location in _bl.getLocations())
        //{
        //    ddLocation.Items.Add(new ListItem(_location[1], _location[0]));
        //}

        DataSet ds = new DataSet();

        string query = "select Location,Location_ID from tblLocations where Is_Active='True' ";

        if (Request["id"] == null && !string.IsNullOrEmpty(Session["Locations"].ToString()))
        {
            query = query + " and Location_ID in (" + Session["Locations"] + ")";
        }
        query = query + " Order By Location";

        ds = db.selectData(query);

        if (ds.Tables[0].Rows.Count > 0)
        {
            ddLocation.DataValueField = "Location_ID";
            ddLocation.DataTextField  = "Location";

            ddLocation.DataSource = ds;
            ddLocation.DataBind();

            ddLocation.Items.Insert(0, new ListItem("Please Select", "0"));
        }

        if (ddLocation.Items.Count.Equals(2))
        {
            ddLocation.SelectedIndex = 1;
        }
    }
Exemplo n.º 19
0
    private bool checkName(string fname, string pid)
    {
        bool _flag = true;

        try
        {
            DataSet dt = db.selectData("Select * from tblPatientDocument where DocName='" + fname + "' and PatientID=" + pid);

            if (dt != null && dt.Tables[0].Rows.Count > 0)
            {
                _flag = true;
            }
            else
            {
                _flag = false;
            }
        }
        catch (Exception ex)
        {
            _flag = true;
        }
        return(_flag);
    }
Exemplo n.º 20
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (chkRememberMe.Checked)
        {
            Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(30);
            Response.Cookies["Password"].Expires = DateTime.Now.AddDays(30);
        }
        else
        {
            Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(-1);
            Response.Cookies["Password"].Expires = DateTime.Now.AddDays(-1);
        }

        //string query = "select Password from tblUserMaster where (LoginID=@uname or eMailID=@uname)";
        string query = " select LoginID,Password,Designation,desig_id,groupid from tblUserMaster where (LoginID=@uname or eMailID=@uname) and UserMasterId='" + txtUserMasterID.Text + "'";
        //SqlConnection cn = new SqlConnection("server=OWNER-PC\\SQLEXPRESS;uid=sa;pwd=Annie123;Initial Catalog=dbPainTraxX3");
        SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString);

        SqlCommand cm = new SqlCommand(query, cn);

        cm.Parameters.AddWithValue("@uname", txt_uname.Text);


        SqlDataAdapter da = new SqlDataAdapter(cm);
        DataSet        ds = new DataSet();

        da.Fill(ds);

        if (ds.Tables[0].Rows.Count > 0)
        {
            if (ds.Tables[0].Rows[0]["Password"].ToString() == txt_pass.Text)
            {
                try
                {
                    Session["uname"] = txt_uname.Text;
                    DBHelperClass db      = new DBHelperClass();
                    string        LogName = Session["uname"].ToString();
                    string        _result = new BusinessLogic().login(txt_uname.Text.Trim(), txt_pass.Text.Trim());
                    if (_result != null)
                    {
                        Session["UserId"]          = _result;
                        Session["UserDesignation"] = ds.Tables[0].Rows[0]["Designation"].ToString();
                        Session["UserDesigId"]     = ds.Tables[0].Rows[0]["desig_id"].ToString();


                        DataSet dbGroup = db.selectData("Select * from tblgroups where id=" + ds.Tables[0].Rows[0]["groupid"].ToString());

                        if (dbGroup != null && dbGroup.Tables[0].Rows.Count > 0)
                        {
                            Session["Locations"]    = dbGroup.Tables[0].Rows[0]["locations_id"].ToString();
                            Session["pageAccess"]   = dbGroup.Tables[0].Rows[0]["page_id"].ToString();
                            Session["roles"]        = dbGroup.Tables[0].Rows[0]["role_id"].ToString();
                            Session["reportAccess"] = dbGroup.Tables[0].Rows[0]["reports"].ToString();
                        }
                        else
                        {
                            Session["Locations"]    = "";
                            Session["pageAccess"]   = "";
                            Session["roles"]        = "";
                            Session["reportAccess"] = "";
                        }
                    }

                    string LogLocation    = "";
                    string LogIp          = Request.ServerVariables["HTTP_X_FORWARDED_FOR"] ?? Request.ServerVariables["REMOTE_ADDR"];
                    string LogDescription = "LoginPage Entry";
                    string LogIntime      = Convert.ToString(System.DateTime.Now);
                    string LogOutTime     = null;
                    string log_id         = null;
                    db.logDetail(LogName, LogLocation, LogIp, LogDescription, LogIntime, LogOutTime, log_id);
                    Session["log"] = Convert.ToInt32(HttpContext.Current.Session["log_id"].ToString());
                    db.logDetailtbl(Convert.ToInt32(Session["log"].ToString()), "LogIn", Convert.ToString(System.DateTime.Now));
                    Response.Cookies["UserName"].Value = txt_uname.Text.Trim();
                    Response.Cookies["Password"].Value = txt_pass.Text.Trim();
                    Logger.Info(Session["UserId"].ToString() + '-' + Session["uname"].ToString().Trim() + "- Logged in at -" + DateTime.Now + " with Ip address -" + LogIp);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                }
                Response.Redirect("GetMAProviders.aspx");
            }
            else
            {
                lblmess.Attributes.Add("style", "display:block");
            }
        }
        else
        {
            lblmess.Attributes.Add("style", "display:block");
            Logger.Info("Login Failed" + '-' + txt_uname.Text.Trim());
        }
    }
Exemplo n.º 21
0
    public void bindPOC()
    {
        try
        {
            DBHelperClass db = new DBHelperClass();


            string SqlStr = @"Select 
                        CASE 
                              WHEN p.Requested is not null 
                               THEN Convert(varchar,p.ProcedureDetail_ID) +'_R'
                              ELSE 
                                case when p.Scheduled is not null
                                    THEN  Convert(varchar,p.ProcedureDetail_ID) +'_S'
                                ELSE
                                   CASE
                                        WHEN p.Executed is not null
                                        THEN Convert(varchar,p.ProcedureDetail_ID) +'_E'
                              END  END END as ID, 
                        CASE 
                              WHEN p.Requested is not null 
                               THEN p.Heading
                              ELSE 
                                case when p.Scheduled is not null
                                    THEN p.S_Heading
                                ELSE
                                   CASE
                                        WHEN p.Executed is not null
                                        THEN p.E_Heading
                              END  END END as Heading, 
                              CASE 
                              WHEN p.Requested is not null 
                               THEN p.PDesc
                              ELSE 
                                case when p.Scheduled is not null
                                    THEN p.S_PDesc
                                ELSE
                                   CASE
                                        WHEN p.Executed is not null
                                        THEN p.E_PDesc
                              END  END END as PDesc,
 CASE 
                              WHEN p.Requested is not null 
                               THEN p.Requested
                              ELSE 
                                case when p.Scheduled is not null
                                    THEN p.Scheduled
                                ELSE
                                   CASE
                                        WHEN p.Executed is not null
                                        THEN p.Executed
                              END  END END as PDate,
BodyPart
                             -- ,p.Requested,p.Heading RequestedHeading,p.Scheduled,p.S_Heading ScheduledHeading,p.Executed,p.E_Heading ExecutedHeading
                         from tblProceduresDetail p WHERE PatientIE_ID = " + Session["PatientIE_ID"].ToString() + "  and IsConsidered=0  Order By BodyPart,Heading";;


            DataSet dsPOC = db.selectData(SqlStr);


            if (dsPOC != null && dsPOC.Tables[0].Rows.Count > 0)
            {
                repSummery.DataSource = dsPOC;
                repSummery.DataBind();
            }
            else
            {
                repSummery.DataSource = null;
                repSummery.DataBind();
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 22
0
    protected void btnupload_mul_Click(object sender, EventArgs e)
    {
        DBHelperClass dBHelperClass = new DBHelperClass();
        DataSet       dataSet = new DataSet();
        string        fname = "", lname = "", doa = "";


        foreach (HttpPostedFile postedFile in fupmul.PostedFiles)
        {
            //string[] fileName = Path.GetFileName(postedFile.FileName).Split(',');
            string fileName = Path.GetFileName(postedFile.FileName);
            string msg      = "";
            try
            {
                Regex re = new Regex(@"\d+");
                Match m  = re.Match(fileName);
                if (m.Success)
                {
                    string   file = fileName.Substring(0, m.Index);
                    string[] str  = file.Split(',');
                    // lblResults.Text = string.Format("RegEx found " + m.Value + " at position " + m.Index.ToString() + " character in string is " + file + " fname: " + str[1] + ",LastName:" + str[0]);
                    lname = str[0];

                    if (str[1].Contains("_"))
                    {
                        fname = str[1].Split('_')[0];
                    }
                    else
                    {
                        fname = str[1];
                    }

                    file = fileName;
                    str  = file.Split('_');
                    if (str.Length > 2)
                    {
                        doa = str[str.Length - 1].ToLower().Split('.')[0];
                    }
                }
                else
                {
                    string[] str = fileName.Split('_');
                    fname = str[0].Split(',')[1];
                    lname = str[0].Split(',')[0];
                }

                doa = CommonConvert.DateformatDOA(doa);
                doa = CommonConvert.DateFormat(doa);

                string[] strfname = fname.TrimStart().Split(' ');
                fname   = strfname[0];
                dataSet = dBHelperClass.selectData("select Patient_ID from tblPatientMaster where LastName='" + lname.Trim().TrimStart() + "' and FirstName='" + fname.Trim().TrimStart() + "'");

                if (dataSet != null && dataSet.Tables[0].Rows.Count > 0)
                {
                    string patientid = dataSet.Tables[0].Rows[0][0].ToString();

                    string upload_folder_path = "~/PatientDocument/" + patientid;

                    if (!Directory.Exists(upload_folder_path))
                    {
                        Directory.CreateDirectory(Server.MapPath(upload_folder_path));
                    }

                    postedFile.SaveAs(System.IO.Path.Combine(Server.MapPath(upload_folder_path), fileName));

                    sb.Append("<p>File Name : " + fileName + "  patientid:" + patientid + "     Status : Uploaded </p>");
                    sb.Append(Environment.NewLine);
                    Logger.Info("File Name : " + fileName + "  patientid:" + patientid + "     Status : Uploaded");

                    //string filename = System.DateTime.Now.Millisecond.ToString() + "_" + fileName;
                    if (checkName(fileName, patientid) == false)
                    {
                        string filename = fileName;
                        string query    = "insert into tblPatientDocument values('" + filename + "','" + System.DateTime.Now.ToString() + "','" + upload_folder_path + "/" + filename + "'," + patientid + ",'" + doa + "')";

                        dBHelperClass.executeQuery(query);
                    }
                }
                else
                {
                    sb.Append("<p style='color:red'> File Name : " + fileName + "     Status : Not Uploaded</p>");
                    sb.Append(Environment.NewLine);
                    Logger.Info("File Name : " + fileName + "     Status : Not Uploaded");
                }
            }
            catch (Exception ex)
            {
                sb.Append("<p style='color:red'>File Name : " + fileName + "     Status : Not Uploaded </p>");
                Logger.Error("File Name : " + fileName + "       Status : Not Uploaded \n");
            }
            lblResult.InnerHtml = sb.ToString();
        }
    }
Exemplo n.º 23
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            DBHelperClass db    = new DBHelperClass();
            string        query = "";

            //query = "update  tblPatientIEDetailPage1 set FreeForm='" + txt_FreeForm.Text + "' where PatientIE_ID=" + Session["PatientIE_ID"].ToString();


            //int val = db.executeQuery(query);

            //if (val > 0)
            //{


            query = "select top 1 * from tblPatientIEDetailPage2 where PatientIE_ID=" + Session["PatientIE_ID"].ToString();
            DataSet ds = db.selectData(query);
            if (ds.Tables[0].Rows.Count == 0)
            {
                query = "insert into tblPatientIEDetailPage2 (";
                query = query + "intactexcept,LEdtr,DTRtricepsRight,DTRtricepsLeft,DTRBicepsRight,DTRBicepsLeft,DTRBrachioRight,DTRBrachioLeft,UEdtr,DTRKneeLeft,DTRKneeRight,DTRAnkleLeft,DTRAnkleRight,Sensory,PinPrick,Lighttouch,";
                query = query + "LEsen,LEL3Right,LEL3Left,LEL4Right,LEL4Left,LEL5Right,LEL5Left,LES1Left,LES1Right,LELumberParaspinalsLeft,LELumberParaspinalsRight,UEsen,UEC5Left,UEC5Right,UEC6Left,UEC6Right,UEC7Left,UEC7Right,UEC8Left,UEC8Right,UET1Right,UET1Left,UECervicalParaspinalsRight,UECervicalParaspinalsLeft,";
                query = query + "LEmmst,LEHipFlexionRight,LEHipFlexionLeft,LEHipAbductionRight,LEHipAbductionLeft,LEKneeExtensionRight,LEKneeExtensionLeft,LEKneeFlexionRight,LEKneeFlexionLeft,LEAnkleDorsiRight,LEAnkleDorsiLeft,LEAnklePlantarRight,LEAnklePlantarLeft,LEAnkleExtensorRight,LEAnkleExtensorLeft,";
                query = query + "UEmmst,UEShoulderAbductionRight,UEShoulderAbductionLeft,UEShoulderFlexionRight,UEShoulderFlexionLeft,UEElbowExtensionRight,UEElbowExtensionLeft,UEElbowFlexionRight,UEElbowFlexionLeft,UEElbowSupinationRight,UEElbowSupinationLeft,UEElbowPronationRight,UEElbowPronationLeft,UEWristFlexionRight,UEWristFlexionLeft,UEWristExtensionRight,UEWristExtensionLeft,UEHandGripStrengthRight,UEHandGripStrengthLeft,UEHandFingerAbductorsRight,UEHandFingerAbductorsLeft";
                query = query + ") values (";

                query = query + "'" + txtIntactExcept.Text + "','" + LEdtr.Checked + "','" + RTricepstxt.Text + "','" + LTricepstxt.Text + "','" + RBicepstxt.Text + "','" + LBicepstxt.Text + "','" + RBrachioradialis.Text + "','" + LBrachioradialis.Text + "','" + UExchk.Checked + "','" + LKnee.Text + "','" + RKnee.Text + "','" + LAnkle.Text + "','" + RAnkle.Text + "','" + txtSensory.Text.Replace("'", "''") + "','" + chkPinPrick.Checked + "','" + chkLighttouch.Checked + "',";
                query = query + "'" + LESen_Click.Checked + "','" + TextBox4.Text + "','" + txtDMTL3.Text + "','" + TextBox6.Text + "','" + TextBox5.Text + "','" + TextBox8.Text + "','" + TextBox7.Text + "','" + TextBox10.Text + "','" + TextBox21.Text + "','" + TextBox24.Text + "','" + TextBox25.Text + "','" + UESen_Click.Checked + "','" + TextBox9.Text + "','" + txtUEC5Right.Text + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + TextBox13.Text + "','" + TextBox14.Text + "','" + TextBox15.Text + "','" + TextBox16.Text + "','" + TextBox18.Text + "','" + TextBox17.Text + "','" + TextBox20.Text + "','" + TextBox19.Text + "',";
                query = query + "'" + LEmmst.Checked + "','" + TextBox23.Text + "','" + TextBox22.Text + "','" + TextBox41.Text + "','" + TextBox40.Text + "','" + TextBox27.Text + "','" + TextBox26.Text + "','" + TextBox43.Text + "','" + TextBox42.Text + "','" + TextBox29.Text + "','" + TextBox28.Text + "','" + TextBox45.Text + "','" + TextBox44.Text + "','" + TextBox47.Text + "','" + TextBox46.Text + "',";
                query = query + "'" + UEmmst.Checked + "','" + TextBox31.Text + "','" + TextBox30.Text + "','" + TextBox49.Text + "','" + TextBox48.Text + "','" + TextBox33.Text + "','" + TextBox32.Text + "','" + TextBox51.Text + "','" + TextBox50.Text + "','" + TextBox53.Text + "','" + TextBox52.Text + "','" + TextBox55.Text + "','" + TextBox54.Text + "','" + TextBox37.Text + "','" + TextBox36.Text + "','" + TextBox57.Text + "','" + TextBox56.Text + "','" + TextBox39.Text + "','" + TextBox38.Text + "','" + TextBox59.Text + "','" + TextBox58.Text + "')";
            }
            else
            {
                query = "update tblPatientIEDetailPage2 set ";

                query = query + "intactexcept='" + txtIntactExcept.Text + "',LEdtr = '" + LEdtr.Checked + "',DTRtricepsRight = '" + RTricepstxt.Text + "',DTRtricepsLeft ='" + LTricepstxt.Text + "',DTRBicepsRight ='" + RBicepstxt.Text + "',DTRBicepsLeft = '" + LBicepstxt.Text + "',DTRBrachioRight ='" + RBrachioradialis.Text + "',DTRBrachioLeft = '" + LBrachioradialis.Text + "' ,UEdtr = '" + UExchk.Checked + "',DTRKneeLeft = '" + LKnee.Text + "',DTRKneeRight = '" + RKnee.Text + "',DTRAnkleLeft = '" + LAnkle.Text + "' ,DTRAnkleRight  = '" + RAnkle.Text + "',Sensory = '" + txtSensory.Text.Replace("'", "''") + "',PinPrick = '" + chkPinPrick.Checked + "',Lighttouch = '" + chkLighttouch.Checked + "',";
                query = query + "LEsen = '" + LESen_Click.Checked + "',LEL3Right = '" + TextBox4.Text + "',LEL3Left = '" + txtDMTL3.Text + "',LEL4Right = '" + TextBox6.Text + "',LEL4Left = '" + TextBox5.Text + "',LEL5Right = '" + TextBox8.Text + "',LEL5Left = '" + TextBox7.Text + "',LES1Left = '" + TextBox10.Text + "',LES1Right = '" + TextBox21.Text + "',LELumberParaspinalsLeft = '" + TextBox24.Text + "',LELumberParaspinalsRight = '" + TextBox25.Text + "',UEsen ='" + UESen_Click.Checked + "',UEC5Left = '" + TextBox9.Text + "',UEC5Right = '" + txtUEC5Right.Text + "',UEC6Left = '" + TextBox11.Text + "',UEC6Right = '" + TextBox12.Text + "',UEC7Left = '" + TextBox13.Text + "',UEC7Right = '" + TextBox14.Text + "',UEC8Left = '" + TextBox15.Text + "',UEC8Right = '" + TextBox16.Text + "',UET1Right = '" + TextBox18.Text + "',UET1Left = '" + TextBox17.Text + "',UECervicalParaspinalsRight = '" + TextBox20.Text + "',UECervicalParaspinalsLeft = '" + TextBox19.Text + "',";
                query = query + "LEmmst = '" + LEmmst.Checked + "',LEHipFlexionRight = '" + TextBox23.Text + "',LEHipFlexionLeft = '" + TextBox22.Text + "',LEHipAbductionRight = '" + TextBox41.Text + "',LEHipAbductionLeft  = '" + TextBox40.Text + "',LEKneeExtensionRight = '" + TextBox27.Text + "',LEKneeExtensionLeft = '" + TextBox26.Text + "',LEKneeFlexionRight = '" + TextBox43.Text + "',LEKneeFlexionLeft = '" + TextBox42.Text + "',LEAnkleDorsiRight = '" + TextBox29.Text + "',LEAnkleDorsiLeft = '" + TextBox28.Text + "',LEAnklePlantarRight = '" + TextBox45.Text + "',LEAnklePlantarLeft = '" + TextBox44.Text + "',LEAnkleExtensorRight = '" + TextBox47.Text + "',LEAnkleExtensorLeft = '" + TextBox46.Text + "',";
                query = query + "UEmmst = '" + UEmmst.Checked + "',UEShoulderAbductionRight = '" + TextBox31.Text + "',UEShoulderAbductionLeft = '" + TextBox30.Text + "',UEShoulderFlexionRight = '" + TextBox49.Text + "',UEShoulderFlexionLeft = '" + TextBox48.Text + "',UEElbowExtensionRight = '" + TextBox33.Text + "',UEElbowExtensionLeft = '" + TextBox32.Text + "',UEElbowFlexionRight = '" + TextBox51.Text + "',UEElbowFlexionLeft = '" + TextBox50.Text + "',UEElbowSupinationRight = '" + TextBox53.Text + "',UEElbowSupinationLeft = '" + TextBox52.Text + "',UEElbowPronationRight = '" + TextBox55.Text + "',UEElbowPronationLeft = '" + TextBox54.Text + "',UEWristFlexionRight = '" + TextBox37.Text + "',UEWristFlexionLeft = '" + TextBox36.Text + "',UEWristExtensionRight = '" + TextBox57.Text + "',UEWristExtensionLeft = '" + TextBox56.Text + "',UEHandGripStrengthRight = '" + TextBox39.Text + "',UEHandGripStrengthLeft = '" + TextBox38.Text + "',UEHandFingerAbductorsRight = '" + TextBox59.Text + "',UEHandFingerAbductorsLeft = '" + TextBox58.Text + "'";
                query = query + " Where PatientIE_ID=" + Session["PatientIE_ID"].ToString() + "";
            }
            ds.Dispose();

            int val = db.executeQuery(query);

            query = "select top 1 * from tblPage3HTMLContent where PatientIE_ID=" + Session["PatientIE_ID"].ToString();
            ds    = db.selectData(query);
            if (ds.Tables[0].Rows.Count == 0)
            {
                query = "insert into tblPage3HTMLContent(PatientIE_ID,HTMLContent,topSectionHTML)values(@PatientIE_ID,@HTMLContent,@topSectionHTML)";
            }
            else
            {
                query = "update tblPage3HTMLContent set HTMLContent=@HTMLContent,topSectionHTML=@topSectionHTML where PatientIE_ID=@PatientIE_ID";
            }

            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString))
                using (SqlCommand command = new SqlCommand(query, connection))
                {
                    command.Parameters.AddWithValue("@PatientIE_ID", Session["PatientIE_ID"].ToString());
                    command.Parameters.AddWithValue("@HTMLContent", hdHTMLContent.Value);
                    command.Parameters.AddWithValue("@topSectionHTML", hdtopHTMLContent.Value);


                    connection.Open();
                    var results = command.ExecuteNonQuery();
                    connection.Close();
                }


            if (val > 0)
            {
                try
                {
                    long   _ieID     = Convert.ToInt64(Session["PatientIE_ID"].ToString());
                    string _ieMode   = "";
                    string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString;
                    string SqlStr    = "";
                    oSQLConn.ConnectionString = sProvider;
                    oSQLConn.Open();
                    SqlStr = "Select * from tblPatientIEDetailPage3 WHERE PatientIE_ID = " + _ieID;
                    SqlDataAdapter    sqlAdapt      = new SqlDataAdapter(SqlStr, oSQLConn);
                    SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt);
                    DataTable         sqlTbl        = new DataTable();
                    sqlAdapt.Fill(sqlTbl);
                    DataRow TblRow;

                    if (sqlTbl.Rows.Count == 0)
                    {
                        _ieMode = "New";
                    }
                    else if (sqlTbl.Rows.Count > 0)
                    {
                        _ieMode = "Update";
                    }

                    if (_ieMode == "New")
                    {
                        TblRow = sqlTbl.NewRow();
                    }
                    else if (_ieMode == "Update")
                    {
                        TblRow = sqlTbl.Rows[0];
                        TblRow.AcceptChanges();
                    }
                    else
                    {
                        TblRow = null;
                    }

                    if (_ieMode == "Update" || _ieMode == "New")
                    {
                        TblRow["PatientIE_ID"]       = _ieID;
                        TblRow["GAIT"]               = cboGAIT.Text.ToString();
                        TblRow["Ambulates"]          = cboAmbulates.Text.ToString();
                        TblRow["Footslap"]           = chkFootslap.Checked;
                        TblRow["Kneehyperextension"] = chkKneehyperextension.Checked;
                        TblRow["Unabletohealwalk"]   = chkUnabletohealwalk.Checked;
                        TblRow["Unabletotoewalk"]    = chkUnabletotoewalk.Checked;
                        TblRow["Other"]              = txtOther.Text.ToString();

                        if (_ieMode == "New")
                        {
                            TblRow["CreatedBy"]   = "Admin";
                            TblRow["CreatedDate"] = DateTime.Now;
                            sqlTbl.Rows.Add(TblRow);
                        }
                        sqlAdapt.Update(sqlTbl);
                    }
                    if (TblRow != null)
                    {
                        TblRow.Table.Dispose();
                    }
                    sqlTbl.Dispose();
                    sqlCmdBuilder.Dispose();
                    sqlAdapt.Dispose();
                    oSQLConn.Close();
                }
                catch (Exception ex)
                {
                    oSQLConn.Close();
                }
            }


            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "openPopup('mymodelmessage')", true);
            Logger.Info(Session["UserId"].ToString() + "--" + Session["uname"].ToString().Trim() + "-- Create IE - Page4 " + Session["PatientIE_ID"].ToString() + "--" + DateTime.Now);
            if (pageHDN.Value != null && pageHDN.Value != "")
            {
                Response.Redirect(pageHDN.Value.ToString());
            }
            else
            {
                Response.Redirect("Page5.aspx");
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 24
0
    private void bindData()
    {
        DBHelperClass db    = new DBHelperClass();
        string        query = "";

        query = "select top 1 * from tblPatientIEDetailPage2 where PatientIE_ID=" + Session["PatientIE_ID"].ToString();
        DataSet ds = db.selectData(query);

        if (ds.Tables[0].Rows.Count > 0)
        {
            //chk_seizures.Checked = ds.Tables[0].Rows[0]["Seizures"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Seizures"].ToString()) : false;
            //chk_chest_pain.Checked = ds.Tables[0].Rows[0]["ChestPain"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["ChestPain"].ToString()) : false;
            //chk_shortness_of_breath.Checked = ds.Tables[0].Rows[0]["ShortnessOfBreath"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["ShortnessOfBreath"].ToString()) : false;
            //chk_jaw_pain.Checked = ds.Tables[0].Rows[0]["Jawpain"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Jawpain"].ToString()) : false;
            //chk_abdominal_pain.Checked = ds.Tables[0].Rows[0]["AbdominalPain"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["AbdominalPain"].ToString()) : false;
            //chk_fever.Checked = ds.Tables[0].Rows[0]["Fevers"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Fevers"].ToString()) : false;
            //chk_diarrhea.Checked = ds.Tables[0].Rows[0]["Diarrhea"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Diarrhea"].ToString()) : false;
            //chk_bowel_bladder.Checked = ds.Tables[0].Rows[0]["Bowel"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Bowel"].ToString()) : false;
            //chk_blurred.Checked = ds.Tables[0].Rows[0]["DoubleVision"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["DoubleVision"].ToString()) : false;
            //chk_recent_wt.Checked = ds.Tables[0].Rows[0]["RecentWeightloss"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["RecentWeightloss"].ToString()) : false;
            //chk_episodic_ligth.Checked = ds.Tables[0].Rows[0]["Episodic"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Episodic"].ToString()) : false;
            //chk_rashes.Checked = ds.Tables[0].Rows[0]["Rashes"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Rashes"].ToString()) : false;
            //chk_hearing_loss.Checked = ds.Tables[0].Rows[0]["HearingLoss"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["HearingLoss"].ToString()) : false;
            //chk_sleep_disturbance.Checked = ds.Tables[0].Rows[0]["NightSweats"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["NightSweats"].ToString()) : false;
            //chk_depression.Checked = ds.Tables[0].Rows[0]["Depression"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Depression"].ToString()) : false;

            //chk_bloodinurine.Checked = ds.Tables[0].Rows[0]["dloodinurine"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["dloodinurine"].ToString()) : false;

            LTricepstxt.Text      = Convert.ToString(ds.Tables[0].Rows[0]["DTRtricepsLeft"]);
            RTricepstxt.Text      = Convert.ToString(ds.Tables[0].Rows[0]["DTRtricepsRight"]);
            LBicepstxt.Text       = Convert.ToString(ds.Tables[0].Rows[0]["DTRBicepsLeft"]);
            RBicepstxt.Text       = Convert.ToString(ds.Tables[0].Rows[0]["DTRBicepsRight"]);
            RBrachioradialis.Text = Convert.ToString(ds.Tables[0].Rows[0]["DTRBrachioRight"]);
            LBrachioradialis.Text = Convert.ToString(ds.Tables[0].Rows[0]["DTRBrachioLeft"]);
            LKnee.Text            = Convert.ToString(ds.Tables[0].Rows[0]["DTRKneeLeft"]);
            RKnee.Text            = Convert.ToString(ds.Tables[0].Rows[0]["DTRKneeRight"]);
            LAnkle.Text           = Convert.ToString(ds.Tables[0].Rows[0]["DTRAnkleLeft"]);
            RAnkle.Text           = Convert.ToString(ds.Tables[0].Rows[0]["DTRAnkleRight"]);
            UExchk.Checked        = ds.Tables[0].Rows[0]["UEdtr"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["UEdtr"].ToString()) : false;
            chkPinPrick.Checked   = ds.Tables[0].Rows[0]["Pinprick"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Pinprick"].ToString()) : false;
            chkLighttouch.Checked = ds.Tables[0].Rows[0]["Lighttouch"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Lighttouch"].ToString()) : false;
            txtSensory.Text       = Convert.ToString(ds.Tables[0].Rows[0]["Sensory"]);
            LESen_Click.Checked   = ds.Tables[0].Rows[0]["LEsen"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["LEsen"].ToString()) : false;
            TextBox4.Text         = Convert.ToString(ds.Tables[0].Rows[0]["LEL3Right"]);
            txtDMTL3.Text         = Convert.ToString(ds.Tables[0].Rows[0]["LEL3Left"]);
            TextBox6.Text         = Convert.ToString(ds.Tables[0].Rows[0]["LEL4Right"]);
            TextBox5.Text         = Convert.ToString(ds.Tables[0].Rows[0]["LEL4Left"]);
            TextBox8.Text         = Convert.ToString(ds.Tables[0].Rows[0]["LEL5Right"]);
            TextBox7.Text         = Convert.ToString(ds.Tables[0].Rows[0]["LEL5Left"]);
            TextBox10.Text        = Convert.ToString(ds.Tables[0].Rows[0]["LES1Left"]);
            TextBox21.Text        = Convert.ToString(ds.Tables[0].Rows[0]["LES1Right"]);
            TextBox25.Text        = Convert.ToString(ds.Tables[0].Rows[0]["LELumberParaspinalsRight"]);
            TextBox24.Text        = Convert.ToString(ds.Tables[0].Rows[0]["LELumberParaspinalsLeft"]);
            UESen_Click.Checked   = ds.Tables[0].Rows[0]["UEsen"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["UEsen"].ToString()) : false;
            TextBox9.Text         = Convert.ToString(ds.Tables[0].Rows[0]["UEC5Left"]);
            txtUEC5Right.Text     = Convert.ToString(ds.Tables[0].Rows[0]["UEC5Right"]);
            TextBox11.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UEC6Left"]);
            TextBox12.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UEC6Right"]);
            TextBox13.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UEC7Left"]);
            TextBox14.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UEC7Right"]);
            TextBox15.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UEC8Left"]);
            TextBox16.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UEC8Right"]);
            TextBox18.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UET1Right"]);
            TextBox17.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UET1Left"]);
            TextBox20.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UECervicalParaspinalsRight"]);
            TextBox19.Text        = Convert.ToString(ds.Tables[0].Rows[0]["UECervicalParaspinalsLeft"]);
            //  cboHoffmanexam.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["HoffmanExam"]);
            // chkStocking.Checked = ds.Tables[0].Rows[0]["Stocking"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Stocking"].ToString()) : false;
            //chkGlove.Checked = ds.Tables[0].Rows[0]["Glove"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["Glove"].ToString()) : false;
            LEmmst.Checked       = ds.Tables[0].Rows[0]["LEmmst"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["LEmmst"].ToString()) : false;
            TextBox23.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEHipFlexionRight"]);
            TextBox22.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEHipFlexionLeft"]);
            TextBox41.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEHipAbductionRight"]);
            TextBox40.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEHipAbductionLeft"]);
            TextBox27.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEKneeExtensionRight"]);
            TextBox26.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEKneeExtensionLeft"]);
            TextBox43.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEKneeFlexionRight"]);
            TextBox42.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEKneeFlexionLeft"]);
            TextBox29.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEAnkleDorsiRight"]);
            TextBox28.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEAnkleDorsiLeft"]);
            TextBox45.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEAnklePlantarRight"]);
            TextBox44.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEAnklePlantarLeft"]);
            TextBox47.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEAnkleExtensorRight"]);
            TextBox46.Text       = Convert.ToString(ds.Tables[0].Rows[0]["LEAnkleExtensorLeft"]);
            UEmmst.Checked       = ds.Tables[0].Rows[0]["UEmmst"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["UEmmst"].ToString()) : false;
            TextBox31.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEShoulderAbductionRight"]);
            TextBox30.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEShoulderAbductionLeft"]);
            TextBox49.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEShoulderFlexionRight"]);
            TextBox48.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEShoulderFlexionLeft"]);
            TextBox33.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEElbowExtensionRight"]);
            TextBox32.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEElbowExtensionLeft"]);
            TextBox51.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEElbowFlexionRight"]);
            TextBox50.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEElbowFlexionLeft"]);
            TextBox53.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEElbowSupinationRight"]);
            TextBox52.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEElbowSupinationLeft"]);
            TextBox55.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEElbowPronationRight"]);
            TextBox54.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEElbowPronationLeft"]);
            TextBox37.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEWristFlexionRight"]);
            TextBox36.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEWristFlexionLeft"]);
            TextBox57.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEWristExtensionRight"]);
            TextBox56.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEWristExtensionLeft"]);
            TextBox39.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEHandGripStrengthRight"]);
            TextBox38.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEHandGripStrengthLeft"]);
            TextBox59.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEHandFingerAbductorsRight"]);
            TextBox58.Text       = Convert.ToString(ds.Tables[0].Rows[0]["UEHandFingerAbductorsLeft"]);
            txtIntactExcept.Text = Convert.ToString(ds.Tables[0].Rows[0]["intactexcept"]);
            LEdtr.Checked        = ds.Tables[0].Rows[0]["LEdtr"] != DBNull.Value ? Convert.ToBoolean(ds.Tables[0].Rows[0]["LEdtr"].ToString()) : false;
        }
        else
        {
            PopulateUIDefaults();
        }

        query = "select * from tblPage3HTMLContent where  PatientIE_ID=" + Session["PatientIE_ID"].ToString();
        ds    = db.selectData(query);

        if (ds.Tables[0].Rows.Count > 0)
        {
            divHtml.InnerHtml    = ds.Tables[0].Rows[0]["HTMLContent"].ToString();
            divtopHtml.InnerHtml = ds.Tables[0].Rows[0]["topSectionHTML"].ToString();
        }
        else
        {
            bindHtml();
        }

        query = "Select * from tblPatientIEDetailPage3 WHERE PatientIE_ID = " + Session["PatientIE_ID"].ToString();
        ds    = db.selectData(query);


        if (ds.Tables[0].Rows.Count > 0)
        {
            cboGAIT.Text                  = ds.Tables[0].Rows[0]["GAIT"].ToString().Trim();
            cboAmbulates.Text             = ds.Tables[0].Rows[0]["Ambulates"].ToString().Trim();
            chkFootslap.Checked           = CommonConvert.ToBoolean(ds.Tables[0].Rows[0]["Footslap"].ToString());
            chkKneehyperextension.Checked = CommonConvert.ToBoolean(ds.Tables[0].Rows[0]["Kneehyperextension"].ToString());
            chkUnabletohealwalk.Checked   = CommonConvert.ToBoolean(ds.Tables[0].Rows[0]["Unabletohealwalk"].ToString());
            chkUnabletotoewalk.Checked    = CommonConvert.ToBoolean(ds.Tables[0].Rows[0]["Unabletotoewalk"].ToString());
            txtOther.Text                 = ds.Tables[0].Rows[0]["Other"].ToString().Trim();
        }
    }
    private void bindData(string patientIEid)
    {
        string query = "select * from tblPatientIEDetailPage1 where PatientIE_ID=" + patientIEid;

        DataSet ds = gDbhelperobj.selectData(query);

        if (ds.Tables[0].Rows.Count > 0)
        {
            ViewState["patientIEid"] = patientIEid;

            txt_CT.Value           = ds.Tables[0].Rows[0]["HadCTScanOf"].ToString();
            txt_hospital.Text      = ds.Tables[0].Rows[0]["WentTo"].ToString();
            txt_mri.Value          = ds.Tables[0].Rows[0]["HadMRIOf"].ToString();
            txt_prescription.Value = ds.Tables[0].Rows[0]["Persistent"].ToString();
            txt_which_what.Value   = ds.Tables[0].Rows[0]["FreeForm"].ToString();
            txt_x_ray.Value        = ds.Tables[0].Rows[0]["HadXrayOf"].ToString();

            ddl_accident_desc.Text = ds.Tables[0].Rows[0]["Sustained"].ToString();
            ddl_belt.Text          = ds.Tables[0].Rows[0]["Position"].ToString();
            ddl_EMS.Text           = ds.Tables[0].Rows[0]["EMSTeam"].ToString();
            ddl_invovledin.Text    = ds.Tables[0].Rows[0]["InvolvedIn"].ToString();
            ddl_via.Text           = ds.Tables[0].Rows[0]["Via"].ToString();

            if (string.IsNullOrEmpty(txt_hospital.Text))
            {
                rep_hospitalized.Items.FindByValue("0").Selected = true;
                hospitlediv.Attributes.Add("disabled", "true");
                txt_hospital.Enabled = false;
            }
            else
            {
                rep_hospitalized.Items.FindByValue("1").Selected = true;
                hospitlediv.Attributes.Add("disabled", "false");
                txt_hospital.Enabled = true;
            }

            if (string.IsNullOrEmpty(txt_docname.Value))
            {
                rbl_seen_injury.Items.FindByValue("0").Selected = true;
                txt_docname.Attributes.Add("disabled", "true");
            }
            else
            {
                rbl_seen_injury.Items.FindByValue("1").Selected = true;
                txt_docname.Attributes.Add("disabled", "false");
            }
            if (string.IsNullOrEmpty(txt_injur_past.Value))
            {
                rbl_in_past.Items.FindByValue("0").Selected = true;
                txt_injur_past.Attributes.Add("disabled", "true");
            }
            else
            {
                rbl_in_past.Items.FindByValue("1").Selected = true;
                txt_injur_past.Attributes.Add("disabled", "false");
            }
        }

        query = "select * from tblInjuredBodyParts where PatientIE_ID=" + patientIEid;

        ds = gDbhelperobj.selectData(query);

        if (ds.Tables[0].Rows.Count > 0)
        {
            if (ds.Tables[0].Rows[0]["LeftAnkle"] != DBNull.Value)
            {
                chk_l_ankle.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["LeftAnkle"].ToString());
            }

            if (ds.Tables[0].Rows[0]["RightAnkle"] != DBNull.Value)
            {
                chk_l_ankle.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["RightAnkle"].ToString());
            }


            if (ds.Tables[0].Rows[0]["LeftShoulder"] != DBNull.Value)
            {
                chk_L_Shoulder.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["LeftShoulder"].ToString());
            }

            if (ds.Tables[0].Rows[0]["RightShoulder"] != DBNull.Value)
            {
                chk_r_Shoulder.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["RightShoulder"].ToString());
            }

            if (ds.Tables[0].Rows[0]["LeftKnee"] != DBNull.Value)
            {
                chk_L_Keen.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["LeftKnee"].ToString());
            }

            if (ds.Tables[0].Rows[0]["RightKnee"] != DBNull.Value)
            {
                chk_r_Keen.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["RightKnee"].ToString());
            }

            if (ds.Tables[0].Rows[0]["LeftElbow"] != DBNull.Value)
            {
                chk_l_Elbow.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["LeftElbow"].ToString());
            }

            if (ds.Tables[0].Rows[0]["RightElbow"] != DBNull.Value)
            {
                chk_r_Elbow.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["RightElbow"].ToString());
            }

            if (ds.Tables[0].Rows[0]["LeftWrist"] != DBNull.Value)
            {
                chk_l_Wrist.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["LeftWrist"].ToString());
            }

            if (ds.Tables[0].Rows[0]["RightWrist"] != DBNull.Value)
            {
                chk_r_Wrist.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["RightWrist"].ToString());
            }

            if (ds.Tables[0].Rows[0]["LeftHip"] != DBNull.Value)
            {
                chk_l_Hip.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["LeftHip"].ToString());
            }

            if (ds.Tables[0].Rows[0]["RightHip"] != DBNull.Value)
            {
                chk_r_Hip.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["RightHip"].ToString());
            }


            if (ds.Tables[0].Rows[0]["Neck"] != DBNull.Value)
            {
                chk_Neck.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["Neck"].ToString());
            }

            if (ds.Tables[0].Rows[0]["MidBack"] != DBNull.Value)
            {
                chk_Midback.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["MidBack"].ToString());
            }

            if (ds.Tables[0].Rows[0]["LowBack"] != DBNull.Value)
            {
                chk_lowback.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["LowBack"].ToString());
            }


            txt_other.Value = ds.Tables[0].Rows[0]["Others"].ToString();
        }
    }