Esempio n. 1
0
    /// <summary>
    /// Add the Sort Image to gridview header row
    /// </summary>
    /// <param name="headerRow"></param>
    private void AddSortImage(GridViewRow headerRow)
    {
        try
        {
            //Assign the sort direction of gridview to image
            imageDirection = GridViewSortDirection.ToString();

            if (!imageDirection.Equals(string.Empty))
            {
                // Create the sorting image based on the sort direction
                System.Web.UI.WebControls.Image sortImage = new System.Web.UI.WebControls.Image();

                if (imageDirection == SortOrder.Ascending.ToString())
                {
                    sortImage.ImageUrl      = CommonConstants.IMAGE_UP_ARROW;
                    sortImage.AlternateText = CommonConstants.ASCENDING;
                }
                else if (imageDirection == SortOrder.Descending.ToString())
                {
                    sortImage.ImageUrl      = CommonConstants.IMAGE_DOWN_ARROW;
                    sortImage.AlternateText = CommonConstants.DESCENDING;
                }

                // Add the image to the appropriate header cell
                switch (sortExpression)
                {
                case CommonConstants.EMPLOYEENAME_EMP_SKILL_SEARCH_RPT:
                    headerRow.Cells[0].Controls.Add(sortImage);
                    break;

                case CommonConstants.DESIGNATION_EMP_SKILL_SEARCH_RPT:
                    headerRow.Cells[1].Controls.Add(sortImage);
                    break;

                case CommonConstants.DEPARTMENT_EMP_SKILL_SEARCH_RPT:
                    headerRow.Cells[2].Controls.Add(sortImage);
                    break;

                case CommonConstants.PROJECTS_ALLOCATED_EMP_SKILL_SEARCH_RPT:
                    headerRow.Cells[3].Controls.Add(sortImage);
                    break;

                case CommonConstants.PRIMARY_SKILLS_EMP_SKILL_SEARCH_RPT:
                    headerRow.Cells[4].Controls.Add(sortImage);
                    break;
                }
            }
        }

        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "AddSortImage", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }
    /// <summary>
    /// Add the Sort Image to gridview header row
    /// </summary>
    /// <param name="headerRow"></param>
    private void AddSortImage(GridViewRow headerRow)
    {
        try
        {
            //Assign the sort direction of gridview to image
            imageDirection = GridViewSortDirection.ToString();

            if (!imageDirection.Equals(string.Empty))
            {
                // Create the sorting image based on the sort direction
                Image sortImage = new Image();

                if (imageDirection == SortOrder.Ascending.ToString())
                {
                    sortImage.ImageUrl      = CommonConstants.IMAGE_UP_ARROW;
                    sortImage.AlternateText = CommonConstants.ASCENDING;
                }
                else if (imageDirection == SortOrder.Descending.ToString())
                {
                    sortImage.ImageUrl      = CommonConstants.IMAGE_DOWN_ARROW;
                    sortImage.AlternateText = CommonConstants.DESCENDING;
                }

                // Add the image to the appropriate header cell
                switch (sortExpression)
                {
                case "EmployeeName":
                    headerRow.Cells[2].Controls.Add(sortImage);
                    break;

                case "ProjectName":
                    headerRow.Cells[3].Controls.Add(sortImage);
                    break;

                // 36732-Ambar-Start
                case "DepartmentName":
                    headerRow.Cells[4].Controls.Add(sortImage);
                    break;

                case "Designation":
                    headerRow.Cells[5].Controls.Add(sortImage);
                    break;
                    // 36732-Ambar-End
                }
            }
        }

        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, "ReportingOrFunctionalManager.aspx", "AddSortImage", EventIDConstants.RAVE_HR_CONTRACT_PRESENTATION_LAYER);
        }
    }
Esempio n. 3
0
        static GridViewSortDirection GetGridViewSortDirection(GridViewSortDirection direction)
        {
            switch (direction)
            {
            case GridViewSortDirection.Default:
                return(GridViewSortDirection.Ascending);

            case GridViewSortDirection.Ascending:
                return(GridViewSortDirection.Descending);

            case GridViewSortDirection.Descending:
                return(GridViewSortDirection.Default);

            default:
                throw new InvalidOperationException();
            }
        }
Esempio n. 4
0
    /// <summary>
    /// Add the sorting image on header of column
    /// </summary>
    private void AddSortImage(GridViewRow headerRow)
    {
        try
        {
            string _sortDirection = GridViewSortDirection.ToString();

            if (!_sortDirection.Equals(String.Empty))
            {
                // Create the sorting image based on the sort direction
                Image sortImage = new Image();

                if (_sortDirection == SortOrder.Ascending.ToString())
                {
                    sortImage.ImageUrl      = CommonConstants.IMAGE_UP_ARROW;
                    sortImage.AlternateText = CommonConstants.ASCENDING;
                }
                else if (_sortDirection == SortOrder.Descending.ToString())
                {
                    sortImage.ImageUrl      = CommonConstants.IMAGE_DOWN_ARROW;
                    sortImage.AlternateText = CommonConstants.DESCENDING;
                }

                // Add the image to the appropriate header cell
                switch (sortExpression)
                {
                case CommonConstants.RESOURCE_NAME:
                    headerRow.Cells[2].Controls.Add(sortImage);
                    break;

                case CommonConstants.DEPARTMENT:
                    headerRow.Cells[3].Controls.Add(sortImage);
                    break;
                }
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "AddSortImage", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }
Esempio n. 5
0
 public static void SetGridViewSortDirection(GridViewColumn element, GridViewSortDirection value) => element.SetValue(GridViewSortDirectionProperty, value);