Esempio n. 1
0
 public static bool Promoted(Employeee emp)
 {
     if (emp.Experience >= 5)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
        //public static void Main()
        //{
        public static void test()
        {
            List <Employeee> empList = new List <Employeee>();

            empList.Add(new Employeee()
            {
                ID = 101, Name = "A", Salary = 101, Experience = 1
            });
            empList.Add(new Employeee()
            {
                ID = 101, Name = "B", Salary = 101, Experience = 5
            });
            empList.Add(new Employeee()
            {
                ID = 101, Name = "C", Salary = 101, Experience = 6
            });

            ISPromotable isPromotable = new ISPromotable(Promoted);

            Employeee.Promote(empList, isPromotable);
        }