private void BindTLWFormulaDetails()
    {
        BLL.PersonalSummaryLib oPersonalSummaryLib = null;
        Entity.PersonalSummaryInfo oPersonalSummaryInfo = null;
        List<Entity.PersonalSummaryInfo> oListPersonalSummaryInfo = null;
        try
        {
            lblCurrentDate.Text = DateTime.Now.ToShortDateString();
            oListPersonalSummaryInfo = new List<Entity.PersonalSummaryInfo>();

            oPersonalSummaryLib = new BLL.PersonalSummaryLib();

            oPersonalSummaryInfo = new Entity.PersonalSummaryInfo();
            oPersonalSummaryInfo.StrGender = Request.QueryString["gender"].ToString();
            oPersonalSummaryInfo.DecWaist = Convert.ToDecimal(Request.QueryString["waist"].ToString().Equals("") ? "0" : Request.QueryString["waist"]);
            oPersonalSummaryInfo.DecBMI = Convert.ToDecimal(Request.QueryString["bmi"].ToString().Equals("") ? "0" : Request.QueryString["bmi"]);
            oPersonalSummaryInfo.DecBodyFATPercentage = Convert.ToDecimal(Request.QueryString["bFAT"].ToString().Equals("") ? "0" : Request.QueryString["bFAT"]);
            oPersonalSummaryInfo.DecWaistToHeight = Convert.ToDecimal(Request.QueryString["wtheight"].ToString().Equals("") ? "0" : Request.QueryString["wtheight"]);
            oPersonalSummaryInfo.DecWaistToHip = Convert.ToDecimal(Request.QueryString["wthip"].ToString().Equals("") ? "0" : Request.QueryString["wthip"]);
            oListPersonalSummaryInfo = oPersonalSummaryLib.GetTLWFormulaForIndividualReport(oPersonalSummaryInfo);

            lblRiskWeight.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("weight")).Select(x => x.StrLevelofRisk).FirstOrDefault();
            lblRangeWeight.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("weight")).Select(x => (x.DecFrom.ToString().Equals("0") ? "<" : x.DecFrom.ToString()) + " --- " + (x.DecTo.ToString().Equals("999999") ? ">" : x.DecTo.ToString())).FirstOrDefault();

            lblRiskWaist.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("waist")).Select(x => x.StrLevelofRisk).FirstOrDefault();
            lblRangeWaist.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("waist")).Select(x => (x.DecFrom.ToString().Equals("0") ? "<" : x.DecFrom.ToString()) + " --- " + (x.DecTo.ToString().Equals("999999") ? ">" : x.DecTo.ToString())).FirstOrDefault();

            lblRiskBMI.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("bmi")).Select(x => x.StrLevelofRisk).FirstOrDefault();
            lblRangeBMI.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("bmi")).Select(x => (x.DecFrom.ToString().Equals("0") ? "<" : x.DecFrom.ToString()) + " --- " + (x.DecTo.ToString().Equals("999999") ? ">" : x.DecTo.ToString())).FirstOrDefault();

            lblRiskBodyFAT.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("bfatp")).Select(x => x.StrLevelofRisk).FirstOrDefault();
            lblRangeBodyFAT.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("bfatp")).Select(x => (x.DecFrom.ToString().Equals("0") ? "<" : x.DecFrom.ToString()) + " --- " + (x.DecTo.ToString().Equals("999999") ? ">" : x.DecTo.ToString())).FirstOrDefault();

            lblRiskWaisttoHeight.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("wtheight")).Select(x => x.StrLevelofRisk).FirstOrDefault();
            lblRangeWaisttoHeight.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("wtheight")).Select(x => (x.DecFrom.ToString().Equals("0") ? "<" : x.DecFrom.ToString()) + " --- " + (x.DecTo.ToString().Equals("999999") ? ">" : x.DecTo.ToString())).FirstOrDefault();

            lblRiskWaisttoHip.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("wthip")).Select(x => x.StrLevelofRisk).FirstOrDefault();
            lblRangeWaisttoHip.Text = oListPersonalSummaryInfo.Where(x => x.StrRatioCode.Trim().ToLower().Equals("wthip")).Select(x => (x.DecFrom.ToString().Equals("0") ? "<" : x.DecFrom.ToString()) + " --- " + (x.DecTo.ToString().Equals("999999") ? ">" : x.DecTo.ToString())).FirstOrDefault();

        }
        catch (Exception ex) { throw ex; }
        finally
        {
            oPersonalSummaryLib = null;
            oPersonalSummaryInfo = null;
        }
    }
    private void UpdatePersonalSummaryDetails()
    {
        BackofficeClass objBackOfficeClass = new BackofficeClass();
        DataSet DS = objBackOfficeClass.Mem_GET_UserInfo(AppLib.GetLoggedInUserName());
        BLL.PersonalSummaryLib oPersonalSummaryLib = null;
        Entity.PersonalSummaryInfo oPersonalSummaryInfo = null;
        try
        {
            oPersonalSummaryLib = new BLL.PersonalSummaryLib();
            oPersonalSummaryInfo = new Entity.PersonalSummaryInfo();

            oPersonalSummaryInfo.DecBMI = Convert.ToDecimal(txtCurrentBMI.Text);
            oPersonalSummaryInfo.DecBodyFATPercentage = Convert.ToDecimal(txtCurrentBodyFAT.Text);
            oPersonalSummaryInfo.DecWaist = Convert.ToDecimal(txtCurrentWaist.Text);
            oPersonalSummaryInfo.DecWaistToHeight = Convert.ToDecimal(txtCurrentWaistToHeight.Text);
            oPersonalSummaryInfo.DecWaistToHip = Convert.ToDecimal(txtCurrentWaistToHips.Text);
            oPersonalSummaryInfo.DecWeight = Convert.ToDecimal(txtCurrentWeight.Text);
            oPersonalSummaryInfo.DtCreatedOn = DateTime.Now;
            oPersonalSummaryInfo.GuidUserId = new Guid(DS.Tables[0].Rows[0]["USER_ID"].ToString());
            oPersonalSummaryLib.SavePersonalSummaryDetails(oPersonalSummaryInfo);
            Response.Redirect(AppConfig.GetBaseSiteUrl() + "Main/MyNutrition.aspx?msg=up");

        }
        catch (Exception ex) { throw ex; }
        finally
        {
            oPersonalSummaryInfo = null;
            oPersonalSummaryLib = null;
            objBackOfficeClass = null;
            DS = null;

        }
    }
    /// <summary>
    /// following function is used to bind the personal summary details.
    /// </summary>
    private void BindPersonalSummaryDetails()
    {
        lblCurrentPersonalSummary.Text = DateTime.Now.ToShortDateString();
        BLL.PersonalSummaryLib oPersonalSummaryLib = null;
        Entity.PersonalSummaryInfo oPersonalSummaryInfo = null;
        BackofficeClass objBackOfficeClass = new BackofficeClass();
        DataSet DS = objBackOfficeClass.Mem_GET_UserInfo(AppLib.GetLoggedInUserName());
        try
        {
            oPersonalSummaryLib = new BLL.PersonalSummaryLib();
            oPersonalSummaryInfo = new Entity.PersonalSummaryInfo();

            oPersonalSummaryInfo = oPersonalSummaryLib.GetPersonalSummaryDetailsByUserId(new Guid(DS.Tables[0].Rows[0]["USER_ID"].ToString()));
            if (oPersonalSummaryInfo != null)
            {
                ViewState["isExists"] = "1";

                lblStartDatePersonalSummary.Text = oPersonalSummaryInfo.DtModifiedOn.ToShortDateString();
                txtStartWeight.Text = oPersonalSummaryInfo.DecWeight.ToString("00.00");
                txtStartWaistToHips.Text = oPersonalSummaryInfo.DecWaistToHip.ToString("00.00");
                txtStartWaistToHeight.Text = oPersonalSummaryInfo.DecWaistToHeight.ToString("00.00");
                txtStartWaist.Text = oPersonalSummaryInfo.DecWaist.ToString("00.00");
                txtStartBodyFAT.Text = oPersonalSummaryInfo.DecBodyFATPercentage.ToString("00.00");
                txtStartBMI.Text = oPersonalSummaryInfo.DecBMI.ToString("00.00");
            }
            else
                ViewState["isExists"] = "0";
        }
        catch (Exception ex) { throw ex; }
        finally
        {
            oPersonalSummaryLib = null;
            oPersonalSummaryInfo = null;
            objBackOfficeClass = null;
            DS = null;
        }
    }