Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            SalesEmployee saler = new SalesEmployee(123145, "Joro", "Petrov", 120.20m, DepartmentType.Production);

            saler.AddSale(new Sale("Liutenica", DateTime.Parse("12.12.2015"), 2.20m));

            Customer kakaMinka      = new Customer(15651513, "Kaka", "Minka", 5000);
            Customer pepiMotichkata = new Customer(67654654, "Pepi", "Motichkata", 3000);
            Manager  theBoss        = new Manager(156136, "Chicho", "Gosho", 10000, DepartmentType.Marketing);

            Developer dev            = new Developer(333, "Bai", "Stavri", 101010, DepartmentType.Accounting);
            var       projectAmazon  = new Project("Amazon", null, null, true);
            var       projectSoftUni = new Project("SoftUni", DateTime.Now, "....", true);

            dev.Projects.Add(projectAmazon);


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

            people.Add(kakaMinka);
            people.Add(pepiMotichkata);
            people.Add(theBoss);


            foreach (Person per in people)
            {
                Console.WriteLine("ID: {0}\nFirst name: {1}\nLast name: {2}", per.Id,
                                  per.FirstName, per.LastName);
                Console.WriteLine("----------------------------");
            }
        }
        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = new CultureInfo("bg-BG");
            Project csgo      = new Project("FarmPoCqlDen", DateTime.Parse("23/09/1992"), "GlobalPotato", "Closed");
            Sale    steamSale = new Sale("!!!STEAM SALE!!!", DateTime.Parse("24.12.2015"), 20);

            Person Royal  = new Manager("Ro", "YaL", 2, 450, "Sales");
            Person drone1 = new SalesEmployee("dron", "edno", 665, 380);
            Person drone2 = new Developer("dron", "dve", 667, 380);
            Person nsaSpy = new Employee("nsa", "spy", 1337, 379, "Marketing");
            Person kgbSpy = new Employee("Nikita", "Kruschev", 1958, 1964, "Accounting");

            (drone1 as SalesEmployee).AddSale(steamSale);
            (drone2 as Developer).AddProject(csgo);
            (Royal as Manager).AddEmployee((kgbSpy as Employee));

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

            personi.Add(Royal);
            personi.Add(drone1);
            personi.Add(drone2);
            personi.Add(nsaSpy);
            personi.Add(kgbSpy);

            foreach (Person persona in personi)
            {
                Console.WriteLine(persona);
                Console.WriteLine();
            }
            Customer crusty = new Customer("Crusty", "The Clown", 999);

            crusty.Purchase(steamSale);
            Console.WriteLine(crusty.NetPurchase);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Projects firstProject  = new Projects("Financial calculator", DateTime.Parse("25.01.2014"), "Have no idea", "Open");
            Projects secondProject = new Projects("Financial calculator2", DateTime.Parse("25.01.2014"), "Still have no idea", "Open");
            Projects thirdProject  = new Projects("Financial calculator3", DateTime.Parse("25.01.2014"), "And still have no idea", "Open");

            firstProject.CloseProject();
            secondProject.CloseProject();

            Manager theLittleBoss = new Manager("445aa", "Ivan", "Ddragichev", 5000m, Department.Sales, new List <Employee>
            {
                new Employee("123ab", "Andrei", "Ivanov", 1500m, Department.Production),
                new Employee("123ab", "Sasho", "Milikin", 1500m, Department.Accoiunting),
                new Employee("123ab", "Dimitur", "Grigorov", 1500m, Department.Marketing),
            });
            Developer firstDeveleoper = new Developer("123ab", "Andrei", "Ivanov", 1500m, Department.Accoiunting, new List <Projects>
            {
                firstProject,
                secondProject,
                thirdProject,
            });
            Sales firstSale  = new Sales("Banichka", 0.85m, DateTime.Parse("05.11.2015"));
            Sales secondSale = new Sales("Boza", 1m, DateTime.Parse("05.11.2015"));
            Sales thirdSale  = new Sales("Mineralna Voda", 1.5m, DateTime.Parse(DateTime.Now.ToString()));

            SalesEmployee SaleExpertOne = new SalesEmployee("123ab", "Andrei", "Ivanov", 1500m, Department.Production, new List <Sales>
            {
                firstSale,
                secondSale,
                thirdSale
            });
            SalesEmployee SalerOne = new SalesEmployee("123ab", "Dimitur", "Grigorov", 1500m, Department.Marketing, new List <Sales>
            {
                new Sales("Military Software", 60000000000m, DateTime.Parse("12.09.2015")),
                new Sales("Security Software", 80055.99m, DateTime.Parse("12.09.2015")),
                new Sales("Decoding Software", 9999.99m, DateTime.Parse("01.04.2005")),
            });
            List <Employee> employees = new List <Employee>();

            employees.Add(theLittleBoss);
            employees.Add(firstDeveleoper);
            employees.Add(SaleExpertOne);
            employees.Add(SalerOne);

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

            Customer Hero = new Customer("1111aa", "Hero", "Geroichev");

            Hero.AddToPurchaseAmount(firstSale.Price);
            Hero.AddToPurchaseAmount(secondSale.Price);
            Console.WriteLine(Hero.ToString());
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            var customer      = new Customer(1, "Ivan", "Ivanov", 1230m);
            var manager       = new Manager(2, "Petar", "Petrov", 2000, Department.Sales);
            var saleEmployee1 = new SalesEmployee(3, "Ivan", "Petrov", 1200);
            var saleEmployee2 = new SalesEmployee(4, "Petar", "Vasilev", 1500);
            var developer1    = new Developer(5, "Vasil", "Todorov", 2500, Department.Accounting);
            var developer2    = new Developer(6, "Todor", "Ivanov", 2300, Department.Accounting);

            manager.Employees.Add(saleEmployee1);
            manager.Employees.Add(saleEmployee2);

            var sale1 = new Sale("Laptop Lenovo", new DateTime(2016, 02, 12), 2100);
            var sale2 = new Sale("Laptop HP", new DateTime(2016, 05, 11), 1800);
            var sale3 = new Sale("HDD", new DateTime(2016, 04, 02), 300);

            saleEmployee1.Sales.Add(sale1);
            saleEmployee1.Sales.Add(sale3);
            saleEmployee2.Sales.Add(sale2);

            var project1 = new Project("New accounting system", new DateTime(2016, 04, 29), "some details", ProjectState.Open);
            var project2 = new Project("RPG Game", new DateTime(2015, 12, 01), "some details", ProjectState.Closed);
            var project3 = new Project("Photo album", new DateTime(2016, 04, 15), "some details", ProjectState.Open);

            developer1.Projects.Add(project1);
            developer1.Projects.Add(project2);
            developer2.Projects.Add(project3);

            Console.WriteLine(developer1);
            project1.CloseProject();
            project1.CloseProject();
            Console.WriteLine();

            var persons = new List <Person>()
            {
                customer,
                manager,
                saleEmployee1,
                saleEmployee2,
                developer1,
                developer2
            };

            foreach (var person in persons)
            {
                Console.WriteLine(person);
            }
        }
