Beispiel #1
0
 private void UpdateStudentInfo(Student student, Range row, int applySortCol, int studentAppliesCol)
 {
     for (int colIndex = 1; colIndex < _columnCount; colIndex++)
     {
         Range cell = row.Cells[colIndex];
         string infoValue = SheetHelper.GetCellText(cell);
         string infoName = _headRow.GetColumnName(colIndex);
         student.AppendInfo(infoName, infoValue);
     }
 }
Beispiel #2
0
 private void RemoveStudentInGroups(List<KeyValuePair<Student, List<ExchangeApply>>> studentGroups, Student approvedStudent)
 {
     for (int i = studentGroups.Count - 1; i >= 0; i--)
     {
         if (studentGroups[i].Key == approvedStudent)
         {
             studentGroups.RemoveAt(i);
         }
     }
 }
Beispiel #3
0
 private Student ParseStudent(Range row, int studentIdCol, int applySortCol, int studentAppliesCol)
 {
     Range cell = row.Cells[studentIdCol];
     string studentId = SheetHelper.GetCellText(cell);
     Student student = TryGetStudent(studentId);
     if (student == null)
     {
         student = new Student(studentId);
         ParseStudentInfo(student, row, applySortCol, studentAppliesCol);
         _students.Add(student);
     }
     else
     {
         UpdateStudentInfo(student, row, applySortCol, studentAppliesCol);
     }
     return student;
 }
Beispiel #4
0
 private void RemoveApplyInProjectGroups(List<KeyValuePair<ApplyProject, List<ExchangeApply>>> projectGroups, Student approvedStudent)
 {
     for (int projectIndex = projectGroups.Count - 1; projectIndex >= 0; projectIndex--)
     {
         List<ExchangeApply> applies = projectGroups[projectIndex].Value;
         for (int applyIndex = applies.Count - 1; applyIndex >= 0; applyIndex--)
         {
             if (applies[applyIndex].OwnerStudnet == approvedStudent)
             {
                 applies.RemoveAt(applyIndex);
             }
         }
     }
 }
Beispiel #5
0
 private int GetAvailableHighestPriority(List<KeyValuePair<Student, List<ExchangeApply>>> studentGroups,Student student)
 {
     foreach (var group in studentGroups)
     {
         if (group.Key == student)
         {
             List<ExchangeApply> applies = group.Value;
             if (applies != null && applies.Count > 0)
             {
                 return applies[0].Priority;
             }
         }
     }
     return 0;
 }