Example #1
0
 private void FillDisciplineInfo(int?SemesterRate, int?SemesterMaxRate)
 {
     DisciplineInfo = new DisciplineInfo();
     {
         FillBaseDisInfo();
         if (DisciplineInfo.IsExam)
         {
             FillExamInfo(SemesterRate, SemesterMaxRate);
         }
         else
         {
             FillCreditInfo(SemesterRate);
         }
     };
 }
Example #2
0
        private void FillBaseDisInfo()
        {
            DisciplineInfo.Type = StudentDiscipline.Discipline.Type switch
            {
                "exam" => "Экзамен",
                "credit" => "Зачет",
                "grading_credit" => "Дифф. зачет",
                _ => StudentDiscipline.Discipline.Type,
            };
            var year = StudentDiscipline.Discipline.SemesterYear;

            DisciplineInfo.SemesterName = $"{(StudentDiscipline.Discipline.SemesterNum == 1 ? "Осенний" : "Весенний")} семестр {year}/{year + 1} учебного года";
            DisciplineInfo.Teachers     = string.Join('\n', StudentDiscipline.Teachers.Select(t => t.Name));
            DisciplineInfo.StudyLoad    = DisciplineInfo.StudyLoadToText(StudentDiscipline.Discipline.Lectures, StudentDiscipline.Discipline.Practice, StudentDiscipline.Discipline.Labs);

            DisciplineInfo.IsExam      = StudentDiscipline.Discipline.Type == "exam";
            DisciplineInfo.IsBonus     = StudentDiscipline.Discipline.IsBonus;
            DisciplineInfo.IsExtraRate = StudentDiscipline.ExtraRate > 0;
            DisciplineInfo.IsExamOrBonusOrExtraRate = DisciplineInfo.IsExam || DisciplineInfo.IsBonus || DisciplineInfo.IsExtraRate;
        }