Reverse the sort for the admin. The list is traversed in reverse elsewhere. This makes them sort the same

This commit is contained in:
Tim Young 2017-08-11 15:01:09 -05:00
parent db6cdff653
commit 765789226e
2 changed files with 5 additions and 3 deletions

View File

@ -511,8 +511,7 @@ namespace EduNetworkBuilder
/// <returns></returns> /// <returns></returns>
public TreeNode WorkTree(TreeNode theTop=null, bool ForTeacher = false) public TreeNode WorkTree(TreeNode theTop=null, bool ForTeacher = false)
{ {
//Sort by due date, and within the due dates, sort by save date //Sort by due date, and within the due dates, sort by save date
//Projects.Sort((q, p) => p.DueDate == q.DueDate ? p.SaveDate.CompareTo(q.SaveDate) : p.DueDate.CompareTo(q.DueDate));
Projects.Sort((q, p) => p.Compare(q)); Projects.Sort((q, p) => p.Compare(q));
List<SchoolworkClass> DrawFrom = new List<SchoolworkClass>(); List<SchoolworkClass> DrawFrom = new List<SchoolworkClass>();

View File

@ -292,7 +292,10 @@ namespace EduNetworkBuilder
Node.Tag = "Class"; //Do not translate this Node.Tag = "Class"; //Do not translate this
TreeNode Top = Node; TreeNode Top = Node;
tvClasswork.Nodes.Add(Node); tvClasswork.Nodes.Add(Node);
CurrentUser.Projects.Sort((q, p) => p.Compare(q));
//This is sorted reverse from what happens in PersonClass.WorkTree.
//In PersonClass.WorkTree, we traverse it backwards.
CurrentUser.Projects.Sort((p, q) => p.Compare(q));
foreach (SchoolworkClass SWC in CurrentUser.Projects) foreach (SchoolworkClass SWC in CurrentUser.Projects)
{ {
Node = new TreeNode(SWC.Name); Node = new TreeNode(SWC.Name);