Exemple #1
0
        static void Main(string[] args)
        {
            //print1 ob1 = new print1(print);
            //ob1("welcome");
            List <Employee> ob1 = new List <Employee>();

            ob1.Add(new Employee()
            {
                id = 1, name = "A", salary = 100, experience = 5
            });
            ob1.Add(new Employee()
            {
                id = 2, name = "B", salary = 200, experience = 3
            });
            ob1.Add(new Employee()
            {
                id = 3, name = "C", salary = 300, experience = 2
            });
            ob1.Add(new Employee()
            {
                id = 4, name = "D", salary = 400, experience = 8
            });
            ob1.Add(new Employee()
            {
                id = 5, name = "E", salary = 500, experience = 9
            });
            Employee ob2   = new Employee();
            promote  objct = new promote(ispromotable);

            ob2.promoteEmp(ob1, objct);
        }
Exemple #2
0
 public void promoteEmp(List <Employee> emp, promote eligible)
 {
     foreach (Employee Emp in emp)
     {
         if (eligible(Emp) != true)
         {
             Console.WriteLine("promoted" + Emp.name);
         }
     }
 }