Example #1
0
        static void Main(string[] args)
        {
            Manager john = new Manager("John", "Brown");
            Manager bryn = new Manager("Bryn", "Ward");

            john.AddBonus(600);
            Console.WriteLine(john.GetSalary());
            Console.WriteLine("-----------------");
            SalesPerson mike = new SalesPerson("Mike", "Smith");

            mike.ExtendSuccessRevenue(1300);
            Console.WriteLine(mike.GetSalary());
            Console.WriteLine("-----------------");
            Contractor tim   = new Contractor("Tim", "Jones", 160, 2.5, john);
            Contractor brook = new Contractor("Brook", "Hanks", 160, 2.5, john);

            Console.WriteLine(tim.GetSalary());
            Console.WriteLine("-----------------");
            Employee[] company =
            {
                brook, tim, bryn, john, mike
            };
            CEO luke = new CEO("Luke", "Redd", company);

            luke.AddSharesPrice(5);
            Console.WriteLine($"{luke.Role}:");
            luke.PrintInfo();
            Console.WriteLine($"Salary of {luke.Role} is {luke.GetSalary()}");
            luke.PrintEmployees();
            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            Manager    bob  = new Manager("Bob", "Bobert", "Development department", 1200);
            Manager    rick = new Manager("Rick", "Rickert", "HR department", 1300);
            Contratcor mona = new Contratcor("Mona", "Monalisa", 20.5, 70, bob);
            Contratcor igor = new Contratcor("Igor", "Igorsky", 12.2, 80, rick);
            Sales      lea  = new Sales("Lea", "Leova");

            lea.AddSuccessRevenue(1800);

            Employee[] employees = new Employee[] { bob, rick, mona, igor, lea };

            Console.WriteLine($"{mona.GetInfo()} - salary: {mona.Salary}$ - department: {mona.CurrentPossition()}");

            Console.WriteLine("----------------");

            CEO ceo = new CEO("Ron", "Ronsky", employees, 1500, 140);

            ceo.AddSharesPrice(10);
            Console.WriteLine($"{ceo.GetInfo()} - salary: {ceo.Salary}");
            Console.WriteLine($"Salary of CEO is: {ceo.GetSalary()}");
            Console.WriteLine("Employees:");
            ceo.PrintEmployees();
            Console.ReadLine();
        }
Example #3
0
        static void Main(string[] args)
        {
            Contractor constractor1 = new Contractor()
            {
                FirstName = "Bob", LastName = "Bobert", Role = Role.Other
            };
            Contractor constractor2 = new Contractor()
            {
                FirstName = "Rick", LastName = "Rickert", Role = Role.Other
            };
            Manager     manager1   = new Manager("Mona", "Monalisa");
            Manager     manager2   = new Manager("Igor", "Igorsky");
            SalesPerson salePeson1 = new SalesPerson("Lea", "Leova");

            Employee[] Company = { constractor1, constractor2, manager1, manager2, salePeson1 };
            CEO        ceo1    = new CEO()
            {
                FirstName = "Ron", LastName = "Ronsky", Role = Role.Other, Shares = 300
            };

            ceo1.SetSalary(1500);
            ceo1.Employees = Company;
            Console.WriteLine("CEO: ");
            ceo1.PrintInfo();
            ceo1.AddSharesPrice(200);
            Console.WriteLine($"Salary of CEO  is: {ceo1.GetSalary()}");
            ceo1.PrintEmployees();
            //CurrentPosition
            //manager1.Dedepartment = "department1";
            //constractor1.Responsible = manager1;
            //constractor1.CurrentPosition();
            Console.ReadLine();
        }
Example #4
0
        static void Main(string[] args)
        {
            Employee    employee    = new Employee("Bob", "Bobsky", Role.Others, 600);
            SalesPerson salesPerson = new SalesPerson("Bill", "Bilsky", 1500);
            Manager     manager     = new Manager("Elon", "Musk", 5000);

            salesPerson.ExtendSuccessRevenue(2000);
            manager.AddBonus(4000);
            salesPerson.ExtendSuccessRevenue(3000);

            Console.WriteLine(employee.GetInfo());
            Console.WriteLine(salesPerson.GetInfo());
            Console.WriteLine(manager.GetInfo());

            Console.WriteLine($"Employee salary: {employee.GetSalary()}");
            Console.WriteLine($"Sales person salary: {salesPerson.GetSalary()}");
            Console.WriteLine($"Manager salary: {manager.GetSalary()}");


            Contractor contractor = new Contractor("Greg", "Gregsky", 40, 50, manager);

            Console.WriteLine($"Contractor current manager: {contractor.CurrentManager()}");
            Console.WriteLine($"Manager salary: {contractor.GetSalary()}");



            Employee[] company = new Employee[5]
            {
                new Contractor("Bill", "Bilsky", 38, 55, manager),
                new Contractor("Mallory", "Monroe", 44, 60, manager),
                new Manager("Scot", "Scotsky", 1000),
                new Manager("Ben", "Bensky", 2000),
                new SalesPerson("Jill", "Jillsky", 1500)
            };

            CEO ceo = new CEO("Ron", "Ronsky", 1500, company);

            Console.WriteLine($"\n\nCEO: {ceo.GetInfo()}");
            Console.WriteLine("Employees: ");
            foreach (string employee1 in ceo.GetEmployees())
            {
                Console.WriteLine(employee1);
            }

            Console.WriteLine(ceo.GetSalary());

            ceo.SetShares(30);
            ceo.AddSharesPrice(500);

            Console.WriteLine($"CEO sallary with shares: {ceo.GetSalary()}");
        }
Example #5
0
        static void Main(string[] args)
        {
            Employee[] company = new Employee[]
            {
                new Contractor("Bob", "Bobert"),
                new Contractor("Rick", "Rickert"),
                new Manager("Mona", "Monalisa"),
                new Manager("Igor", "Igorsky"),
                new SalesPerson("Lea", "Leova"),
            };

            CEO ceoName = new CEO("Ron", "Ronsky", company);

            Console.WriteLine("CEO:");
            ceoName.PrintInfo();
            ceoName.AddSharesPrice(1400);
            var getSalary = ceoName.GetSalary();

            Console.WriteLine($"Salary of CEO is:{getSalary}");
            ceoName.PrintEmployees(company);


            Console.WriteLine("------------------------------------------------");

            Manager manager = new Manager("Bob", "Bobsky");

            manager.PrintInfo();
            var bonusF = manager.AddBonus(1500);

            Console.WriteLine($"The bonus is: {bonusF}");
            var mSalary = manager.GetSalary();

            Console.WriteLine($"The salary with bonus is: {mSalary}");

            Console.WriteLine("------------------------------------------------");

            SalesPerson salesPer = new SalesPerson("Radmila", "Sokolovska");

            salesPer.PrintInfo();
            Console.WriteLine(salesPer.GetSalary());

            Console.WriteLine("------------------------------------------------");

            Contractor contractor = new Contractor("Petre", "Petreski");

            contractor.PrintInfo();
            Console.Write("Salary is: ");
            Console.WriteLine(contractor.GetSalary());

            Console.ReadLine();
        }