コード例 #1
0
ファイル: Program.cs プロジェクト: Razkolnikow/OOPHomeWorks
 static void Main()
 {
     Employee one = new Employee("John","Floyde", 456782, 3000, "Production");
    Employee two = new Employee("Mike","Stevenson", 4546782, 3000, "Production");
     List<Employee> list = new List<Employee>() {one, two};
    // List<Employee> list2 = new List<Employee>();
    // Manager manager = new Manager("fff","fff", 234, 5000, "Sales", list);
    // var project = new Project();
    // project.State = "open";
    // project.CloseProject();
    // Console.WriteLine(project.State);
     DateTime date = DateTime.Parse("11.11.2015");
     Sales sale1 = new Sales("Nivea Soap",2000, date);
     Sales sale2 = new Sales("Bager Dobrich",45000, DateTime.Parse("12.05.2015"));
     List<Sales> salesList = new List<Sales>(){sale1, sale2};
     Manager manager = new Manager("Paul", "Christensen", 356874, 5650, "Sales", list);
     SalesEmployee salesMan = new SalesEmployee("Mike","Downson", 785342, 3200, "Marketing", salesList);
     Project project1 = new Project("BatMobile",DateTime.Parse("10.07.2015"), "Top Secret", "closed");
     Project project2 = new Project("BatAirPlane",DateTime.Parse("11.12.2014"), "Top Secret", "open");
     List<Project> projectList = new List<Project>(){project1, project2};
     Developer developer = new Developer("Bruce","Wayne", 777777, 100000, "Production", projectList);
     List<Employee> finalList = new List<Employee>() {manager, salesMan, developer };
     foreach (var employee in finalList)
     {
         Console.WriteLine(employee);
     }           
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: vangelov-i/Fundamentals
        static void Main(string[] args)
        {
            Sale refrigerator = new Sale("Mraz", new DateTime(2015,11,24), 1100);
            Sale tv = new Sale("Opera", new DateTime(2015,11,23), 100);

            Project refrigeratorSoft = new Project("Ref. Soft", new DateTime(2015,11,25), "Pretty cool software", "open");
            Project tvSoft = new Project("TV Soft", new DateTime(2015,11,26), "Awesome software", "open");

            SalesEmployee goshko = new SalesEmployee(2201, "Gosho", "Kirkata", 1000, Department.Sales);
            SalesEmployee toshko = new SalesEmployee(2202, "Tosho", "Arabiqta", 1050, Department.Sales);

            goshko.AddSale(refrigerator);
            toshko.AddSale(tv);

            Developer sharo = new Developer(3301, "Sharo", "Rijaviq", 3000, Department.Production);
            Developer djeki = new Developer(3302, "Djeki", "Djekichana", 3050, Department.Production);

            sharo.AddProject(refrigeratorSoft);
            djeki.AddProject(tvSoft);

            Manager stoiko = new Manager(1135, "Stoiko", "Stoikov", 4000, Department.Sales);
            Manager johnny = new Manager(1136, "Johnny", "Johnson", 4500, Department.Production);

            stoiko.AddSubordinate(goshko);
            stoiko.AddSubordinate(toshko);

            johnny.AddSubordinate(sharo);
            johnny.AddSubordinate(djeki);

            Employee[] employeesList = { stoiko, johnny, goshko, toshko, sharo, djeki };

            foreach (var item in employeesList)
            {
                Console.WriteLine(item.ToString());
                Console.WriteLine();
            }
        }