Пример #1
0
        static void Main(string[] args)
        {
            Employee[] emp1 = new Employee[2];
            emp1[0] = new Permanente("kailas", 50000);
            emp1[1] = new temporary("prath", 6000);

            for (int i = 0; i < emp1.Length; i++)
            {
                emp1[i].employee += message.sendmsg;
            }

            double d1 = emp1[0].givebonus();
            double d2 = emp1[1].givebonus();


            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Employee[] emp1 = new Employee[2];
            emp1[0] = new Permanente("kailas", 50000);
            emp1[1] = new temporary("prath", 6000);

            for (int i = 0; i < emp1.Length; i++)
            {
                emp1[i].employee += (double sal, string name, double bonus) => Console.WriteLine("message send....salry={0} name={1} bonus={2}", sal, name, bonus);
            }

            double d1 = emp1[0].givebonus();
            double d2 = emp1[1].givebonus();


            Console.ReadLine();
        }