コード例 #1
0
ファイル: SheetInfo.cs プロジェクト: hiearth/ExchangeStudent
 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);
     }
 }
コード例 #2
0
ファイル: SheetInfo.cs プロジェクト: hiearth/ExchangeStudent
 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);
         }
     }
 }
コード例 #3
0
ファイル: SheetInfo.cs プロジェクト: hiearth/ExchangeStudent
 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;
 }
コード例 #4
0
ファイル: SheetInfo.cs プロジェクト: hiearth/ExchangeStudent
 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);
             }
         }
     }
 }
コード例 #5
0
ファイル: SheetInfo.cs プロジェクト: hiearth/ExchangeStudent
 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;
 }