示例#1
0
文件: Program.cs 项目: ArMeN-git/ACA
        static void Main(string[] args)
        {
            Person p = new Person(160127, "Armen", "Grigoryan");

            Console.WriteLine(p);
            Customer c = new Customer(178963, "Anun", "Azganun", 100000);

            Console.WriteLine(c);
            Employee e = new Employee(123456, "FirstName", "LastName", 350000, Employee.Department.Accounting);

            Console.WriteLine(e);
            Developer d = new Developer(111000, "FirstName1", "LastName1", 750000, new List <Project> {
                new Project("Project1", DateTime.Now, "Some Details 111", Project.ProjectState.open),
                new Project("Project2", DateTime.Now, "Some Details 222", Project.ProjectState.closed),
                new Project("Project3", DateTime.Now, "Some Details 333", Project.ProjectState.open),
            });
            SalesEmployee s = new SalesEmployee(121203, "FirstName2", "LastName2", 350000, new List <Sale> {
                new Sale("Some Sale", DateTime.Now, 15000),
                new Sale("Some Sale2", DateTime.Now, 17000),
                new Sale("Some Sale3", DateTime.Now, 25000)
            });
            List <Employee> emp = new List <Employee> {
                d, s
            };
            Manager m = new Manager(036985, "FirstName3", "LastName3", 300000, emp);

            Console.WriteLine(m);
            m.ShowEmployeeList();
            Console.WriteLine(d);
            d.SHowProjects();
            Console.WriteLine(s);
            s.ShowSales();
            Console.ReadKey();
        }
示例#2
0
        public static List<Employee> GetEmployees()
        {
            List<Employee> employees = new List<Employee>();

            List<Sale> sales = new List<Sale>()
                {
                    new Sale("Biri4ka", DateTime.Now, 5),
                    new Sale("Biri4ka", DateTime.Now, 10)
                }
            ;
            Manager manager = new Manager(20, "Goshko", "Kurtev", 500, "Production", new List<IEmployee>()
            {
                new RegularEmployee(26,"Toni","Montana","Accounting",1000)

            });
            SalesEmployee simo = new SalesEmployee(25, "Ani", "Ruseva", "Marketing", 700, sales);
            SalesEmployee semo = new SalesEmployee(27, "Sori", "Bratmi", "Sales", 250, sales);
            Developer dev = new Developer(55, "Kircho", "Atanasov", "Production", 2500, new List<Project>()
            {
                new Project("Game", DateTime.Now, "Igra za kef", "open"),
                new Project("Game2", DateTime.Now, "Igra za pari", "closed"),

            });

            employees.Add(manager);
            employees.Add(semo);
            employees.Add(simo);
            employees.Add(dev);

            return employees;
        }
示例#3
0
        public static void Main()
        {
            IList<Person> people = new List<Person>();

            SalesEmployee ivan = new SalesEmployee("007", "Ivan", "Hristov", 1000m, Departments.Sales);
            ivan.AddSale(new Sale("Kartofi", new DateTime(2014, 06, 28), 100m));
            ivan.AddSale(new Sale("Lutenitza", new DateTime(2014, 08, 15), 500m));
            people.Add(ivan);

            SalesEmployee pesho = new SalesEmployee("001", "Peter", "Petrov", 1500m, Departments.Sales);
            pesho.AddSale(new Sale("Sirene", new DateTime(2014, 02, 08), 5000m));
            people.Add(pesho);

            Developer kiro = new Developer("002", "Kiril", "Stamatov", 3000m, Departments.Production);
            kiro.AddProject(new Project("OOP", new DateTime(2015, 1, 20), "Learn how to OOP"));
            people.Add(kiro);

            Manager varban = new Manager("100", "Varban", "Varbanov", 10000m, Departments.Marketing);
            varban.AddEmployee(ivan);
            varban.AddEmployee(pesho);
            varban.AddEmployee(kiro);
            people.Add(varban);

            Customer maglaOOD = new Customer("500", "Krajbi", "Prodajbi", 5000m);
            people.Add(maglaOOD);

            foreach (var p in people)
            {
                Console.WriteLine(p + "\n");
            }
        }
