コード例 #1
0
        static void Main()
        {
            Sale phone = new Sale("Apple", new DateTime(2014, 12, 02), 850);
            Sale laptop = new Sale("Asus", new DateTime(2013, 03, 04), 1250);
            Sale graphicsCard = new Sale("Nvidia", new DateTime(2014, 11, 11), 450);
            Sale bike = new Sale("BMX", new DateTime(2014, 12, 12), 650);
            Sale dumbbells = new Sale("Smart bells", new DateTime(2011, 05, 27), 50);

            List<Sale> electronics = new List<Sale>();
            electronics.Add(phone);
            electronics.Add(laptop);
            electronics.Add(graphicsCard);

            List<Sale> sports = new List<Sale>();
            sports.Add(bike);
            sports.Add(dumbbells);

            SalesEmployee maria = new SalesEmployee("014", "Pesho", "Peshkov", 9400, Department.Accounting, electronics);
            SalesEmployee david = new SalesEmployee("015", "Gosho", "Goshev", 6900, Department.Sales, sports);

            List<Employee> salesExperts = new List<Employee>();
            salesExperts.Add(maria);
            salesExperts.Add(david);

            Manager george = new Manager("005", "Baharii", "Zaharov", 4300, Department.Marketing, salesExperts);

            Project companyMobileApp = new Project("Company Mobile App", new DateTime(2014, 04, 03), State.Closed);
            Project antiHackingTool = new Project("Anti Hacking Tool", new DateTime(2014, 12, 03), State.Open);

            List<Project> importantProjects = new List<Project>();
            importantProjects.Add(antiHackingTool);
            importantProjects.Add(companyMobileApp);


            Developer mikey = new Developer("004", "Razvrigor", "Razvrigorov", 5000, Department.Production, importantProjects);

            List<Employee> employees = new List<Employee>();
            employees.Add(maria);
            employees.Add(david);
            employees.Add(george);
            employees.Add(mikey);

            foreach (var employee in employees)
            {
                Console.WriteLine(employee);
            }
        }
        static void Main(string[] args)
        {

            Manager manager = new Manager("12191311", "Yordan", "Todorov", 4000m, "Sales",
           new List<Employee> {
                { new Employee("12191311", "Stoyan", "Dimov", 2000m, "Sales")},
                { new Employee("1219131", "Dimitur", "Petrov", 1700m, "Sales")},
                { new Employee("12191311", "Mariq", "Ivanova", 2300m, "Sales")},
           });

            Manager managerSecond = new Manager("19112311", "Ivan", "Ivanov", 3500, "Marketing",
           new List<Employee> {
                { new Employee("12191311", "Gosho", "Goshov", 1200m, "Marketing")},
                { new Employee("1219131", "Dragan", "Draganov", 2700m, "Marketing")},
                { new Employee("12191311", "Pesho", "Peshov", 1000m, "Marketing")},
           });
            SalesEmployee salesEmployee = new SalesEmployee("78873465", "Ivan", "Marinov", 8800m, "Production",
             new List<Sale> {
                { new Sale("12345678", DateTime.Parse("01.4.13"), 2700)},
                { new Sale("98765432", DateTime.Parse("21.8.15"), 20000)},
                { new Sale("35715964", DateTime.Parse("17.3.14"), 3500)},
                { new Sale("75915346", DateTime.Parse("22.12.12"), 3400)}
             });

            Developer developer = new Developer("11111111", "Mira", "Dimitrova", 5000m, "Accounting",
               new List<Project> {
                { new Project("Money", DateTime.Parse("12.9.2011"), "The project makes money")},
                { new Project("Moneyyyyy", DateTime.Parse("21.11.2015"), "The project makes money,too")}
               });
            List<Employee> list = new List<Employee>() {manager,managerSecond,salesEmployee,developer};

            foreach (var l in list)
            {
                Console.WriteLine(l);
                Console.WriteLine();
            }
        }