Ejemplo n.º 5
0
        private static void Main()
        {
            var superMario = new Product("Super Mario", DateTime.Now, 30);
            var textEditor = new Product("Editor 2014", DateTime.Now, 100);

            var calculator   = new Project("Calculator", DateTime.Now);
            var pdfConverter = new Project("PDF converter", DateTime.Now, "Convert text file in PDF");

            pdfConverter.CloseProject();

            var asen = new SalesEmployee("Asen", "Mikov", 10001, 1200, Department.Marketing);

            asen.AddSales(superMario);
            asen.AddSales(textEditor);
            Console.WriteLine(asen);
            Console.WriteLine();

            var ivan = new SalesEmployee("Ivan", "Ivanov", 10002, 1250, Department.Marketing);

            ivan.AddSales(textEditor);
            ivan.AddSales(textEditor);

            var tzvetomir = new Developer("Tzvetomir", "Serov", 10003, 1500, Department.Production);

            tzvetomir.AddProject(calculator);
            tzvetomir.AddProject(pdfConverter);

            var dimitrina = new Developer("Dimitrima", "Shamanova", 10004, 1600, Department.Production);

            dimitrina.AddProject(calculator);
            dimitrina.AddProject(pdfConverter);
            Console.WriteLine(dimitrina);
            Console.WriteLine();

            var managerGesho = new Manager("Gesho", "Mihailov", 12345, 1800, Department.Marketing);

            managerGesho.AddEploymee(asen);
            managerGesho.AddEploymee(ivan);
            Console.WriteLine(managerGesho);
            Console.WriteLine();

            var managerPesho = new Manager("Pesho", "Milanov", 12346, 1900, Department.Production);

            managerPesho.AddEploymee(dimitrina);
            managerPesho.AddEploymee(tzvetomir);
            Console.WriteLine(managerPesho);
        }