示例#4
0
        public static void Main()
        {
            Manager manager1 = new Manager("000001", "Manager1", "Manager1 Last name", 123m, Department.Marketing);
            Manager manager2 = new Manager("000002", "Manager2", "Manager2 Last name", 351.23m, Department.Production);
            Manager manager3 = new Manager("000003", "Manager2", "Manager2 Last name", 421.53m, Department.Accounting);

            SalesEmployee salesEmployee1 = new SalesEmployee("000004", "SalesEmployee1", "SalesEmployee1 Last name", 212m, Department.Marketing);

            Developer developer1 = new Developer("000007", "Developer1", "Developer1 Last name", 2232m, Department.Marketing);
            Developer developer2 = new Developer("000009", "Developer3", "Developer3 Last name", 104.23m, Department.Accounting);

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

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

            IList<Employee> employees = new List<Employee>
            {
                manager1,
                manager2,
                manager3,
                salesEmployee1,
            };

            foreach (var employee in employees)
            {
                Console.WriteLine(employee);
            }
        }
示例#5
0
        static void Main(string[] args)
        {
            Manager <Employee> manager = new Manager <Employee>()
            {
                new Employee {
                    Id = 5, FirstName = "s", LastName = "b", Salary = 500, Department = Department.Accounting
                },
                new Employee {
                    Id = 15, FirstName = "John", LastName = "b", Salary = 1500, Department = Department.Sales
                },
                new Employee {
                    Id = 11115, FirstName = "s", LastName = "b", Salary = 5000, Department = Department.Marketing
                },
            };


            SalesEmployee <Sales> sales_employee = new SalesEmployee <Sales>()
            {
                new Sales {
                    ProductName = "Car", Price = 5000
                },
                new Sales {
                    ProductName = "Ball", Price = 50
                },
                new Sales {
                    ProductName = "Door", Price = 550
                },
            };

            Developer <Project> developers = new Developer <Project>()
            {
                new Project {
                    ProjectName = "Car", details = "Text", State = State.Closed
                },
                new Project {
                    ProjectName = "Bus", details = "Text", State = State.Closed
                },
                new Project {
                    ProjectName = "Bycicle", details = "Text", State = State.Open
                },
            };



            Customer customer = new Customer("Suren", "Barseghyan", 500);



            Hierarchy.Show(manager, developers, sales_employee);



            Console.WriteLine(customer);
        }
示例#6
0
        public static void Main()
        {
            var managers = new List<IEmployee>();
            var managerOne = new Manager("Product", "Productov", 1, 1000m, Department.Production);
            managers.Add(managerOne);
            var managerTwo = new Manager("Accountant", "Accountov", 2, 1100m, Department.Accounting);
            managers.Add(managerTwo);
            var managerThree = new Manager("Market", "Marketov", 3, 1500m, Department.Marketing);
            managers.Add(managerThree);
            var managerFour = new Manager("Sale", "Salelov", 4, 2000m, Department.Sales);
            managers.Add(managerFour);

            var sherps = new List<IRegularEmployee>();
            var employeeOne = new Developer("Kopach", "One", 6, 500m, Department.Production);
            employeeOne.AddItem(new Project("Visual Studio", new DateTime(2014, 11, 22), "Abe nishto nyama da izlezne!"));
            managerOne.AddEmployee(employeeOne);
            sherps.Add(employeeOne);
            var employeeTwo = new Developer("Kopach", "Two", 7, 500m, Department.Production);
            employeeTwo.AddItem(new Project("Visual Studio", new DateTime(2014, 11, 22), "Abe nishto nyama da izlezne!"));
            managerOne.AddEmployee(employeeTwo);
            sherps.Add(employeeTwo);
            var employeeThree = new Developer("Kopach", "Three", 8, 3500m, Department.Production);
            employeeThree.AddItem(new Project("Golyamoto Nishto", new DateTime(2010, 01, 01), "Mi sha vidim"));
            managerOne.AddEmployee(employeeThree);
            sherps.Add(employeeThree);
            var employeeFour = new SalesEmployee("Tyrgash", "One", 9, 9500m, Department.Sales);
            employeeFour.AddItem(new Sale("Golyamo Mente", new DateTime(2014, 01, 20), 1000m));
            managerFour.AddEmployee(employeeFour);
            sherps.Add(employeeFour);

            var customers = new List<ICustomer>()
            {
                new Customer("Kupuvach", "Kupuvachkov", 1, 0),
                new Customer("Kupuvachka", "Kupuvachkova", 2, 0)
            };

            List<IPerson> allOfThem = new List<IPerson>();
            allOfThem.AddRange(managers);
            allOfThem.AddRange(sherps);
            allOfThem.AddRange(customers);

            foreach (var person in allOfThem)
            {
                Console.WriteLine(person.ToString());
            }
        }
