Example #1
0
        public void Main()
        {
            Employee ricky = new Employee {
                Id = 1, Name = "ricky", Rating = 3
            };
            Employee mike = new Employee {
                Id = 2, Name = "mike", Rating = 4
            };
            Employee maryann = new Employee {
                Id = 3, Name = "maryann", Rating = 5
            };
            Employee ginger = new Employee {
                Id = 4, Name = "ginger", Rating = 3
            };
            Employee olive = new Employee {
                Id = 5, Name = "olive", Rating = 4
            };
            Employee candy = new Employee {
                Id = 5, Name = "candy", Rating = 5
            };

            Supervisor ronny = new Supervisor {
                Id = 7, Name = "ronny", Rating = 3
            };
            Supervisor bob = new Supervisor {
                Id = 8, Name = "bob", Rating = 3
            };

            ronny.AddSubordinate(ricky);
            ronny.AddSubordinate(mike);
            ronny.AddSubordinate(maryann);

            bob.AddSubordinate(ginger);
            bob.AddSubordinate(olive);
            bob.AddSubordinate(candy);

            Console.WriteLine("Employee can see their Performance ");
            Console.WriteLine("summary");

            ricky.PerformanceSummary();

            Console.WriteLine("Supervisor can also see their subordinates performance summary -----");
            ronny.PerformanceSummary();

            Console.WriteLine("\nSubordinate Performance Record:");
            foreach (var employee in ronny.ListSubordinates)
            {
                employee.PerformanceSummary();
            }
        }
Example #2
0
        // CLIENT
        static void Main(string[] args)
        {
            var emp1 = new Employee
            {
                EmployeeId = 1,
                Name       = "Ricky",
                Rating     = 3
            };

            var emp2 = new Employee
            {
                EmployeeId = 2,
                Name       = "Mike",
                Rating     = 2
            };

            var super = new Supervisor
            {
                EmployeeId = 3,
                Name       = "Boss",
                Rating     = 5
            };

            var super2 = new Supervisor
            {
                EmployeeId = 4,
                Name       = "Bobby",
                Rating     = 1
            };

            super.AddSubordinate(emp1);
            super2.AddSubordinate(emp2);

            super.PerformanceSummary();

            foreach (var e in super.Subordinates)
            {
                e.PerformanceSummary();
            }
        }
Example #3
0
        public static void Main()
        {
            Employee peter =
                new Employee {
                EmployeeID = 1, Name = "peter", Rating = 3
            };

            Employee george =
                new Employee {
                EmployeeID = 2, Name = "george", Rating = 4
            };

            Employee john =
                new Employee {
                EmployeeID = 3, Name = "john", Rating = 5
            };

            Employee adam =
                new Employee {
                EmployeeID = 4, Name = "adam", Rating = 3
            };

            Employee martin =
                new Employee {
                EmployeeID = 5, Name = "martin", Rating = 4
            };

            Employee jenny =
                new Employee {
                EmployeeID = 6, Name = "jenny", Rating = 5
            };

            Supervisor michael =
                new Supervisor {
                EmployeeID = 7, Name = "michael", Rating = 3
            };

            Supervisor justin =
                new Supervisor {
                EmployeeID = 8, Name = "justin", Rating = 3
            };

            michael.AddSubordinate(peter);
            michael.AddSubordinate(george);
            michael.AddSubordinate(john);

            justin.AddSubordinate(adam);
            justin.AddSubordinate(martin);
            justin.AddSubordinate(jenny);

            Console.WriteLine($"{Environment.NewLine}--- Employee can see their Performance " + "Summary --------");
            peter.PerformanceSummary();

            Console.WriteLine($"{Environment.NewLine}--- Supervisor can also see their " + "subordinates performance summary-----");
            michael.PerformanceSummary();

            Console.WriteLine($"{Environment.NewLine}Subordinate Performance Record:");

            foreach (IEmployee employee in michael.ListSubordinates)
            {
                employee.PerformanceSummary();
            }
        }
Example #4
0
        static void Main()
        {
            Employee ricky =
                new Employee {
                EmployeeID = 1, Name = "ricky", Rating = 3
            };

            Employee mike =
                new Employee {
                EmployeeID = 2, Name = "mike", Rating = 4
            };

            Employee maryann =
                new Employee {
                EmployeeID = 3, Name = "maryann", Rating = 5
            };

            Employee ginger =
                new Employee {
                EmployeeID = 4, Name = "ginger", Rating = 3
            };

            Employee olive =
                new Employee {
                EmployeeID = 5, Name = "olive", Rating = 4
            };

            Employee candy =
                new Employee {
                EmployeeID = 6, Name = "candy", Rating = 5
            };

            Supervisor ronny =
                new Supervisor {
                EmployeeID = 7, Name = "ronny", Rating = 3
            };

            Supervisor bobby =
                new Supervisor {
                EmployeeID = 8, Name = "bobby", Rating = 3
            };

            ronny.AddSubordinate(ricky);
            ronny.AddSubordinate(mike);
            ronny.AddSubordinate(maryann);

            bobby.AddSubordinate(ginger);
            bobby.AddSubordinate(olive);
            bobby.AddSubordinate(candy);

            Console.WriteLine("\n--- Employee can see their Performance " +
                              "Summary --------");
            ricky.PerformanceSummary();

            Console.WriteLine("\n--- Supervisor can also see their " +
                              "subordinates performance summary-----");
            ronny.PerformanceSummary();

            Console.WriteLine("\nSubordinate Performance Record:");
            foreach (Employee employee in ronny.ListSubordinates)
            {
                employee.PerformanceSummary();
            }

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            try
            {
                Employee fulano = new Employee {
                    EmployeeID = 1, Name = "Fulano", Rating = 3
                };
                Employee cicrano = new Employee {
                    EmployeeID = 2, Name = "Cricrano", Rating = 4
                };
                Employee bertolano = new Employee {
                    EmployeeID = 3, Name = "Bertolano", Rating = 5
                };

                Employee ryu = new Employee {
                    EmployeeID = 1, Name = "Ryu", Rating = 3
                };
                Employee ken = new Employee {
                    EmployeeID = 2, Name = "Ken", Rating = 4
                };

                Supervisor chefao_1 = new Supervisor {
                    EmployeeID = 7, Name = "Chefão 1", Rating = 3
                };
                Supervisor chefao_2 = new Supervisor {
                    EmployeeID = 7, Name = "Chefão 2", Rating = 3
                };

                chefao_1.AddSubordinate(fulano);
                chefao_1.AddSubordinate(cicrano);
                chefao_1.AddSubordinate(bertolano);

                chefao_2.AddSubordinate(ryu);
                chefao_2.AddSubordinate(ken);

                Console.WriteLine("--- Employes  --------");
                fulano.PerformanceSummary();
                cicrano.PerformanceSummary();
                bertolano.PerformanceSummary();

                ryu.PerformanceSummary();
                ken.PerformanceSummary();

                Console.WriteLine("--- Superwiser and yours employes -----");

                chefao_1.PerformanceSummary();

                Console.WriteLine("Subordinate s:");
                foreach (Employee employee in chefao_1.ListSubordinates)
                {
                    employee.PerformanceSummary();
                }

                chefao_2.PerformanceSummary();

                Console.WriteLine("Subordinate s:");
                foreach (Employee employee in chefao_2.ListSubordinates)
                {
                    employee.PerformanceSummary();
                }
            }
            finally
            {
                Console.ReadKey();
            }
        }