Ejemplo n.º 6
0
        static void Main()
        {
            Sale phone = new Sale("XTC Galaxy One X mini Z X Y 2", new DateTime(2014, 12, 02), 850);
            Sale laptop = new Sale("Toshicer", new DateTime(2013, 03, 04), 1250);
            Sale graphicsCard = new Sale("nAti", new DateTime(2014, 11, 11), 450);
            Sale bike = new Sale("BMCross", 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("012", "Maria", "Crow", 3400, Department.Accounting, electronics);
            SalesEmployee david = new SalesEmployee("013", "David", "Stevens", 3900, Department.Sales, sports);

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

            Manager george = new Manager("005", "George", "Simmons", 5000, 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", "Mikey", "Peters", 7000, 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);
            }
        }
Ejemplo n.º 7
0
        static void Main()
        {
            Sale Stanka = new Sale("Shokolad", 24, "24.02.2014");

            Sale[]        arr    = { Stanka };
            SalesEmployee Mario  = new SalesEmployee(arr);
            double        salary = Mario.arr[0].Price;

            Console.WriteLine(salary);
            Project Game = new Project("Tower Defense", "15.04", "RPG Game");

            Console.WriteLine(Game.State);
            Project[] projArr = { Game };
            Developer Marioo  = new Developer(projArr);

            Console.WriteLine(Marioo.arr[0].State);
        }
Ejemplo n.º 8
0
 static void Main()
 {
     Sale saleOne = new Sale("Karburator", new DateTime(1998, 05, 15), 212.00m);
     Sale saleTwo = new Sale("Telefon", new DateTime(2012, 11, 02), 999.99m);
     List<Sale> salesOne = new List<Sale>();
     salesOne.Add(saleOne);
     salesOne.Add(saleTwo);
     Sale saleThree = new Sale("Klimatik", new DateTime(2007, 05, 20), 1999.99m);
     Sale saleFour = new Sale("Futbolna topka", new DateTime(2014, 06, 15), 22.00m);
     List<Sale> salesTwo = new List<Sale>();
     salesTwo.Add(saleThree);
     salesTwo.Add(saleFour);
     RegularEmployee regularEmployeeOne = new SalesEmployee(1, "Kiro", "Blagoev", 500.35m, "Accounting", salesOne);
     RegularEmployee regularEmployeeTwo = new SalesEmployee(2, "Dechko", "Bagdatiev", 573.22m, "Marketing", salesTwo);
     List<Employee> employeesOne = new List<Employee>();
     employeesOne.Add(regularEmployeeOne);
     employeesOne.Add(regularEmployeeTwo);
     Manager managerOne = new Manager(1, "Vilislava", "Karamartinova", 650.50m, "Marketing", employeesOne);
     Project projectOne = new Project("FIFA", new DateTime(1995, 05, 21), "Footbal Game", State.Open);
     Project projectTwo = new Project("League Of Legends", new DateTime(2008, 09, 13), "Multiplayer Game", State.Closed);
     List<Project> projectsOne = new List<Project>();
     projectsOne.Add(projectOne);
     projectsOne.Add(projectTwo);
     Project projectThree = new Project("Chess", new DateTime(222, 12, 14), "Board Game", State.Closed);
     Project projectFour = new Project("Belot", new DateTime(1312, 09, 04), "Card Game", State.Open);
     List<Project> projectsTwo = new List<Project>();
     projectsTwo.Add(projectThree);
     projectsTwo.Add(projectFour);
     RegularEmployee regularEmployeeThree = new Developer(3, "Ioncho", "Draskov", 1500.00m, "Production", projectsOne);
     RegularEmployee regularEmployeeFour = new Developer(4, "Dobri", "Mileshkov", 1300.00m, "Production", projectsTwo);
     List<Employee> employeesTwo = new List<Employee>();
     employeesTwo.Add(regularEmployeeThree);
     employeesTwo.Add(regularEmployeeFour);
     Manager managerTwo = new Manager(2, "Ioana", "Velikova", 505.03m, "Production", employeesTwo);
     List<Person> people = new List<Person>();
     people.Add(regularEmployeeOne);
     people.Add(regularEmployeeTwo);
     people.Add(regularEmployeeThree);
     people.Add(regularEmployeeFour);
     people.Add(managerOne);
     people.Add(managerTwo);
     foreach (var person in people)
     {
         Console.WriteLine(person);
     }
 }
        public static void Main()
        {
            List <Sale> sales = new List <Sale>
            {
                new Sale("notebook", 20, DateTime.Now),
                new Sale("pen", 2, DateTime.Now)
            };

            SalesEmployee retailer = new SalesEmployee("Kiril", "Petrov", 2314763, Departments.Marketing, 900);

            retailer.AddSale(sales[0]);
            retailer.AddSale(sales[1]);

            var pesho = new Manager("Petur", "Asenov", 3874303, Departments.Accounting, 1200);
            var katya = new Developer("Katya", "Katerina", 5344363, Departments.Production, 2300);
            var ivan  = new SalesEmployee("Ivan", "Ivanov", 3429993, Departments.Accounting, 1300);

            var project = new Project("Code", DateTime.Now, ProjectState.Open);

            katya.AddProject(project);

            pesho.AddEmployee(retailer);
            pesho.AddEmployee(katya);
            pesho.AddEmployee(ivan);

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

            employees.Add(retailer);
            employees.Add(pesho);
            employees.Add(katya);
            employees.Add(ivan);


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

            Console.WriteLine(new string('=', 10));

            foreach (var employee in pesho.EmployeesManaged)
            {
                Console.WriteLine(employee);
            }
        }
        static void Main()
        {
            List<Sale> sales1 = new List<Sale>
            {
                new Sale("Coffee", new DateTime(2014, 12, 2), 5.34m),
                new Sale("Tea", new DateTime(2015, 1, 13), 2.28m),
                new Sale("Beer", new DateTime(2014, 10, 25), 3.79m)
            };
            List<Sale> sales2 = new List<Sale>
            {
                new Sale("Cheese", new DateTime(2013, 6, 28), 9.99m),
                new Sale("Melon", new DateTime(2014, 3, 3), 4.00m),
                new Sale("Cucumber", new DateTime(2015, 1, 5), 7.77m)
            };

            List<Project> projects1 = new List<Project>
            {
                new Project("WebApp", new DateTime(2014, 10, 5), "Web store", State.Open),
                new Project("DesktopApp", new DateTime(2013, 5, 30), "Torrent client", State.Closed),
                new Project("DesktopApp", new DateTime(2012, 1, 31), "OS", State.Open),
            };
            List<Project> projects2 = new List<Project>
            {
                new Project("WindowsMobileApp", new DateTime(2013, 7, 13), "Skype", State.Closed),
                new Project("iOSApp", new DateTime(2014, 11, 11), "iTunes", State.Open),
                new Project("AndroidApp", new DateTime(2015, 1, 15), "Play Store", State.Open),
            };

            SalesEmployee gosho = new SalesEmployee(3333, "Georgi", "Petrov", 780.50m, Department.Sales, sales1);
            SalesEmployee pesho = new SalesEmployee(4444, "Petar", "Mihajlov", 1100.90m, Department.Sales, sales2);
            Developer mimi = new Developer(5555, "Mariq", "Dimitrova", 1500m, Department.Production, projects1);
            Developer sisi = new Developer(6666, "Silviya", "Zarkova", 1499.99m, Department.Production, projects2);

            Manager mitko = new Manager(1111, "Dimitar", "Peshev", 2345.67m, Department.Sales, new List<Employee>{ gosho, pesho });
            Manager gencho = new Manager(1111, "Gencho", "Yankov", 3456.78m, Department.Production, new List<Employee> { mimi, sisi });

            List<Employee> employees = new List<Employee>{mitko, gencho, gosho, pesho, mimi, sisi};

            foreach (var employee in employees)
            {
                Console.WriteLine(employee);
                Console.WriteLine();
            }
        }
Ejemplo n.º 11
0
        static void Main()
        {
            Employee employeeOne   = new Employee("Ivan", "Ivanov", "9004223664", 340.56, Department.Production);
            Employee employeeTwo   = new Employee("Hasan", "Hasanov", "9004223665", 390.56, Department.Sales);
            Employee employeeThree = new Employee("Stamat", "Georgiev", "9004223662", 1000, Department.Marketing);
            Employee employeeFour  = new Employee("Velin", "Angelov", "9004223660", 710.11, Department.Marketing);

            Manager managerOne = new Manager("Maria", "Angelova", "9405063102", 450.32, Department.Marketing);

            managerOne.AddSubordinate(employeeOne);
            managerOne.AddSubordinate(employeeTwo);
            Manager managerTwo = new Manager("Lidiq", "Nikolova", "9602010345", 500.02, Department.Sales);

            managerTwo.AddSubordinate(employeeThree);
            managerTwo.AddSubordinate(employeeFour);

            RegularEmployee regularEmployeeOne = new RegularEmployee("Maria", "Dimitrova", "0101032333", 400, Department.Marketing);

            SalesEmployee salesEmployeeOne = new SalesEmployee("Ivan", "Pehlivanov", "7808123344", 4322, Department.Sales);

            salesEmployeeOne.AddSale(new Sale("Milak", new DateTime(2015, 6, 17), 12));

            Developer developerOne = new Developer("Dimitur", "Dimitrov", "8909184560", 5000, Department.Accounting);

            developerOne.AddProject(new Project("SoftUni 2.0", new DateTime(2014, 12, 31), "", State.Open));

            Customer customerOne = new Customer("Nadejda", "Petrova", "6711117890", 450);

            Person[] companyArray = new Person[]
            {
                employeeOne, employeeTwo, employeeThree, employeeFour,
                managerOne, managerTwo,
                regularEmployeeOne,
                salesEmployeeOne,
                developerOne,
                customerOne,
            };

            for (int i = 0; i < companyArray.Length; i++)
            {
                Console.WriteLine("{0}.", i);
                Console.WriteLine(companyArray[i]);
            }
        }
Ejemplo n.º 12
0
        static void Main()
        {
            // Create several employees of type Manager,
            // SalesEmployee and Developer and add them in a
            // single collection. Finally, print them in a for-each loop.

            List<Sale> sales = new List<Sale>()
            {
                new Sale("Big Sale", new DateTime(2014, 10, 5), 20000),
                new Sale("Medium Sale", new DateTime(2013, 1, 25), 100000),
                new Sale("Big Sale", new DateTime(2012, 3, 14), 30000000)
            };
            List<Project> projects = new List<Project>()
            {
                new Project("BIg Project", new DateTime(2010, 3, 27)),
                new Project("BIg Project", new DateTime(2011, 4, 27)),
                new Project("BIg Project", new DateTime(2012, 5, 27))
            };

            SalesEmployee ivo = new SalesEmployee(346527889, "Ivo", "Ivov", Department.Sales, 1000, sales);
            SalesEmployee miivo = new SalesEmployee(346787889, "Mvo", "Ivov", Department.Sales, 1200, sales);
            SalesEmployee bivo = new SalesEmployee(346213889, "Bvo", "Ivov", Department.Sales, 1300, sales);

            Console.WriteLine(ivo.ToString());

            Developer zoro = new Developer(346213889, "Zoro", "Ziskov", Department.Production, 10000, projects);
            Developer mzoro = new Developer(346213889, "Mzoro", "Hiskov", Department.Production, 2300, projects);
            Developer dzoro = new Developer(346213889, "Dzoro", "Ivimivov", Department.Production, 50000, projects);

            Manager rashko = new Manager(123764897, "Rashko", "Rashkov", Department.Sales, 1500,
                new List<Employee>() {ivo, mzoro, bivo});
            Manager bashko = new Manager(123764897, "Brashko", "Rashkov", Department.Production, 1500,
                new List<Employee>() {miivo, zoro, dzoro});

            List<Employee> employees = new List<Employee>()
            {
                ivo, miivo, mzoro, zoro, dzoro, bivo, rashko, bashko
            };

            foreach (Employee employee in employees)
            {
                Console.WriteLine(employee.ToString() + "\n");
            }
        }
Ejemplo n.º 13
0
        static void Main(string[] args)
        {
            Developer developer = new Developer(11111111, "Todor", "Yordanov", 5000m, "Production",
                                                new List <Project> {
                { new Project("Money", DateTime.Parse("12.11.2015"), "This porject makes money!") },
                { new Project("Money2", DateTime.Parse("2.1.2005"), "Moneyyy!") }
            });

            Manager manager = new Manager(12191311, "Yordan", "Todorov", 4000m, "Sales",
                                          new List <Employee> {
                { new Employee(12191311, "Stoyan", "Dimov", 2000m, "Sales") },
                { new Employee(12191311, "Yordan", "Marinov", 1700m, "Sales") },
                { new Employee(12191311, "Marin", "Todorov", 2300m, "Sales") },
            });

            Manager anotherManager = new Manager(12191398, "Yordan", "Yordanov", 11000m, "Marketing",
                                                 new List <Employee> {
                { new Employee(12191311, "Petar", "Todorov", 4000m, "Marketing") },
                { new Employee(12191311, "Vasil", "Petkov", 3800m, "Marketing") },
                { new Employee(12191311, "Qnko", "Qnkov", 4200m, "Marketing") },
                { new Employee(12191311, "Mancho", "Vasilev", 6000m, "Marketing") }
            });

            SalesEmployee salesEmployee = new SalesEmployee(78873465, "Sancho", "Mancho", 8800m, "Marketing",
                                                            new List <Sale> {
                { new Sale("Very cool software", DateTime.Parse("30.9.15"), 32000m) },
                { new Sale("Very cool software", DateTime.Parse("11.9.15"), 25000m) },
                { new Sale("Cool software", DateTime.Parse("20.9.15"), 10000m) },
                { new Sale("Cool software", DateTime.Parse("3.10.15"), 15000m) }
            });

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

            employees.Add(developer);
            employees.Add(manager);
            employees.Add(anotherManager);
            employees.Add(salesEmployee);

            foreach (var employee in employees)
            {
                Console.WriteLine(employee);
            }
        }
Ejemplo n.º 14
0
        static void Main(string[] args)
        {
            Costumer costumer = new Costumer("Minka", "Georgieva", 40, 3000);

            DepartmentEmployee department    = new DepartmentEmployee(Department.Accounting);
            DepartmentEmployee departmentTwo = new DepartmentEmployee(Department.Marketing);

            DateTime date = new DateTime();

            date = DateTime.Now;

            List <Project> projects = new List <Project>()
            {
                new Project("Anatomiq", date, "This is details,blaa", State.open),
                new Project("Biologiq", date, "Detailsssss", State.closed)
            };

            List <Employee> employees = new List <Employee>()
            {
                new Employee("Petar", "Petrov", 22, 200, department),
                new Employee("Georgi", "Georgiev", 17, 400, departmentTwo)
            };

            List <Sale> saleEmployeeList = new List <Sale>()
            {
                new Sale("Mikrovylnova", date, 1200),
                new Sale("Klimatik", date, 4000)
            };

            Employee      employeOne   = new Employee("Georgi", "Georgiev", 50, 5000, department);
            SalesEmployee saleEmploye  = new SalesEmployee(saleEmployeeList);
            Manager       managerOne   = new Manager("Ivan", "Geshev", 2, 20, department, employees);
            Developer     developerOne = new Developer(projects);

            Console.WriteLine(developerOne);
            Console.WriteLine(managerOne);
            Console.WriteLine(costumer);
            Console.WriteLine(saleEmploye);
            Console.WriteLine(employeOne);
        }
Ejemplo n.º 15
0
        static void Main(string[] args)
        {
            Person person = new Person(1, "Mariq", "Nikolova");
            // person.toString();
            Department job       = Department.Production;
            Employee   employee1 = new Employee(2, "Stanimir", "Mirchev", 5000, job);
            Employee   employee2 = new Employee(3, "Stanimir", "Mirchev", 5000, job);
            Employee   employee3 = new Employee(4, "Stanimir", "Mirchev", 5000, job);
            Employee   employee4 = new Employee(6, "Stanimir", "Mirchev", 5000, job);


            //employeeOne.toString();
            List <Employee> employees = new List <Employee>();

            employees.Add(employee1);
            employees.Add(employee2);
            employees.Add(employee3);
            employees.Add(employee4);
            Manager manager = new Manager(7, "Hristo", "Petrov", 1000, job, employees);
            // manager.toString();

            DateTime date1 = new DateTime(43253254365);
            Sale     sale1 = new Sale("Samsung", date1, 220.50);

            DateTime date2 = new DateTime(43253254365);
            Sale     sale2 = new Sale("Samsung", date1, 220.50);

            DateTime date3 = new DateTime(43253254365);
            Sale     sale3 = new Sale("Samsung", date1, 220.50);

            List <Sale> sales = new List <Sale>();

            sales.Add(sale1);
            sales.Add(sale2);
            sales.Add(sale3);

            SalesEmployee saleEmployee = new SalesEmployee(8, "Gosho", "Ivanov", 300, job, sales);
            // saleEmployee.toString();

            State   state1   = State.Open;
            Project project1 = new Project("Malinka", date1, "dobyr project", state1);
            Project project2 = new Project("Kalinka", date1, "dobyr project", state1);
            Project project3 = new Project("Pepinka", date1, "dobyr project", state1);

            List <Project> manyProjects = new List <Project>();

            manyProjects.Add(project1);
            manyProjects.Add(project2);
            manyProjects.Add(project3);

            Developer stanimir = new Developer(324, "Stanimir", "Mirchev", 50000, job, manyProjects);
            // stanimir.toString();

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

            listPerson.Add(manager);
            listPerson.Add(saleEmployee);
            listPerson.Add(stanimir);

            foreach (var item in listPerson)
            {
                item.toString();
            }
        }
Ejemplo n.º 16
0
        static void Main()
        {
            Sale dairy = new Sale("Milk", new DateTime(2014, 10, 1), 2.50m);
            Sale chocolate = new Sale("Chocolate", new DateTime(2014, 10, 1), 1.80m);
            Sale meat = new Sale("Meat", new DateTime(2014, 10, 1), 4.80m);
            Sale vegitables = new Sale("Vegitables", new DateTime(2014, 10, 1), 3.80m);
            Sale books = new Sale("C# Programming", new DateTime(2014, 10, 2), 9.90m);
            Sale laptop = new Sale("Toshiba Satelite", new DateTime(2014, 10, 2), 999.90m);
            Sale beer = new Sale("Stolichno tymno", new DateTime(2014, 10, 3), 1.75m);
            Sale whiskey = new Sale("Jameson", new DateTime(2014, 10, 3), 29.50m);

            var foodSales = new HashSet<Sale>();
            foodSales.Add(dairy);
            foodSales.Add(chocolate);
            foodSales.Add(meat);
            foodSales.Add(vegitables);

            var otherSales = new HashSet<Sale>();
            otherSales.Add(books);
            otherSales.Add(laptop);
            otherSales.Add(beer);
            otherSales.Add(whiskey);

            Project CSharp = new Project("Accounting system", new DateTime(2014, 9, 15), "N/A");
            Project Java = new Project("Booking system", new DateTime(2014, 5, 13), "N/A");
            Project PHP = new Project("Database Center", new DateTime(2014, 8, 20), "N/A");
            Project JavaScript = new Project("On-line games", new DateTime(2014, 7, 28), "N/A");
            Project HTML_CSS = new Project("A fancy web-site", new DateTime(2014, 8, 8), "N/A");

            var webPoejcts = new HashSet<Project>();
            webPoejcts.Add(HTML_CSS);
            webPoejcts.Add(JavaScript);
            webPoejcts.Add(Java);

            var otherProjects = new HashSet<Project>();
            otherProjects.Add(CSharp);
            otherProjects.Add(PHP);

            RegularEmployee foodSalesEmployee = new SalesEmployee(100, "Ivan", "Ivanov", 1000, Department.Sales, foodSales);
            RegularEmployee othersSalesEmployee = new SalesEmployee(97, "Dragan", "Peshev", 1400, Department.Sales, otherSales);

            RegularEmployee webDeveloper = new Developer(333, "Maria", "Mainova", 1800, Department.Marketing, webPoejcts);
            RegularEmployee appDevelooper = new Developer(666, "Gosho", "Topciev", 2800, Department.Production, otherProjects);

            var otherEmployees = new HashSet<Employee>();
            otherEmployees.Add(foodSalesEmployee);
            otherEmployees.Add(othersSalesEmployee);

            var programmerEmployees = new HashSet<Employee>();
            programmerEmployees.Add(webDeveloper);
            programmerEmployees.Add(appDevelooper);

            Employee programmingManager = new Manager(1, "Muncho", "Gunchev", 5000, Department.Sales, programmerEmployees);
            Employee accountingManager = new Manager(2, "Iskra", "Gringo", 4000, Department.Accounting, otherEmployees);

            var managers = new List<Person>();
            managers.Add(programmingManager);
            managers.Add(accountingManager);

            foreach (var manager in managers)
            {
                Console.WriteLine(manager);
            }
        }
Ejemplo n.º 17
0
        static void Main()
        {
            IProject project1 = new Project(
                "Project 1",
                "01-09-2011",
                State.Closed,
                "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ac sollicitudin metus, ut fermentum risus. Donec sem urna, auctor eget risus in, interdum commodo felis");

            IProject project2 = new Project(
                "Project 2",
                "12-09-2014",
                State.Open,
                "Suspendisse potenti. Maecenas metus augue");

            IProject project3 = new Project(
                "EShop ASP.Net",
                "25-02-2013",
                State.Open,
                "Aenean luctus tincidunt urna at pulvinar. ");

            ISales sale1 = new Sales("Sale 1", new DateTime(2014, 08, 15), 2340);
            ISales sale2 = new Sales("Sale 2", new DateTime(2014, 03, 10), 220);
            ISales sale3 = new Sales("Sale 3", new DateTime(2013, 07, 25), 2000.50);
            ISales sale4 = new Sales("Sale 4", new DateTime(2014, 09, 5), 1800.50);


            IEmployee pesho = new SalesEmployee(
                "Petur",
                "Petrov",
                987456,
                20000,
                DepartmentsEnum.Sales,
                new List <ISales>()
            {
                sale1, sale3
            });

            IEmployee gosho = new SalesEmployee(
                "Gosho",
                "Georgiev",
                123456,
                24000,
                DepartmentsEnum.Sales,
                new List <ISales>()
            {
                sale2, sale4
            });

            IEmployee marina = new SalesEmployee(
                "Marina",
                "Marinka",
                666666,
                30000,
                DepartmentsEnum.Marketing,
                new List <ISales>()
            {
                sale1
            });

            IEmployee mitko = new Developer(
                "Mitko",
                "Mitkov",
                999999,
                28000,
                DepartmentsEnum.Production,
                new List <IProject>()
            {
                project3, project2
            });

            IEmployee minka = new Developer(
                "Minka",
                "Minkova",
                000001,
                15000,
                DepartmentsEnum.Production,
                new List <IProject>()
            {
                project1, project2
            });

            IManager kiril = new Manager(
                "Kiril",
                "Dimitrov",
                112250,
                38000,
                DepartmentsEnum.Production,
                new List <IEmployee>()
            {
                mitko, minka,
            });

            IManager alex = new Manager(
                "Alexandra",
                "Malinova",
                112213,
                30000,
                DepartmentsEnum.Production,
                new List <IEmployee>()
            {
                minka
            });

            IManager peshoM = new Manager(
                "Pesho",
                "Peshov",
                111111,
                35000,
                DepartmentsEnum.Marketing,
                new List <IEmployee>()
            {
                pesho, gosho, marina
            });

            IList <IEmployee> employees = new List <IEmployee>()
            {
                pesho, gosho, marina, peshoM, alex, kiril, minka, mitko,
            };

            foreach (var item in employees)
            {
                Console.WriteLine(item.ToString());
                Console.WriteLine("\n\n");
            }
        }
Ejemplo n.º 18
0
        static void Main()
        {
            var rnd = new Random();
            int counter = 4;

            var sales = new HashSet<Sale>();
            var projects = new HashSet<Project>();

            var employees = new HashSet<Employee>();
            var salesEmployees = new HashSet<Employee>();

            var customers = new HashSet<Customer>();

            for (int i = 0; i < 4; i++)
            {
                var sale = new Sale("Product" + i, rnd.Next(0, 200000));
                sales.Add(sale);
            }

            for (int i = 0; i < 4; i++)
            {
                var project = new Project("Project" + i, DateTime.Now);
                projects.Add(project);
            }

            do
            {
                var customer = new Customer(rnd.Next(1, 99),
                                firstNames[rnd.Next(0, firstNames.Length)],
                                lastNames[rnd.Next(0, lastNames.Length)],
                                rnd.Next(0, 200000)
                            );

                customers.Add(customer);
            } while (counter > customers.Count());

            counter = 8;

            do
            {
                var seller = new SalesEmployee(rnd.Next(3, 99),
                                firstNames[rnd.Next(0, firstNames.Length)],
                                lastNames[rnd.Next(0, lastNames.Length)],
                                sales.ToList().GetRange(0, sales.Count)
                            );

                salesEmployees.Add(seller);
            } while (counter > salesEmployees.Count());

            var developer = new Developer(3, "Peter", "Zlatanov", projects);

            var manager1 = new Manager(2, "Iliq", "Petrov");
            var manager2 = new Manager(1, "Mariq", "Petkova", developer, manager1);
            manager2.AddManagedEmployees(salesEmployees);

            employees.Add(manager1);
            employees.Add(manager2);
            employees.Add(developer);
            employees.UnionWith(salesEmployees);

            //Console.WriteLine("All employees: \n");
            //employees.ToList().ForEach(Console.WriteLine);

            var persons = new List<Person>();
            persons.AddRange(employees);
            persons.AddRange(customers);

            Console.WriteLine("All persons: \n");
            persons.ForEach(Console.WriteLine);
        }
Ejemplo n.º 19
0
        static void Main()
        {
            var rnd     = new Random();
            int counter = 4;

            var sales    = new HashSet <Sale>();
            var projects = new HashSet <Project>();

            var employees      = new HashSet <Employee>();
            var salesEmployees = new HashSet <Employee>();

            var customers = new HashSet <Customer>();

            for (int i = 0; i < 4; i++)
            {
                var sale = new Sale("Product" + i, rnd.Next(0, 200000));
                sales.Add(sale);
            }

            for (int i = 0; i < 4; i++)
            {
                var project = new Project("Project" + i, DateTime.Now);
                projects.Add(project);
            }

            do
            {
                var customer = new Customer(rnd.Next(1, 99),
                                            firstNames[rnd.Next(0, firstNames.Length)],
                                            lastNames[rnd.Next(0, lastNames.Length)],
                                            rnd.Next(0, 200000)
                                            );

                customers.Add(customer);
            } while (counter > customers.Count());

            counter = 8;

            do
            {
                var seller = new SalesEmployee(rnd.Next(3, 99),
                                               firstNames[rnd.Next(0, firstNames.Length)],
                                               lastNames[rnd.Next(0, lastNames.Length)],
                                               sales.ToList().GetRange(0, sales.Count)
                                               );

                salesEmployees.Add(seller);
            } while (counter > salesEmployees.Count());

            var developer = new Developer(3, "Peter", "Zlatanov", projects);

            var manager1 = new Manager(2, "Iliq", "Petrov");
            var manager2 = new Manager(1, "Mariq", "Petkova", developer, manager1);

            manager2.AddManagedEmployees(salesEmployees);

            employees.Add(manager1);
            employees.Add(manager2);
            employees.Add(developer);
            employees.UnionWith(salesEmployees);

            //Console.WriteLine("All employees: \n");
            //employees.ToList().ForEach(Console.WriteLine);

            var persons = new List <Person>();

            persons.AddRange(employees);
            persons.AddRange(customers);

            Console.WriteLine("All persons: \n");
            persons.ForEach(Console.WriteLine);
        }