Esempio 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 Employee("Christel", 1000));

            Ireports reportGenerator = new NameFirstGenerator(db);

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

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

            // Create a salary-first report

            reportGenerator = new salaryFirstGenerator(db);
            reportGenerator.print();

            Console.WriteLine("");
            Console.WriteLine("");
        }
Esempio n. 2
0
 public salaryFirstGenerator(EmployeeDB dbParam) : base(dbParam)
 {
     if (dbParam == null)
     {
         throw new ArgumentNullException("employeeDb");
     }
     db = dbParam;
 }