Exemplo n.º 1
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000));
            db.AddEmployee(new Employee("Berit", 2000));
            db.AddEmployee(new EmployeeWithAge("Christel", 1000, 20));

            //Create report generator and printer
            var reportGenerator = new EmployeeReportGenerator(db);
            var printer         = new Printer <IEmployee>(new EmployeeByNameFormatter());

            var report = reportGenerator.CompileReport();

            printer.Print(report);

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a age-first report
            printer.Formatter = new EmployeeByAgeFormatter();
            report            = reportGenerator.CompileReport();
            printer.Print(report);

            Console.ReadKey();
        }
Exemplo n.º 2
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000, 25));
            db.AddEmployee(new Employee("Berit", 2000, 74));
            db.AddEmployee(new Employee("Christel", 1000, 15));

            var reportGenerator = new ReportGenerator(db);

            // Create a default (name-first) report
            reportGenerator.CompileReport();

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a salary-first report
            reportGenerator.SetOutputFormat(new ReportSalaryFirst());
            reportGenerator.CompileReport();

            Console.WriteLine("");
            Console.WriteLine("");

            reportGenerator.SetOutputFormat(new ReportAgeFirst());
            reportGenerator.CompileReport();
        }
Exemplo n.º 3
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000, 20));
            db.AddEmployee(new Employee("Berit", 2000, 55));
            db.AddEmployee(new Employee("Christel", 1000, 24));

            dataCollectorEmployeeDB collector = new dataCollectorEmployeeDB(db);
            consolePrint            printer   = new consolePrint();
            Compiler compiler = new Compiler("Name");

            ReportGenerator RG = new ReportGenerator(printer, collector, compiler);

            // Create a default (name-first) report
            RG.start();

            Console.WriteLine("");
            Console.WriteLine("");

            compiler.ChangeFirst = "Salary";
            // Create a salary-first report
            RG.start();
            Console.WriteLine("");
            Console.WriteLine("");

            compiler.ChangeFirst = "Age";
            //age first
            RG.start();
            while (true)
            {
                ;
            }
        }
Exemplo n.º 4
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("ZUB", 1, 18));
            db.AddEmployee(new Employee("Magnus", 2, 36));
            db.AddEmployee(new Employee("Lasse", 3, 49));

            var SalaryreportGenerator = new SalaryFirstRP();
            var NamereportGenerator   = new NameFirstRP();
            var AgereportGenerator    = new AgeFirstRP();
            var ReportGenerator       = new ReportGenerator(db);

            ReportGenerator.CompileReport(NamereportGenerator);

            Console.WriteLine("");
            Console.WriteLine("");

            ReportGenerator.CompileReport(SalaryreportGenerator);

            Console.WriteLine("");
            Console.WriteLine("");

            ReportGenerator.CompileReport(AgereportGenerator);

            Console.WriteLine("");
            Console.WriteLine("");
        }
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000, 18));
            db.AddEmployee(new Employee("Berit", 2000, 20));
            db.AddEmployee(new Employee("Christel", 1000, 24));


            // Create a default (name-first) report
            var reportGenerator = new ReportGenerator_namefirst();

            reportGenerator.CompileReport(db);

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a salary-first report
            var reportGenerator2 = new ReportGenerator_salaryfirst();

            reportGenerator2.CompileReport(db);

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a salary-first report
            var reportGenerator3 = new ReportGenerator_agefirst();

            reportGenerator3.CompileReport(db);
        }
Exemplo n.º 6
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000, 32));
            db.AddEmployee(new Employee("Berit", 2000, 45));
            db.AddEmployee(new Employee("Christel", 1000, 54));

            IReport ReportType = new AgeFirst();

            var reportGenerator = new ReportGenerator(db, ReportType);

            // Create a default (name-first) report
            reportGenerator.CompileReport();

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a salary-first report
            reportGenerator._reportType = new SalaryFirst();
            reportGenerator.CompileReport();

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a age-first report
            reportGenerator._reportType = new AgeFirst();
            reportGenerator.CompileReport();
        }
Exemplo n.º 7
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000));
            db.AddEmployee(new Employee("Berit", 2000));
            db.AddEmployee(new Employee("Christel", 1000));

            var reportGenerator = new ReportGenerator(db, new ReportFormatSalaryFirst(), new ReportGetEmployees(db));

            reportGenerator.CompileReport();
        }
Exemplo n.º 8
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000));
            db.AddEmployee(new Employee("Berit", 2000));
            db.AddEmployee(new Employee("Christel", 1000));

            var reportGenerator = new ReportGenerator(db, new ReportFormatSalaryFirst(), new ReportGetEmployees(db));

            reportGenerator.CompileReport();
        }
Exemplo n.º 9
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000, 18));
            db.AddEmployee(new Employee("Berit", 2000, 20));
            db.AddEmployee(new Employee("Christel", 1000, 45));

            Console.WriteLine("");
            Console.WriteLine("");
            ReportGenerator.CompileReport(new EmployeeHandler(db), new ConsoleOutputter(), new AgeFirstFormatter());
        }
Exemplo n.º 10
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000));
            db.AddEmployee(new Employee("Berit", 2000));
            db.AddEmployee(new Employee("Christel", 1000));

            var reportGenerator = new ReportGenerator(db);

            // Create a default (name-first) report
            reportGenerator.CompileReport();

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a salary-first report
            reportGenerator.SetOutputFormat(ReportOutputFormatType.SalaryFirst);
            reportGenerator.CompileReport();
        }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000));
            db.AddEmployee(new Employee("Berit", 2000));
            db.AddEmployee(new Employee("Christel", 1000));

            var reportGenerator = new ReportGenerator(db);

            // Create a default (name-first) report
            reportGenerator.CompileReport();

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a salary-first report
            reportGenerator.SetOutputFormat(ReportOutputFormatType.SalaryFirst);
            reportGenerator.CompileReport();
        }
Exemplo n.º 12
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("ZUB ZUB", 1000000000));
            db.AddEmployee(new Employee("Magnus", 2000));
            db.AddEmployee(new Employee("Lasse", 1000));

            var SalaryreportGenerator = new SalaryFirstRG(db);
            var NamereportGenerator   = new NameFirstRG(db);

            // Create a Name-first salary report
            NamereportGenerator.CompileReport();

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a salary-first report
            SalaryreportGenerator.CompileReport();
        }
Exemplo n.º 13
0
        private static void Main()
        {
            var db = new EmployeeDB();

            // Add some employees
            db.AddEmployee(new Employee("Anne", 3000));
            db.AddEmployee(new Employee("Berit", 2000));
            db.AddEmployee(new Employee("Christel", 1000));

            var reportGenerator = new ReportGenerator(db);

            // Create a default (name-first) report
            IPrinter nameprinter = new NameFirst();

            reportGenerator.CompileReport(nameprinter);

            Console.WriteLine("");
            Console.WriteLine("");

            // Create a salary-first report
            IPrinter salprinter = new SalaryFirst();

            reportGenerator.CompileReport(salprinter);
        }