예제 #1
0
 public void RemoveEmployee(Employee employee)
 {
     _employee.Remove(employee);
 }
예제 #2
0
        static void Main(string[] args)
        {
            List <Department> departments = new List <Department>();

            HumanResources hr        = new HumanResources("HR", "Bob", 5);
            InfoTech       it        = new InfoTech("IT", "John", 3);
            Marketing      marketing = new Marketing("Marketing", "Anna", 10);


            departments.Add(hr);
            departments.Add(it);
            departments.Add(marketing);

            //methods of each department
            // hr.AddPolicy("Smoking", "No smoking inside the building");
            // it.AddHardware("Marketing", "laptop");
            // marketing.AddMaterial("Brochures", 100);

            // marketing.UseMaterial("Flyers", 30);
            // marketing.UseMaterial("Brochures", 25);

            // sets base budget
            double baseBudget = 75000.00;

            //creates new employees
            Employee            bob     = new Employee("Bob", "Jones");
            Employee            jessica = new Employee("Jessica", "Doe");
            MarketingPTEmployee george  = new MarketingPTEmployee("George", "Lane");
            HREmployee          fred    = new HREmployee("Fred", "Dark");

            //adds employees that bob eats lunch with to bob's companion list
            bob.companions.Add(jessica);
            bob.companions.Add(george);

            // bob.eat("burgers", bob.companions);

            fred.Salary = 20;
            Console.WriteLine("fred salary: $" + fred.Salary);

            george.HourlyRate = 13;
            Console.WriteLine("george weekly pay: $" + george.PayForHours(20));


            hr.AddEmployee(fred);
            marketing.AddEmployee(jessica);
            hr.AddEmployee(bob);
            it.AddEmployee(george);


            foreach (Department d in departments)
            {
                Console.WriteLine($"Department: {d.DeptName}");
                foreach (Employee e in d.EmployeeList)
                {
                    Console.WriteLine($"    {e.FullName}");
                }
            }

            foreach (Department d in departments)
            {
                d.SetBudget(baseBudget);
                Console.WriteLine($"{d.toString()}");
            }
        }
예제 #3
0
 public void AddEmployee(Employee employee)
 {
     _employee.Add(employee);
 }