Example #1
0
        private static void TestVisitors(AbstractCompanyEntity company)
        {
            // Test Company Search
            // Search whole company for any group or employee with an "a" in its name
            CompanySearch client = new CompanySearch(company);

            Console.WriteLine("Enter Search Query: ");
            var results = client.Search(Console.ReadLine());

            Console.WriteLine("\nResults:");
            foreach (var x in results)
            {
                Console.WriteLine(x.Name);
            }
            Console.WriteLine("\nPress enter to continue.\n");
            Console.ReadKey();

            Console.WriteLine("Full Company Structure:\n");
            // Test Printer
            CompanyPrinter.Print(company);
            Console.Write("\nCompany Utilization: ");
            Console.Write(company.Utilization + "\n");

            Console.WriteLine();
        }
Example #2
0
 public CompanySearch(AbstractCompanyEntity company)
 {
     _company = company;
 }
Example #3
0
 public static void Print(AbstractCompanyEntity company)
 {
     company.AcceptVisitor(Visitor);
 }
Example #4
0
 public CompanyBuilder(string name)
 {
     _company = new Group(name);
 }