public static GetSortDirection ( StateBag viewState ) : SortDirection, | ||
viewState | StateBag | |
return | SortDirection, |
protected void CarsGridView_Sorting(object sender, GridViewSortEventArgs e) { SortDirection sortDirection = SortingUtility.GetSortDirection(ViewState); ViewState[CarServiceConstants.SORT_DIRECTION_VIEW_STATE_ATTR] = sortDirection; ViewState[CarServiceConstants.SORT_EXPRESSION_VIEW_STATE_ATTR] = e.SortExpression; IQueryable <Automobile> automobiles = this.persister.GetAutomobiles(); IQueryable <Automobile> sortedAutomobiles = SortingUtility.SortAutomobiles(automobiles, e.SortExpression, sortDirection); BindAutomobilesGrid(sortedAutomobiles); }
protected void SparePartsGridView_Sorting(object sender, GridViewSortEventArgs e) { SortDirection sortDirection = SortingUtility.GetSortDirection(ViewState); ViewState[CarServiceConstants.SORT_DIRECTION_VIEW_STATE_ATTR] = sortDirection; ViewState[CarServiceConstants.SORT_EXPRESSION_VIEW_STATE_ATTR] = e.SortExpression; IQueryable <SparePart> spareParts = this.persister.GetSpareParts(); IQueryable <SparePart> sortedSpareParts = SortingUtility.SortSpareParts(spareParts, e.SortExpression, sortDirection); BindSparePartsGrid(sortedSpareParts); }
protected void UsersGridView_Sorting(object sender, GridViewSortEventArgs e) { SortDirection sortDirection = SortingUtility.GetSortDirection(ViewState); ViewState[CarServiceConstants.SORT_DIRECTION_VIEW_STATE_ATTR] = sortDirection; ViewState[CarServiceConstants.SORT_EXPRESSION_VIEW_STATE_ATTR] = e.SortExpression; List <CarServiceUser> users = GetUsers(); IEnumerable <CarServiceUser> sortedUsers = SortingUtility.SortUsers(users, e.SortExpression, sortDirection); BindUsersGrid(sortedUsers); }