private static void Main()
        {
            SalesEmployee salesEmployee = new SalesEmployee(
                "Pesho",
                "Petrov",
                "b02s5",
                950m,
                "Sales",
                new List <Sale>
            {
                new Sale("Mouse", DateTime.Parse("2.6.2015"), 12.5m),
                new Sale("Laptop", DateTime.Parse("02.10.2015"), 650m)
            });

            Developer developer = new Developer(
                "Ivan",
                "Ivanov",
                "023F65",
                5000m,
                "Production",
                new List <Project>
            {
                new Project(
                    "Project one",
                    DateTime.Parse("12.11.2015"),
                    "Open",
                    "Project one makes money!"),
                new Project(
                    "Project two",
                    DateTime.Parse("2.1.2005"),
                    "Close",
                    "Project two makes more money")
            });

            Manager manager = new Manager(
                "Gosho",
                "Goshev",
                "550215",
                4000m,
                "Accounting",
                new List <Employee>
            {
                new Employee("Iveta", "Petkova", "B023545", 900m, "Accounting"),
                new Employee("Todor", "Todorov", "S03258", 850m, "Accounting")
            });

            List <Employee> all = new List <Employee> {
                salesEmployee, developer, manager
            };

            foreach (var employee in all)
            {
                Console.WriteLine(employee);
            }

            Customer customer = new Customer("Petya", "Ivanova", "253695", 2000m);

            Console.WriteLine(customer);
        }
Exemplo n.º 2
0
        static void Main()
        {
            List <Project> projects = new List <Project>
            {
                new Project("RPG", new DateTime(2015, 6, 7), "The new Skyrim"),
                new Project("FPS", new DateTime(2015, 4, 5), "The new CS"),
                new Project("MMORPG", new DateTime(2015, 1, 2), "The new WoW")
            };

            List <Employee> devs = new List <Employee>
            {
                new Developer(3, "Jon", "Skeet", 950m, projects),
                new Developer(2, "Jenny", "Skeet", 1000m, projects)
            };

            Manager devManager = new Manager(15, "Pesho", "Peshev", 1200m, Departament.Production, devs);

            List <Sale> sales = new List <Sale>
            {
                new Sale("Server PC", new DateTime(2015, 6, 12), 1800m),
                new Sale("SSD", new DateTime(2015, 6, 13), 250m),
                new Sale("Laptop", new DateTime(2015, 6, 14), 850m)
            };

            List <Employee> salesEmployees = new List <Employee>
            {
                new SalesEmployee(243501, "Robert", "Baratheon", 1850m, sales),
                new SalesEmployee(654854, "Ned", "Stark", 1650m, sales)
            };

            Manager salesManager = new Manager(1, "Gosho", "Goshev", 2000m, Departament.Sales, salesEmployees);

            var peter = new SalesEmployee(5135, "Peter", "Petrov", 1200m,
                                          new List <Sale>
            {
                new Sale("BMW", new DateTime(2015, 6, 13), 10500m)
            });

            var bob = new Developer(4255, "Bob", "Smith", 990m,
                                    new List <Project>
            {
                new Project("Alpha Centauri", new DateTime(2015, 3, 3), "Star tracking System")
            });

            List <Employee> workers = new List <Employee> {
                devManager, salesManager, peter, bob
            };

            foreach (Employee worker in workers)
            {
                Console.WriteLine(worker);
            }
        }
