示例#1
0
文件: Employee.cs 项目: Foile/dev-006
 public static Employee Create(EmployeeType role)
 {
     if (role == EmployeeType.ENGINEER)
     {
         return(new Employee(new Engineer()));
     }
     else if (role == EmployeeType.MANAGER)
     {
         return(new Employee(new Manager()));
     }
     else
     {
         return(new Employee(new SalesMan()));
     }
 }
示例#2
0
文件: Employee.cs 项目: Foile/dev-006
 private Employee(EmployeeType role)
 {
     Role = role;
 }