首先我有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]有两个费用(Fee[2])时,它们是:
FeeID=2, FeeName="Books", FeeDueDate="2014/06/20"
FeeID=4, FeeName="School Dorm", FeeDueDate="2013/03/26"
我可以帮您进行翻译。以下是需要翻译的内容:
并且stud[2]有......
我需要对第二个集合(即Fee)按照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