Пример #1
0
        public static void Main(string[] args)
        {
            List <Emplyee> empList = new List <Emplyee>();

            empList.Add(new Emplyee()
            {
                Id = 101, Name = "Mark", Salary = 10000, Experience = 5
            });
            empList.Add(new Emplyee()
            {
                Id = 102, Name = "Mary", Salary = 10000, Experience = 4
            });
            empList.Add(new Emplyee()
            {
                Id = 103, Name = "Dom", Salary = 10000, Experience = 6
            });
            empList.Add(new Emplyee()
            {
                Id = 104, Name = "Piter", Salary = 10000, Experience = 4
            });
            empList.Add(new Emplyee()
            {
                Id = 105, Name = "Jerry", Salary = 10000, Experience = 5
            });

            Ispromoted ip = new Ispromoted(Promote);

            Emplyee.PromoteEmplyee(empList, ip);
        }
Пример #2
0
 public static void Promote(List <Employee> employeeslist, Ispromoted ispromoted)
 {
     foreach (var Employee in employeeslist)
     {
         //if(Employee.Experience >= 5 )   HARD CODEED FORM
         if (ispromoted(Employee))
         {
             Console.WriteLine(Employee.Name + "       xIs PROMOTED");
         }
     }
 }
Пример #3
0
 public static void PromoteEmplyee(List <Emplyee> EmplyeeList, Ispromoted IsEligiableToPromote)
 {
     foreach (Emplyee emplyee in EmplyeeList)
     {
         if (IsEligiableToPromote(emplyee))
         {
             Console.WriteLine(emplyee.Name + " Promoted");
             Console.ReadLine();
         }
     }
 }