public ActionResult GeneratePayslip() { EmployeeFactory EmployeeFactory = new ConcreteEmployeeFactory(); IEmployee permanentEmployee = EmployeeFactory.Factory("PermanentEmployee"); permanentEmployee.details(); IEmployee TemporaryEmployee = EmployeeFactory.Factory("TemporaryEmployee"); TemporaryEmployee.details(); return(View()); }
public async Task <IEnumerable <EmployeeEntity> > GetAllAsync() { var listEmployees = await _employeeAccess.GetAllAsync(); foreach (var employee in listEmployees) { EmployeeFactory EmployeeFactory = new ConcreteEmployeeFactory(); IFactory typeEmployee = EmployeeFactory.Factory(employee.ContractTypeName); employee.TotalSalary = typeEmployee.CalculateAnualSalary(employee); } return(listEmployees); }