/// <summary> /// Sort marks with deferent keys /// </summary> /// <param name="key">Key to sort</param> public void Sort(SortMarkTable key) { if (GetRatings().Count > 1) { switch (key) { case SortMarkTable.Subject: marks.Sort((x, y) => x.SubjectID.CompareTo(y.SubjectID)); break; case SortMarkTable.SubjectReverse: marks.Sort((x, y) => y.SubjectID.CompareTo(x.SubjectID)); break; case SortMarkTable.Mark: marks.Sort((x, y) => x.Mark.CompareTo(y.Mark)); break; case SortMarkTable.MarkReverse: marks.Sort((x, y) => y.Mark.CompareTo(x.Mark)); break; } } }
/// <summary> /// Method for sorting column in Profile page marks table by Subject /// </summary> private void SortRatingsBySubjectClick(object sender, RoutedEventArgs e) { sorted = (sorted == SortMarkTable.Subject) ? SortMarkTable.SubjectReverse : SortMarkTable.Subject; SortMarksTableRows(sorted); }
/// <summary> /// Method for sorting column in Profile page marks table by Marks /// </summary> private void SortRatingsByMarkClick(object sender, RoutedEventArgs e) { sorted = (sorted == SortMarkTable.Mark) ? SortMarkTable.MarkReverse : SortMarkTable.Mark; SortMarksTableRows(sorted); }
/// <summary> /// Method that execute marks table rows sortition /// </summary> /// <param name="by">Order for sortition</param> public void SortMarksTableRows(SortMarkTable by) { logic.Sort(by); FillMarksTable(); }