Beispiel #1
0
    private void Util_GetSortValue(string sortExpression)
    {
        switch (sortExpression.ToLower())
        {

            case "ip":

                sortcriteria = CommerceAuditProperty.IPAddress;
                sortdirection = EkEnumeration.OrderByDirection.Ascending;
                break;

            case "fmessage":

                sortcriteria = CommerceAuditProperty.Message;
                sortdirection = EkEnumeration.OrderByDirection.Ascending;
                break;

            case "orderid":

                sortcriteria = CommerceAuditProperty.OrderId;
                sortdirection = EkEnumeration.OrderByDirection.Ascending;
                break;

            case "userid":

                sortcriteria = CommerceAuditProperty.UserId;
                sortdirection = EkEnumeration.OrderByDirection.Ascending;
                break;

            default:

                sortcriteria = CommerceAuditProperty.DateCreated;
                sortdirection = EkEnumeration.OrderByDirection.Descending;
                break;

        }
    }
Beispiel #2
0
    private void UpdateCriteriaOrderBy(AnalyticsCriteria criteria, AnalyticsSortableField defaultField, bool allowSorting)
    {
        if (!allowSorting) return;
        _sortField = defaultField;

        string sortExpression = ViewState["SortExpression"] as string;

        if (!String.IsNullOrEmpty(sortExpression))
        {
            if (Enum.IsDefined(typeof(AnalyticsSortableField), sortExpression))
            {
                AnalyticsSortableField newSortField = (AnalyticsSortableField)Enum.Parse(typeof(AnalyticsSortableField), sortExpression, true);
                if (!((_reportType == ReportType.TopContent || _reportType == ReportType.ContentByTitle || _reportType == ReportType.TopLanding || _reportType == ReportType.TopExit) && newSortField == AnalyticsSortableField.Visits))
                    _sortField = newSortField; //TODO:
            }
        }

        _sortDirection = (_sortField == AnalyticsSortableField.Name ? EkEnumeration.OrderByDirection.Ascending : EkEnumeration.OrderByDirection.Descending);

        if (ViewState["SortDirection"] != null)
        {
            if (SortDirection.Ascending == (SortDirection)ViewState["SortDirection"])
            {
                _sortDirection = EkEnumeration.OrderByDirection.Ascending;
            }
            else
            {
                _sortDirection = EkEnumeration.OrderByDirection.Descending;
            }
        }

        ViewState["SortExpression"] = _sortField.ToString();
        ViewState["SortDirection"] = (_sortDirection == EkEnumeration.OrderByDirection.Ascending ? SortDirection.Ascending : SortDirection.Descending);

        criteria.OrderByField = _sortField;
        criteria.OrderByDirection = _sortDirection;
    }
Beispiel #3
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        _ReportName = ReportTypeList.SelectedItem.Value;
        _Duration = Convert.ToInt32(DurationTextBox.Text);
        if ("descending" == OrderDirList.SelectedItem.Value)
        {
            _OrderDirection = EkEnumeration.OrderByDirection.Descending;
        }
        else
        {
            _OrderDirection = EkEnumeration.OrderByDirection.Ascending;
        }
        _PageSize = Convert.ToInt32(PageSizeTextBox.Text);
        _FilterObject = FilterObjectsList.SelectedItem.Value;
        _FilterObjectId = FilterIdTextBox.Value;
        _FilterObjectRecursion = Convert.ToBoolean(chkFilterObjectRecur.Value);
        _FilterDisplayText = filterDisplay.Text;

        updateControl();

        _host.SaveWidgetDataMembers();
        ViewSet.SetActiveView(View);
    }