首先我有2节课
class Student
{
int StudentID
string Name
Fee fee
}
class Fees
{
int FeeID
string FeeName
DateTime FeeDueDate
}
假设有 10 个学生对象 Student[] stud = new Student[10]
如果 stud[0] 有 4 笔费用( Fee[4] ),他们是
FeeID=1, FeeName="Books", FeeDueDate="2014/06/25"
FeeID=2, FeeName="Tuition", FeeDueDate="2013/03/21"
FeeID=3, FeeName="Sports Equipment", FeeDueDate="2013/03/18"
FeeID=4, FeeName="School Dorm", FeeDueDate="2013/07/26"
而 stud[1] 有 2 项费用( Fee[2] ),它们是
FeeID=2, FeeName="Books", FeeDueDate="2014/06/20"
FeeID=4, FeeName="School Dorm", FeeDueDate="2013/03/26"
和螺柱 [2] 有......
我需要对第二个集合进行排序,即按 FeeDueDate 递增的费用,同时保持学生的相同顺序
所以排序后会是
stud[0] =>
FeeID=3, FeeName="Sports Equipment", FeeDueDate="2013/03/18"
FeeID=2, FeeName="Tuition", FeeDueDate="2013/03/21"
FeeID=4, FeeName="School Dorm", FeeDueDate="2013/07/26"
FeeID=1, FeeName="Books", FeeDueDate="2014/06/25"
stud[1] =>
FeeID=4, FeeName="School Dorm", FeeDueDate="2013/03/26"
FeeID=2, FeeName="Books", FeeDueDate="2014/06/20"
如何才能做到这一点?谢谢
此图像还显示了我的对象集合 http://oi50.tinypic.com/wuq9o3.jpg