public string Execute(string[] args) { int managerId = int.Parse(args[0]); ManagerDto managerDto = controller.ManagerInfo(managerId); return(managerDto.ToString()); }
public string Execute(string[] args) { var sb = new StringBuilder(); int employeeId = int.Parse(args[0]); var managerDto = _managerController.ManagerInfo(employeeId); sb.AppendLine($"{managerDto.FirstName} {managerDto.LastName} | Employees: {managerDto.EmployeesCount}"); foreach (var employee in managerDto.EmployeesDto) { sb.AppendLine($" - {employee.FirstName} {employee.LastName} - ${employee.Salary:F2}"); } return(sb.ToString().TrimEnd()); }
public string Execute(string[] args) { int employeeId = int.Parse(args[0]); ManagerDto managerDto = controller.ManagerInfo(employeeId); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"{managerDto.FirstName} {managerDto.LastName} | Employees: {managerDto.Employees.Count}"); foreach (var e in managerDto.Employees) { stringBuilder.AppendLine($" - {e.FirstName} {e.LastName} - ${e.Salary:f2}"); } return(stringBuilder.ToString().Trim()); }