public void FillPromotionsToGrid()
        {
            string    sqlText = "";
            DataTable dt      = new DataTable();

            //objDB = new SQLDB();
            objHRInfo = new HRInfo();
            gvPromotiomDetl.Rows.Clear();
            string sBranch = "", sPBType = "", sDetlType = "";

            if (iFormType == 1)
            {
                sDetlType = "AGENT_APPROVAL";
            }
            else
            {
                if (cmbPBType.SelectedIndex == 0 && cmbRepToBranch.SelectedIndex == 0)
                {
                    //sqlText = "SELECT HESS_TRXN_NO,HESS_LTR_REF_NO,HESS_APPL_NUMBER,HESS_EORA_CODE,MEMBER_NAME,HESS_TO_BRANCH_CODE,HESS_PROMOTION_CATEGORY_CODE" +
                    //        ",HPCM_PROMOTION_CATEGORY_NAME,HESS_BASIC,HESS_HRA,HESS_CCA,HESS_CONV_ALW,HESS_LTA_ALW,HESS_SPL_ALW,HESS_TO_COMPANY_CODE,HESS_UNF_ALW" +
                    //        ",HESS_VEH_ALW,HESS_CH_ED_ALW,HESS_BNP_ALW,HESS_MED_REIMB,HESS_PET_ALW,(HESS_BASIC+HESS_HRA+HESS_CCA+HESS_CONV_ALW+" +
                    //        "HESS_LTA_ALW+HESS_SPL_ALW+HESS_UNF_ALW+HESS_VEH_ALW+HESS_CH_ED_ALW+HESS_BNP_ALW+HESS_MED_REIMB+HESS_PET_ALW) HESS_GROSS_SAL" +
                    //        ",HESS_EFF_DATE,ISNULL(elevel_id,0) ELEVEL_ID,HESS_DESIG_ID,HESS_TO_DEPT_ID,desig_name FROM HR_EMP_SAL_STRU INNER JOIN EORA_MASTER ON ECODE = HESS_EORA_CODE INNER JOIN HR_PROMOTION_CATEGORY_MASTER " +
                    //        "ON HPCM_PROMOTION_CATEGORY_CODE = HESS_PROMOTION_CATEGORY_CODE LEFT JOIN LevelsDesig_mas ON ldm_company_code = HESS_TO_COMPANY_CODE AND LDM_DESIG_ID = HESS_DESIG_ID INNER JOIN DESIG_MAS ON desig_code = HESS_DESIG_ID " +
                    //        "WHERE HESS_APPR_STATUS='P' ORDER BY HESS_EFF_DATE ASC";
                    sDetlType = "ALL";
                }
                else if (cmbPBType.SelectedIndex > 0 && cmbRepToBranch.SelectedIndex == 0)
                {
                    //sqlText = "SELECT HESS_TRXN_NO,HESS_LTR_REF_NO,HESS_APPL_NUMBER,HESS_EORA_CODE,MEMBER_NAME,HESS_TO_BRANCH_CODE,HESS_PROMOTION_CATEGORY_CODE" +
                    //        ",HPCM_PROMOTION_CATEGORY_NAME,HESS_BASIC,HESS_HRA,HESS_CCA,HESS_CONV_ALW,HESS_LTA_ALW,HESS_SPL_ALW,HESS_TO_COMPANY_CODE,HESS_UNF_ALW" +
                    //        ",HESS_VEH_ALW,HESS_CH_ED_ALW,HESS_BNP_ALW,HESS_MED_REIMB,HESS_PET_ALW,(HESS_BASIC+HESS_HRA+HESS_CCA+HESS_CONV_ALW+"+
                    //        "HESS_LTA_ALW+HESS_SPL_ALW+HESS_UNF_ALW+HESS_VEH_ALW+HESS_CH_ED_ALW+HESS_BNP_ALW+HESS_MED_REIMB+HESS_PET_ALW) HESS_GROSS_SAL"+
                    //        ",HESS_EFF_DATE,ISNULL(elevel_id,0) ELEVEL_ID,HESS_DESIG_ID,HESS_TO_DEPT_ID,desig_name FROM HR_EMP_SAL_STRU INNER JOIN EORA_MASTER ON ECODE = HESS_EORA_CODE INNER JOIN HR_PROMOTION_CATEGORY_MASTER " +
                    //        "ON HPCM_PROMOTION_CATEGORY_CODE = HESS_PROMOTION_CATEGORY_CODE LEFT JOIN LevelsDesig_mas ON ldm_company_code = HESS_TO_COMPANY_CODE AND LDM_DESIG_ID = HESS_DESIG_ID INNER JOIN DESIG_MAS ON desig_code = HESS_DESIG_ID WHERE HESS_APPR_STATUS='P' " +
                    //        "AND HESS_PROMOTION_CATEGORY_CODE='" + cmbPBType.SelectedValue + "' ORDER BY HESS_EFF_DATE ASC";
                    sPBType   = cmbPBType.SelectedValue.ToString();
                    sDetlType = "BYCAT";
                }
                else if (cmbPBType.SelectedIndex > 0 && cmbRepToBranch.SelectedIndex > 0)
                {
                    //sqlText = "SELECT HESS_TRXN_NO,HESS_LTR_REF_NO,HESS_APPL_NUMBER,HESS_EORA_CODE,MEMBER_NAME,HESS_TO_BRANCH_CODE,HESS_PROMOTION_CATEGORY_CODE" +
                    //         ",HPCM_PROMOTION_CATEGORY_NAME,HESS_BASIC,HESS_HRA,HESS_CCA,HESS_CONV_ALW,HESS_LTA_ALW,HESS_SPL_ALW,HESS_TO_COMPANY_CODE,HESS_UNF_ALW" +
                    //         ",HESS_VEH_ALW,HESS_CH_ED_ALW,HESS_BNP_ALW,HESS_MED_REIMB,HESS_PET_ALW,(HESS_BASIC+HESS_HRA+HESS_CCA+HESS_CONV_ALW+" +
                    //         "HESS_LTA_ALW+HESS_SPL_ALW+HESS_UNF_ALW+HESS_VEH_ALW+HESS_CH_ED_ALW+HESS_BNP_ALW+HESS_MED_REIMB+HESS_PET_ALW) HESS_GROSS_SAL" +
                    //         ",HESS_EFF_DATE,ISNULL(elevel_id,0) ELEVEL_ID,HESS_DESIG_ID,HESS_TO_DEPT_ID,desig_name FROM HR_EMP_SAL_STRU INNER JOIN EORA_MASTER ON ECODE = HESS_EORA_CODE INNER JOIN HR_PROMOTION_CATEGORY_MASTER " +
                    //        "ON HPCM_PROMOTION_CATEGORY_CODE = HESS_PROMOTION_CATEGORY_CODE LEFT JOIN LevelsDesig_mas ON ldm_company_code = HESS_TO_COMPANY_CODE AND LDM_DESIG_ID = HESS_DESIG_ID INNER JOIN DESIG_MAS ON desig_code = HESS_DESIG_ID WHERE HESS_APPR_STATUS='P' " +
                    //        "AND HESS_PROMOTION_CATEGORY_CODE='" + cmbPBType.SelectedValue + "' AND HESS_FROM_BRANCH_CODE = '" + cmbRepToBranch.SelectedValue +
                    //        "' ORDER BY HESS_EFF_DATE ASC";
                    sPBType   = cmbPBType.SelectedValue.ToString();
                    sBranch   = cmbRepToBranch.SelectedValue.ToString();
                    sDetlType = "BYCATBR";
                }
                else if (cmbPBType.SelectedIndex == 0 && cmbRepToBranch.SelectedIndex > 0)
                {
                    //sqlText = "SELECT HESS_TRXN_NO,HESS_LTR_REF_NO,HESS_APPL_NUMBER,HESS_EORA_CODE,MEMBER_NAME,HESS_TO_BRANCH_CODE,HESS_PROMOTION_CATEGORY_CODE" +
                    //         ",HPCM_PROMOTION_CATEGORY_NAME,HESS_BASIC,HESS_HRA,HESS_CCA,HESS_CONV_ALW,HESS_LTA_ALW,HESS_SPL_ALW,HESS_TO_COMPANY_CODE,HESS_UNF_ALW" +
                    //         ",HESS_VEH_ALW,HESS_CH_ED_ALW,HESS_BNP_ALW,HESS_MED_REIMB,HESS_PET_ALW,(HESS_BASIC+HESS_HRA+HESS_CCA+HESS_CONV_ALW+" +
                    //         "HESS_LTA_ALW+HESS_SPL_ALW+HESS_UNF_ALW+HESS_VEH_ALW+HESS_CH_ED_ALW+HESS_BNP_ALW+HESS_MED_REIMB+HESS_PET_ALW) HESS_GROSS_SAL" +
                    //         ",HESS_EFF_DATE,ISNULL(elevel_id,0) ELEVEL_ID,HESS_DESIG_ID,HESS_TO_DEPT_ID,desig_name FROM HR_EMP_SAL_STRU INNER JOIN EORA_MASTER ON ECODE = HESS_EORA_CODE INNER JOIN HR_PROMOTION_CATEGORY_MASTER " +
                    //        "ON HPCM_PROMOTION_CATEGORY_CODE = HESS_PROMOTION_CATEGORY_CODE LEFT JOIN LevelsDesig_mas ON ldm_company_code = HESS_TO_COMPANY_CODE AND LDM_DESIG_ID = HESS_DESIG_ID INNER JOIN DESIG_MAS ON desig_code = HESS_DESIG_ID " +
                    //        "WHERE HESS_APPR_STATUS='P' AND HESS_FROM_BRANCH_CODE = '" + cmbRepToBranch.SelectedValue + "' ORDER BY HESS_EFF_DATE ASC";
                    sBranch   = cmbRepToBranch.SelectedValue.ToString();
                    sDetlType = "BYBR";
                }
            }
            //if (sqlText.Length > 10)
            //    dt = objDB.ExecuteDataSet(sqlText).Tables[0];
            try
            {
                dt = objHRInfo.GetPromotionsDetlsForApproval("", sBranch, sPBType, sDetlType).Tables[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                objHRInfo = null;
            }
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataGridViewRow  tempRow  = new DataGridViewRow();
                    DataGridViewCell tempSlNo = new DataGridViewTextBoxCell();
                    tempSlNo.Value = i + 1;
                    tempRow.Cells.Add(tempSlNo);

                    DataGridViewCell tempTrnNo = new DataGridViewTextBoxCell();
                    tempTrnNo.Value = dt.Rows[i]["HESS_TRXN_NO"].ToString();
                    tempRow.Cells.Add(tempTrnNo);

                    DataGridViewCell tempRefNo = new DataGridViewTextBoxCell();
                    tempRefNo.Value = dt.Rows[i]["HESS_LTR_REF_NO"].ToString();
                    tempRow.Cells.Add(tempRefNo);

                    DataGridViewCell tempApplNo = new DataGridViewTextBoxCell();
                    tempApplNo.Value = dt.Rows[i]["HESS_APPL_NUMBER"].ToString();
                    tempRow.Cells.Add(tempApplNo);

                    DataGridViewCell tempEcode = new DataGridViewTextBoxCell();
                    tempEcode.Value = dt.Rows[i]["HESS_EORA_CODE"].ToString();
                    tempRow.Cells.Add(tempEcode);

                    DataGridViewCell tempName = new DataGridViewTextBoxCell();
                    tempName.Value = dt.Rows[i]["MEMBER_NAME"].ToString();
                    tempRow.Cells.Add(tempName);

                    DataGridViewCell tempBCode = new DataGridViewTextBoxCell();
                    tempBCode.Value = dt.Rows[i]["HESS_TO_BRANCH_CODE"].ToString();
                    tempRow.Cells.Add(tempBCode);

                    DataGridViewCell tempCCode = new DataGridViewTextBoxCell();
                    tempCCode.Value = dt.Rows[i]["HESS_TO_COMPANY_CODE"].ToString();
                    tempRow.Cells.Add(tempCCode);

                    DataGridViewCell tempDesig = new DataGridViewTextBoxCell();
                    tempDesig.Value = dt.Rows[i]["desig_name"].ToString();
                    tempRow.Cells.Add(tempDesig);

                    DataGridViewCell tempDesigID = new DataGridViewTextBoxCell();
                    tempDesigID.Value = dt.Rows[i]["HESS_DESIG_ID"].ToString();
                    tempRow.Cells.Add(tempDesigID);

                    DataGridViewCell tempDeptID = new DataGridViewTextBoxCell();
                    tempDeptID.Value = dt.Rows[i]["HESS_TO_DEPT_ID"].ToString();
                    tempRow.Cells.Add(tempDeptID);

                    DataGridViewCell tempElevelID = new DataGridViewTextBoxCell();
                    tempElevelID.Value = dt.Rows[i]["ELEVEL_ID"].ToString();
                    tempRow.Cells.Add(tempElevelID);

                    DataGridViewCell tempPCat = new DataGridViewTextBoxCell();
                    tempPCat.Value = dt.Rows[i]["HPCM_PROMOTION_CATEGORY_NAME"].ToString();
                    tempRow.Cells.Add(tempPCat);

                    DataGridViewCell tempSal = new DataGridViewTextBoxCell();
                    tempSal.Value = dt.Rows[i]["HESS_GROSS_SAL"].ToString();
                    tempRow.Cells.Add(tempSal);

                    DataGridViewCell tempEff = new DataGridViewTextBoxCell();
                    tempEff.Value = Convert.ToDateTime(dt.Rows[i]["HESS_EFF_DATE"].ToString()).ToString("dd/MMM/yyyy").ToUpper();
                    tempRow.Cells.Add(tempEff);

                    gvPromotiomDetl.Rows.Add(tempRow);
                }
            }
            objDB = null;
            dt    = null;
        }