public static List <Employee> mockEmployee() { List <Employee> empList = new List <Employee>(); //产生张三这个员工 CommonEmployee zhangSan = new CommonEmployee(); zhangSan.Joy = "编写Java程序,绝对的蓝领、苦工加搬运工"; zhangSan.Name = "张三"; zhangSan.Salary = 1800; zhangSan.Sex = Employee.MALE; empList.Add(zhangSan); //产生李四这个员工 CommonEmployee liSi = new CommonEmployee(); liSi.Joy = "页面美工,审美素质太不流行了!"; liSi.Name = "李四"; liSi.Salary = 1900; liSi.Sex = Employee.FEMALE; empList.Add(liSi); //再产生一个经理 Manager wangWu = new Manager(); wangWu.Name = "王五"; wangWu.Performance = ("基本上是负值,但是我会拍马屁呀"); wangWu.Salary = 18750; wangWu.Sex = Employee.MALE; empList.Add(wangWu); return(empList); }
private string GetCommonEmployee(CommonEmployee commonEmployee) { string basicInfo = GetBaiscInfo(commonEmployee); string otherInfo = "\t工作:" + commonEmployee.Joy; return(basicInfo + otherInfo); }
public void Visit(CommonEmployee commonEmployee) { Console.WriteLine(GetCommonEmployee(commonEmployee)); }
public void Visit(CommonEmployee commonEmployee) { commonTotalSalary = commonTotalSalary + commonEmployee.Salary * COMMONEMPLOYEE_COEFFICIENT; }