-
Notifications
You must be signed in to change notification settings - Fork 0
/
Employee.cs
44 lines (41 loc) · 916 Bytes
/
Employee.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
public class Employee
{
private string name;
private Employee boss;
private List<Employee> colaborators;
public string GetEmployeeName()
{
return name;
}
public Employee(string employeeName)
{
this.name = employeeName;
boss=null;
colaborators= new List<Employee>();
}
public void SetBoss(Employee boss)
{
this.boss=boss;
}
public Employee GetBoss()
{
return boss;
}
public string GetBossName()
{
return boss.GetEmployeeName();
}
public List<Employee> GetColaborators(){
return colaborators;
}
public bool HasColaborators()
{
return this.colaborators!=null && this.colaborators.Count>0;
}
public void AddColaborator(Employee colaborator)
{
this.colaborators.Add(colaborator);
}
}