Example #1
0
    /// <summary>
    /// Gets the MRF which are to be displayed in the grid
    /// </summary>
    /// <returns>Collection</returns>
    private BusinessEntities.RaveHRCollection GetApproveRejectMrf()
    {
        Rave.HR.BusinessLayer.MRF.MRFDetail mrfSummaryBL     = new Rave.HR.BusinessLayer.MRF.MRFDetail();
        BusinessEntities.MRFDetail          mrfDetail        = new BusinessEntities.MRFDetail();
        BusinessEntities.RaveHRCollection   raveHRCollection = new BusinessEntities.RaveHRCollection();


        try
        {
            if (gvPendingApprovalOfMrf.BottomPagerRow != null)
            {
                GridViewRow gvrPager = gvPendingApprovalOfMrf.BottomPagerRow;
                TextBox     txtPages = (TextBox)gvrPager.Cells[0].FindControl("txtPages");
                if (txtPages.Text != "" && int.Parse(txtPages.Text) != 0)
                {
                    objParameter.PageNumber = int.Parse(txtPages.Text);
                    objParameter.PageSize   = 10;
                }
            }
            else
            {
                objParameter.PageNumber = 1;
                objParameter.PageSize   = 10;
            }

            raveHRCollection = mrfSummaryBL.GetApproveRejectMrf(objParameter, ref pageCount);

            Session[SessionNames.PAGE_COUNT_APPREJMRF] = pageCount;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFPENDINGAPPROVAL, "GetApproveRejectMrf", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }

        return(raveHRCollection);
    }