Esempio n. 1
0
        private void GenerateDecember(PdfPTable table)
        {
            var days  = DaysInDecember(16);                     // Get all dates from the first monday after an offset.
            var weeks = days.Select(w => w.Week).Distinct();    // Get all remaining weeks in december.

            // Iterate over all remaining weeks in december.
            foreach (var week in weeks)
            {
                var dates     = days.Where(d => d.Week == week).Select(d => d.Date);
                var generator = new Week.WeekGenerator
                {
                    Data            = new Data(),
                    Table           = table,
                    Number          = week,
                    Dates           = dates,
                    CellInformation = CellInformation
                };
                generator.Generate();
            }
        }
Esempio n. 2
0
        private void GenerateWeeks(PdfPTable table)
        {
            var days  = DatesAndWeeks();                        // Get information about the month: dates and weeks.
            var weeks = days.Select(w => w.Week).Distinct();    // Get all weeks in the month.

            // Iterate over all weeks in the month.
            foreach (var week in weeks)
            {
                var dates = days.Where(d => d.Week == week).Select(d => d.Date);    // Get all dates in the week.

                // Generate a week in the month.
                var generator = new Week.WeekGenerator
                {
                    Data            = Data,
                    Table           = table,
                    Number          = week,
                    Year            = Year,
                    Dates           = dates,
                    CellInformation = CellInformation
                };
                generator.Generate();
            }
        }