示例#7
0
 public static void Show(Manager <Employee> employees, Developer <Project> projects, SalesEmployee <Sales> sales)
 {
     Console.WriteLine("Manager");
     foreach (var item in employees)
     {
         Console.WriteLine(item);
     }
     Console.WriteLine("Developers");
     foreach (var item in projects)
     {
         Console.WriteLine(item);
     }
     Console.WriteLine("Sales");
     foreach (var item in sales)
     {
         Console.WriteLine(item);
     }
 }
        static void Main(string[] args)
        {
            Project project1 = new Project("Zaludo raboti", new DateTime(2014, 02, 12), "zaludo bez rabota ne stoj!", true);
            Project project2 = new Project("Prituri se planinata", new DateTime(2015, 01, 01), "...", true);
            Project project3 = new Project("Probiwame dupki wsqkakwi", new DateTime(2014, 11, 20), "...", true);
            Project project4 = new Project("Svobodata, Sancho!", new DateTime(2013, 05, 05), "Dulcinea", true);
            Project project5 = new Project("S curvuli po divia zapad", new DateTime(2015, 02, 19), "...", false);

            Sale sale1 = new Sale("Tic-Tac", new DateTime(2014, 07, 08), 2.50);
            Sale sale2 = new Sale("Oreo", new DateTime(2013, 05, 10), 15.0);
            Sale sale3 = new Sale("Perwoll", new DateTime(2015, 09, 26), 100.0);
            Sale sale4 = new Sale("Samsung Galaxy S6", new DateTime(2015, 05, 19), 1049.90);
            Sale sale5 = new Sale("LG G4", new DateTime(2015, 03, 05), 839.90);
            Sale sale6 = new Sale("ALCATEL ONETOUCH IDOL 3-4.7", new DateTime(2015, 04, 16), 199.90);
            Sale sale7 = new Sale("Huawei Ascend Y600", new DateTime(2015, 03, 15), 19.90);
            Sale sale8 = new Sale("Microsoft Lumia 435 Dual", new DateTime(2014, 12, 19), 4.90);

            Customer cust1 = new Customer(826551245, "Borislav", "Ananiev");
            Customer cust2 = new Customer(486538746, "Detelin", "Tsvetkov");
            Customer cust3 = new Customer(948765987, "Anton", "Dragichev");

            Developer dev1 = new Developer(23328582, "Georgi", "Georgiev", 1500, Department.Production);
            Developer dev2 = new Developer(2627535, "Tihomir", "Dimitrov", 1800, Department.Marketing, project1, project3, project4);
            Developer dev3 = new Developer(95869522, "Vasil", "Naydenov", 1650, Department.Accounting, project1, project4, project5);

            SalesEmployee salempl1 = new SalesEmployee(872822223, "Krasimir", "Yordanov", 1900, Department.Sales, sale1, sale2, sale3);
            SalesEmployee salempl2 = new SalesEmployee(288252565, "Ivan", "Popov", 2500, Department.Sales, sale4, sale5, sale6);
            SalesEmployee salempl3 = new SalesEmployee(288252565, "Mario", "Lyaskov", 1050, Department.Sales, sale7, sale8);

            Manager boss1 = new Manager(652341265, "Evgeni", "Manchev", 3000, Department.Accounting, dev3);
            Manager boss2 = new Manager(37426423, "Oleg", "Zapryanov", 3500, Department.Sales, salempl1, salempl2, salempl3);
            Manager boss3 = new Manager(92308748, "Radostina", "Koleva", 3250, Department.Marketing, dev1, dev2);

            dev1.AddProject(project1);
            project2.CloseProject();
            project5.CloseProject();

            cust1.AddPerchuse(25.44);
            cust2.AddPerchuse(454.00);
            cust3.AddPerchuse(4451.44);

            List<Person> persons = new List<Person>()
            {
                cust1,
                cust2,
                cust3,
                dev1,
                dev2,
                dev3,
                salempl1,
                salempl2,
                salempl3,
                boss1,
                boss2,
                boss3
            };

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