Exemplo n.º 3
0
        private static void Main()
        {
            Sale motor    = new Sale("Harly-Marly", "01.12.2006", 1500M);
            Sale car      = new Sale("Peugeot", "02.04.2007", 25000M);
            Sale britanik = new Sale("Britanik", "03.03.2005", 2005340000M);
            Sale plane    = new Sale("Boeing 747", "05.03.2010", 41341341413M);

            SalesEmployee lili        = new SalesEmployee("dasdasda", "Lilia", "Vulkova", 1000M, DepartmentType.Accountng);
            SalesEmployee georgi      = new SalesEmployee("dasd213", "Georgi", "Botushkov", 4500M, DepartmentType.Marketing);
            SalesEmployee georgiNikol = new SalesEmployee("dasd213", "Georgi-Kolio", "Kop-kop", 4500M, DepartmentType.Marketing);

            lili.AddSale(motor);
            lili.AddSale(car);

            georgi.AddSale(plane);

            georgiNikol.AddSale(britanik);
            georgiNikol.AddSale(plane);

            Project softwareCar   = new Project("Software: Peugeot", "22.11.2013", "Software for car", "open");
            Project softwareMotor = new Project("Software: Harly-Marly", "23.03.2013", "Software for motor", "closed");

            Developer maik = new Developer("sad3441", "Maik", "Taison", 5000M, DepartmentType.Sales);

            maik.AddProject(softwareCar);
            maik.AddProject(softwareMotor);

            Manager tosho = new Manager("122121", "Tihomir", "Spasov", 1200M, DepartmentType.Accountng);
            Manager sasho = new Manager("21435", "Sasho", "Todorov", 1550, DepartmentType.Sales);

            tosho.AddEmployeesToCommand(maik);
            tosho.AddEmployeesToCommand(georgiNikol);

            sasho.AddEmployeesToCommand(georgi);

            Employee[] allEmployees = new Employee[6] {
                lili, georgi, georgiNikol, maik, tosho, sasho
            };

            foreach (var employee in allEmployees)
            {
                Console.WriteLine(employee);
            }

            //Here trying the exception
            //Sale ship = new Sale("Titanik", "03.03.1995", 2000000000M);

            //Exception
            //Developer ronda = new Developer("Shtetenabiq", "Ronda", "Rousey", 21443M, "Poboinicite", projectsMotor);

            //Exception
            //Project softwareShip = new Project("Software: Britanik", "23.03.2004", "Software for ship", "ne go znam");
        }
