Example #1
0
 public Departament(string name, Chief chief)
 {
     if (name == String.Empty || departamentNames.Contains(name))
     {
         name = $"Departament_{defIndexName}";
     }
     Name = name;
     departamentNames.Add(name);
     Chief           = chief;
     workers         = new List <IWorker>();
     ownDepartaments = new List <Departament>();
     defIndexName++;
     departaments.Add(this);
     chief.CalculateSalary();
 }
Example #2
0
 public void AddWorker(Worker worker)
 {
     Workers.Add(worker);
     Chief.CalculateSalary();
 }