Example #1
0
        public static void Main()
        {
            var builder = new ReportBuilder();
            var sender = new SmsReportSender();
            var reporter = new Reporter(builder, sender);

            reporter.SendReports();
        }
        public void SendReports()
        {
            var reportBuilder = new ReportBuilder();
            IList<Report> reports = reportBuilder.CreateReports();

            if (reports.Count == 0)
                throw new NoReportsException();

            var reportSender = new EmailReportSender();
            foreach (Report report in reports)
            {
                reportSender.Send(report);
            }
        }
        public void SendReports()
        {
            var            reportBuilder = new ReportBuilder();
            IList <Report> reports       = reportBuilder.CreateReports();

            if (reports.Count == 0)
            {
                throw new NoReportsException();
            }

            var reportSender = new EmailReportSender();

            foreach (Report report in reports)
            {
                reportSender.Send(report);
            }
        }