示例#1
0
        private static int SortResultScore(ResultScoreRecord r1, ResultScoreRecord r2)
        {
            string school_1 = r1.SchoolYear.ToString().PadLeft(3, '0');

            school_1 += r1.Semester.ToString().PadLeft(1, '0');

            string school_2 = r2.SchoolYear.ToString().PadLeft(3, '0');

            school_2 += r2.Semester.ToString().PadLeft(1, '0');

            return(school_1.CompareTo(school_2));
        }
示例#2
0
        private int SortResult(ResultScoreRecord rsr1, ResultScoreRecord rsr2)
        {
            string rsr1SortString = "";
            string rsr2SortString = "";

            if (StudentDic.ContainsKey(rsr1.RefStudentID) && StudentDic.ContainsKey(rsr2.RefStudentID))
            {
                demoStudent sr1 = StudentDic[rsr1.RefStudentID];
                demoStudent sr2 = StudentDic[rsr2.RefStudentID];

                rsr1SortString = string.IsNullOrEmpty(sr1.class_id) ? "000000" : sr1.class_name.PadLeft(6, '0');
                rsr2SortString = string.IsNullOrEmpty(sr2.class_id) ? "000000" : sr2.class_name.PadLeft(6, '0');

                rsr1SortString += !string.IsNullOrEmpty(sr1.seat_no) ? sr1.seat_no.ToString().PadLeft(3, '0') : "000";
                rsr2SortString += !string.IsNullOrEmpty(sr2.seat_no) ? sr2.seat_no.ToString().PadLeft(3, '0') : "000";
            }

            return(rsr1SortString.CompareTo(rsr2SortString));
        }
 /// <summary>
 /// 設定學生社團參與記錄
 /// </summary>
 public void SetRSR(ResultScoreRecord rsr)
 {
     _ResultList.Add(rsr);
 }