Пример #1
0
        public void PersonTests()
        {
            Person me = new Person();

            me.FirstName = "Evan";
            me.LastName  = "Lacy";

            Employee dwight = new Employee(12345);

            dwight.FirstName = "Dwight";
            dwight.LastName  = "Schrute";
            Console.WriteLine(dwight.Name);
            Console.WriteLine(dwight.EmployeeNumber);

            SalaryEmployee jim = new SalaryEmployee(354684, 456789);

            jim.FirstName = "Jim";
            jim.LastName  = "Halpert";
            Console.WriteLine(jim.Name);
            Console.WriteLine(jim.EmployeeNumber);
            Console.WriteLine(jim.Salary);

            List <Employee> ListOfEmployee = new List <Employee>();

            ListOfEmployee.Add(dwight);
            ListOfEmployee.Add(jim);
            //ListOfEmployee.Add(me);
        }
Пример #2
0
        public void PersonTests()
        {
            Person me = new Person();

            me.FirstName = "Andrew";
            me.LastName  = "Gorg";
            Console.WriteLine(me.Name);

            Employee dwight = new Employee(12345);

            dwight.FirstName = "Dwight";
            dwight.LastName  = "Schrute";
            Console.WriteLine(dwight.Name);
            Console.WriteLine(dwight.EmployeeNumber);

            SalaryEmployee jim = new SalaryEmployee(12333, 60000);

            jim.FirstName = "Jim";
            Console.WriteLine(jim.FirstName);
            Console.WriteLine(jim.EmployeeNumber);
            Console.WriteLine(jim.Salary);

            List <Person> ListOfPeople = new List <Person>();

            ListOfPeople.Add(jim);
            ListOfPeople.Add(dwight);
            ListOfPeople.Add(me);
        }
        public void PersonExamples() {
            //var person = new Person();
            //person.FirstName = "Brian";
            var customer = new Customer(true, "Brian", "Campassi", "3174209614", "*****@*****.**");
            //customer.Email = "*****@*****.**";

            var employee = new Employee();
            employee.FirstName = "Joe";
            employee.HireDate = DateTime.Now;

            var hourlyEmployee = new HourlyEmployee();
            hourlyEmployee.FirstName = "John";
            hourlyEmployee.HourlyWage = 15.00m;

            var salaryEmployee = new SalaryEmployee();
            salaryEmployee.FirstName = "Jason";
            salaryEmployee.Salary = 75000;

            List<Person> people = new List<Person>();
            //people.Add(person);       can't use person anymore directly after it has been assigned to base
            people.Add(customer);
            people.Add(employee);   //We can add all these variations of "people" to the same list 

        }