Exemplo n.º 4
0
        static void Main()
        {
            List<Project> projects = new List<Project>
            {
                new Project("RPG", new DateTime(2015, 6, 7), "The new Skyrim"),
                new Project("FPS", new DateTime(2015, 4, 5), "The new CS"),
                new Project("MMORPG", new DateTime(2015, 1, 2), "The new WoW")
            };

            List<Employee> devs = new List<Employee>
            {
                new Developer(3, "Jon", "Skeet", 950m, projects),
                new Developer(2, "Jenny", "Skeet", 1000m, projects)
            };

            Manager devManager = new Manager(15, "Pesho", "Peshev", 1200m, Departament.Production, devs);

            List<Sale> sales = new List<Sale>
            {
                new Sale("Server PC", new DateTime(2015, 6, 12), 1800m),
                new Sale("SSD", new DateTime(2015, 6, 13), 250m),
                new Sale("Laptop", new DateTime(2015, 6, 14), 850m)
            };

            List<Employee> salesEmployees = new List<Employee>
            {
                new SalesEmployee(243501, "Robert", "Baratheon", 1850m, sales),
                new SalesEmployee(654854, "Ned", "Stark", 1650m, sales)
            };

            Manager salesManager = new Manager(1, "Gosho", "Goshev", 2000m, Departament.Sales, salesEmployees);

            var peter = new SalesEmployee(5135, "Peter", "Petrov", 1200m,
                new List<Sale>
                {
                    new Sale("BMW", new DateTime(2015,6,13), 10500m)
                });

            var bob = new Developer(4255, "Bob", "Smith", 990m,
                new List<Project>
                {
                    new Project("Alpha Centauri", new DateTime(2015, 3, 3), "Star tracking System")
                });

            List<Employee> workers = new List<Employee> {devManager, salesManager, peter, bob};

            foreach (Employee worker in workers)
            {
                Console.WriteLine(worker);
            }
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            SalesEmployee retailer = new SalesEmployee(12, "Ivan", "Ivanov", Department.Marketing, 500, new Sale("notebook", 340));

            Employee[] employees =
            {
                retailer,
                new Manager(28882,    "Mlad",   "Marinjay", Department.Marketing,  5500, retailer),
                new Developer(534,    "Angel",  "Georgiev", Department.Production, 2300, new Project("Code")),
                new SalesEmployee(342,"Stoqn",  "Ivanov",   Department.Accounting, 1200, new Sale("Neshto",0)),
            };

            foreach (var employee in employees)
            {
                Console.WriteLine(employee);
            }
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Manager manager1 = new Manager("0000000001", "Manager1", "Manager1 Last name", Department.Accounting, 123m);
            Manager manager2 = new Manager("0000000002", "Manager2", "Manager2 Last name", Department.Sales, 3124m);
            Manager manager3 = new Manager("0000000003", "Manager2", "Manager2 Last name", Department.Marketing, 1423m);

            SalesEmployee salesEmployee1 = new SalesEmployee("0000000004", "SalesEmployee1", "SalesEmployee1 Last name", Department.Accounting, 512m);
            SalesEmployee salesEmployee2 = new SalesEmployee("0000000005", "SalesEmployee2", "SalesEmployee2 Last name", Department.Marketing, 513m);
            SalesEmployee salesEmployee3 = new SalesEmployee("0000000006", "SalesEmployee3", "SalesEmployee3 Last name", Department.Production, 1000m);

            Developer developer1 = new Developer("0000000007", "Developer1", "Developer1 Last name", Department.Marketing, 5523m);
            Developer developer2 = new Developer("0000000008", "Developer2", "Developer2 Last name", Department.Sales, 513m);
            Developer developer3 = new Developer("0000000009", "Developer3", "Developer3 Last name", Department.Accounting, 523m);

            Sale    sale    = new Sale("graphic card", DateTime.Now, 220m);
            Project project = new Project("OOP", "OOP course", DateTime.Now);

            manager1.AddEmployees(new HashSet <Employee> {
                salesEmployee1, developer3
            });
            salesEmployee1.AddSales(new HashSet <Sale> {
                sale
            });
            developer1.AddProjects(new HashSet <Project> {
                project
            });

            IList <Employee> employees = new List <Employee>
            {
                manager1,
                manager2,
                manager3,
                salesEmployee1,
                salesEmployee2,
                salesEmployee3,
                developer1,
                developer2,
                developer3
            };

            foreach (var employee in employees)
            {
                Console.WriteLine(employee);
            }
        }
Exemplo n.º 7
0
        static void Main()
        {
            Manager manager = new Manager(44123, "Georgi", "Toshev", 4213.50m, Department.Marketing,
                                          new List <IEmployee>()
            {
                new SalesEmployee(9913, "Pesho", "Kolarov", 412, Department.Marketing, new List <ISale>()
                {
                    new Sale("Butter", new DateTime(2005, 12, 12), 10),
                    new Sale("Bread", DateTime.Now, 1)
                }),
                new Developer(1110, "Martin", "Donchev", 900, Department.Sales, new List <IProject>()
                {
                    new Project("Operation Alpha", new DateTime(2000, 1, 1), "This is operation alpha", State.Open),
                    new Project("Operation something", new DateTime(2000, 5, 5), "This is operation something", State.Closed)
                })
            });

            SalesEmployee salesEmployee = new SalesEmployee(87423, "Nikolay", "Spasov", 24342, Department.Accounting,
                                                            new List <ISale>()
            {
                new Sale("Chocolate", DateTime.Today, 7),
                new Sale("Coca cola", new DateTime(2012, 9, 2), 123)
            });

            Developer developer = new Developer(2312, "Stoyan", "Manov", 4422, Department.Accounting,
                                                new List <IProject>()
            {
                new Project("Project Delta", new DateTime(2002, 7, 4), "This is project delta", State.Open),
                new Project("Another project", new DateTime(2005, 8, 12), "This is another project", State.Open)
            });

            Person[] persons = new Person[]
            {
                manager, salesEmployee, developer
            };

            foreach (var person in persons)
            {
                Console.WriteLine(person);
                Console.WriteLine();
            }
        }