Beispiel #1
0
        public void SelectObjectType(string selector)
            {
                // ReSharper disable once ObjectCreationAsStatement
                //new object();


                switch (selector)
                {
                    case "1":

                        TypeToFind = new Employee();

                        break;
                    case "2":

                        TypeToFind = new Executive();
                        break;
                    case "3":

                        TypeToFind = new SalesPerson();
                        break;
                }
            }
Beispiel #2
0
        private void CreateSalesPeople()
        {
            SalesPerson sp = new SalesPerson();

            sp.emp.Age = 34;
            sp.emp.Department = "Marketing";
            sp.emp.Name = "Frank Wills";
            sp.emp.Salary = 23500.00F;
            sp.YTD_Sales= 1039400;

            objList.Add(sp);


            sp.emp.Age = 55;
            sp.emp.Department = "HR";
            sp.emp.Name = "Mary Tee";
            sp.emp.Salary = 67500.00F;
            sp.YTD_Sales = 9556400;

            objList.Add(sp);



        }
Beispiel #3
0
 public ObjectProcessor(SalesPerson spTemplate, Executive exTemplate)
 {
     _spTemplate = spTemplate;
     _exTemplate = exTemplate;
 }