Пример #1
0
    protected void ObjDs1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        var filter = new LogItemsFilter();

        filter.TopRows = int.Parse(DropTopRowsFilter.SelectedValue);

        if (DropTracerItemTypeFilter.SelectedValue != "")
        {
            filter.FilterType = true;
            filter.Type = (TracerItemType)Enum.Parse(typeof(TracerItemType), DropTracerItemTypeFilter.SelectedValue);
        }

        if (DropModuleTypesFilter.SelectedValue != "")
            filter.ModuleFullName = DropModuleTypesFilter.SelectedValue;

        if (DropDatesRangeFilter.SelectedValue != "")
        {
            DatesRange.RangeType rangeType =
                (DatesRange.RangeType)Enum.Parse(typeof(DatesRange.RangeType), DropDatesRangeFilter.SelectedValue);
            DatesRange datesRange = new DatesRange(rangeType);
            filter.DateInsertedRange = datesRange;
        }

        if (!string.IsNullOrEmpty(TxtDescriptionFilter.Text))
            filter.DescriptionPart = TxtDescriptionFilter.Text;

        if (!string.IsNullOrEmpty(TxtIpFilter.Text))
            filter.UserHostAddressPart = TxtIpFilter.Text;

        if (!string.IsNullOrEmpty(TxtSessionIdFilter.Text))
            filter.SessionIdPart = TxtSessionIdFilter.Text;

        e.InputParameters["filter"] = filter;
    }
Пример #2
0
 public void Reset()
 {
     id = 0;
     orderRef = "";
     ownerUser = "";
     customerId = 0;
     confirmed = Utility.TristateBool.NotSet;
     paid = Utility.TristateBool.NotSet;
     processed = Utility.TristateBool.NotSet;
     couponCode = "";
     excludeIdList = new List<int>();
     orderDatesRange = new DatesRange(DatesRange.RangeType.Always);
 }
Пример #3
0
    private void loadGrid()
    {
        int status = -1;
        if (DropStatusFilter.SelectedValue != "")
            int.TryParse(DropStatusFilter.SelectedValue, out status);

        int priority = -1;
        if (DropPriorityFilter.SelectedValue != "")
            int.TryParse(DropPriorityFilter.SelectedValue, out priority);

        int catId = 0;
        int.TryParse(DropCategoriesFilter.SelectedValue, out catId);

        int customerId = 0;
        int.TryParse(DropCustomersFilter.SelectedValue, out customerId);

        DatesRange datesRange = new DatesRange();
        if (DropDatesRangeFilter.SelectedValue != "")
        {
            DatesRange.RangeType rangeType =
                (DatesRange.RangeType)Enum.Parse(typeof(DatesRange.RangeType), DropDatesRangeFilter.SelectedValue);
            datesRange = new DatesRange(rangeType);
        }

        string userAssigned = DropAssignedUserFilter.SelectedValue;
        if (ChkMyTickets.Checked)
        {
            userAssigned = PgnUserCurrent.UserName;
            Utility.SetDropByValue(DropAssignedUserFilter, userAssigned);
        }

        var filter = new TicketItemFilter();
        var list = new List<TicketItem>();

        filter.CategoryId = catId;
        filter.CustomerId = customerId;
        filter.TitleSearch = TxtTitleFilter.Text;
        filter.UserAssigned = userAssigned;
        filter.UserInserted = DropUserInsertedFilter.SelectedValue;
        filter.Status = status;
        filter.Priority = priority;
        filter.ItemInsertedRange = datesRange;

        list = new TicketItemsManager(true, false).GetByFilter(filter, "");
        var comparer = new TicketItem.TicketItemComparer(this.GridSortExpression, this.GridSortDirection);
        list.Sort(comparer);

        Grid1.DataSource = list;
        Grid1.DataBind();
    }