예제 #1
0
        static void Main(string[] args)
        {
            Employee joe = new Employee("Joe", 32, 0, (float)33.5, "123456789");

            joe.DisplayStatus();
            joe.Age++;
            joe.DisplayStatus();

            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Employee vova = new Employee(1, "Volodja", 21, 28000);

            vova.DisplayStatus();

            Employee dejv = new Employee(1, "Dejv", 32, 23000);

            dejv.DisplayStatus();

            Employee marv = new Employee();

            marv.ID   = 2;
            marv.Name = "Marvin";
            marv.Age  = 22;
            marv.Pay  = 20000;
            marv.DisplayStatus();


            Employee harry = new Employee();

            harry.ID   = 3;
            harry.Name = "Harry";
            harry.Age  = 23;
            harry.Pay  = 19011;
            harry.DisplayStatus();
        }
예제 #3
0
        static void Main(string[] args)
        {
            //Теперь все в порядке;
            Console.WriteLine("***** Fun with Encapsulation *****\n");
            Employee emp = new Employee("Marvin", 456, 30000);

            emp.GiveBonus(1000);
            emp.DisplayStatus();

            //Использование get/set для взаимодействия с именами объектов;
            emp.SetName("Marv");
            Console.WriteLine("Employee is named: {0}", emp.GetName());
            Console.ReadKey();
        }
예제 #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("**** Fun with encapsulation ****");
            Employee emp = new Employee("Marvin", 456, 100);

            emp.GiveBonus(30000);
            emp.DisplayStatus();
            Console.WriteLine();

            Employee jay = new Employee();

            jay.EmpAge++;
            jay.DisplayStatus();
            Console.WriteLine();

            emp.EmpName = "Marv";
            Console.WriteLine("Employee is named: {0}", emp.EmpName);
            Console.WriteLine();

            Console.ReadLine();
        }
예제 #5
0
            static void Main(string[] args)
            {
                Employee emp = new Employee("nit", 1, 2000, 29, 11);

                emp.DisplayStatus();
                emp.GiveBonous(1000.12);
                emp.DisplayStatus();
                //Employee.BenefitPacakage mypacakage ;  nested class .
                // mypacakage = new Employee.BenefitPacakage();
                // mypacakage.ComputePayDeduction();
                //emp.mypacakage.ComputePayDeduction();
                //Employee.BenefitPacakage.BenefitPacakgeLevel.myBenefitlevel = Employee.BenefitPacakage.BenefitPacakgeLevel.gold;

                ///
                emp.Name = "NitM";
                emp.Id   = 0;
                emp.Pay  = 4000;
                emp.DisplayStatus();

                ///

                Manager manager = new Manager("eddy", 1, 3000, 42, 14, 18);

                manager.DisplayStatus();
                manager.DispalyDentalHealthAllowance();
                Console.WriteLine("the stock options is {0}", manager.stockoptions);

                ///

                Manager manager1 = new Manager("felix", 2, 3500, 36, 17, 45);

                manager1.DisplayStatus();
                manager1.DispalyDentalHealthAllowance();
                Console.WriteLine("the stock option for felix is {0}", manager1.stockoptions);

                ///

                SalesPerson salesman = new SalesPerson("jenson", 3, 2200, 40, 09, 100);

                salesman.DisplayStatus();
                Console.WriteLine("the number of stock options is ", salesman.salesnumber);

                ///
                PTsalesperson timesalesperson = new PTsalesperson("selven", 4, 1000, 25, 08, 15, "4 hours");

                timesalesperson.DisplayStatus();
                Console.WriteLine("the work time for part time sales person is", timesalesperson.workingtime);



                /*
                 * Manager HeadManager = new Manager();
                 * HeadManager.Name = "Athul";
                 * HeadManager.Id = 1;
                 * HeadManager.Pay = 3000;
                 * HeadManager.Age = 41;
                 * HeadManager.stockoptions = 12;
                 *
                 *
                 * HeadManager.DisplayStatus();
                 * Console.WriteLine("The number of stockoptions {0}", HeadManager.stockoptions);
                 */



                ///



                Console.ReadLine();
            }