예제 #1
0
        private List <PeriodInfo> ParseSchoolDay(IExcelDataReader reader, DayOfWeek day, bool isUpperRowOfWeek)
        {
            int dayColumnWidth             = PeriodHelper.GetCountOfPeriods();
            int firstPeriodAdditionalValue = SubjectSectionWidth + (dayColumnWidth * ((int)day - 1)) - 1;

            var periodsInfo = new List <PeriodInfo>();

            for (PeriodNumber number = PeriodNumber.First; PeriodHelper.IsValidPeriod(number); number++)
            {
                int column = firstPeriodAdditionalValue + (int)number;

                string info = GetStringValue(reader, column);

                var periodInfo = new PeriodInfo()
                {
                    Number = number
                };

                if (isUpperRowOfWeek)
                {
                    periodInfo.UpperInfo = info;
                }
                else
                {
                    periodInfo.LowerInfo = info;
                }

                periodsInfo.Add(periodInfo);
                //ConsoleHelper.WriteOk($"День: {currentDay}, Пара: {currentPeriod}, " +
                //    $"Вверх: {isUpperRowOfWeek}, Четная: {isEvenWeek}," + period);
            }

            return(periodsInfo);
        }