private void BubbleSortDescending(WeekdayTotal[] arr) { for (int i = arr.Length - 1; i > 0; i--) { for (int j = 0; j <= i - 1; j++) { if (arr[j].TotalVisitors < arr[j + 1].TotalVisitors) { WeekdayTotal big = arr[j]; arr[j] = arr[j + 1]; arr[j + 1] = big; } } } }
public WeeklyReport() { InitializeComponent(); ReadFromCsv(); //get all days of week weekdays = Enum.GetNames(typeof(DayOfWeek)); //remove weekend weekdays = weekdays.Where(value => value != "Saturday" && value != "Sunday").ToArray(); for (int i = 0; i < 5; i++) { weekdaysTotal[i] = new WeekdayTotal(); } orderSelector.SelectedIndex = 0; //trigger weekpicker_value changed }