Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Corporate   parkwood  = new Corporate("Parkwood Entertainment");
            Subunit     marketing = new Subunit(1, "Marketing");
            Subunit     arts      = new Subunit(2, "Artists & Repertoire");
            Subunit     brands    = new Subunit(3, "Brands");
            Subunit     smed      = new Subunit(4, "Social media marketing");
            Subunit     tv        = new Subunit(5, "TV marketing");
            WhiteCollar bey       = new WhiteCollar("Beyonce", "Knowles", "CEO", "4/09/1981", true);
            WhiteCollar jlo       = new WhiteCollar("Jennifer", "Lopez", "Singer", "24/07/1969", false);
            WhiteCollar emgad     = new WhiteCollar("Emin", "Gadzhiev", "Marketing specialist", "22/01/2000", false);

            marketing.AddSubUnit(smed);
            marketing.AddSubUnit(tv);
            arts.AddEmployee(bey);
            arts.AddEmployee(jlo);
            smed.AddEmployee(emgad);
            emgad.SetHead();
            parkwood.AddDepartments(marketing);
            parkwood.AddDepartments(arts);
            parkwood.AddDepartments(brands);

            Console.WriteLine(parkwood.CorpName + " Hierarachy");

            foreach (Subunit subunit in parkwood.Departments)
            {
                PrintUnitInfo(subunit, 3);
            }
            Console.ReadLine();
        }
Exemplo n.º 2
0
 public static void PrintUnitInfo(Subunit subun, int indent)
 {
     Console.Write(new String(' ', indent));
     Console.WriteLine(subun.UnitName);
     indent++;
     foreach (Subunit depart in subun.SubUnits)
     {
         PrintUnitInfo(depart, indent);
     }
 }
Exemplo n.º 3
0
 public void AddDepartments(Subunit depname)
 {
     Departments.Add(depname);
 }
Exemplo n.º 4
0
 public void AddSubUnit(Subunit sunitname)
 {
     SubUnits.Add(sunitname);
 }