public void SortReprintGrid(string value) { if (SortedColumn != value) { GridSortOrder = string.Empty; } GridSortOrder = string.IsNullOrEmpty(GridSortOrder) ? SortOrder.ASC : GridSortOrder.Equals(SortOrder.ASC) ? SortOrder.DESC : SortOrder.ASC; AllControlsEnabled = false; switch (value) { default: case BatchGridColumnsTagName.BatchId: BatchList = GridSortOrder.Equals(SortOrder.ASC) ? BatchList.OrderBy(x => x.RequestPrintedBatchID).ToList() : BatchList.OrderByDescending(x => x.RequestPrintedBatchID).ToList(); break; case BatchGridColumnsTagName.Date: BatchList = GridSortOrder.Equals(SortOrder.ASC) ? BatchList.OrderBy(x => x.DateRequestPrinted).ToList() : BatchList.OrderByDescending(x => x.DateRequestPrinted).ToList(); break; case BatchGridColumnsTagName.Records: BatchList = GridSortOrder.Equals(SortOrder.ASC) ? BatchList.OrderBy(x => x.BatchCount).ToList() : BatchList.OrderByDescending(x => x.BatchCount).ToList(); break; } AllControlsEnabled = true; SortedColumn = value; }
private void SortReprintGrid(string value) { if (SortedColumn != value) { GridSortOrder = string.Empty; } GridSortOrder = string.IsNullOrEmpty(GridSortOrder) ? SortOrder.ASC : GridSortOrder.Equals(SortOrder.ASC) ? SortOrder.DESC : SortOrder.ASC; switch (value) { default: case BatchGridColumnsTagName.BatchId: BatchList = GridSortOrder.Equals(SortOrder.ASC) ? BatchList.OrderBy(x => x.BatchID).ToList() : BatchList.OrderByDescending(x => x.BatchID).ToList(); break; case BatchGridColumnsTagName.Date: BatchList = GridSortOrder.Equals(SortOrder.ASC) ? BatchList.OrderBy(x => x.CreattionDate).ToList() : BatchList.OrderByDescending(x => x.CreattionDate).ToList(); break; case BatchGridColumnsTagName.Records: BatchList = GridSortOrder.Equals(SortOrder.ASC) ? BatchList.OrderBy(x => x.RecordsCount).ToList() : BatchList.OrderByDescending(x => x.RecordsCount).ToList(); break; } SortedColumn = value; }