public decimal CalculateWage(int id) { //if (!_gateway.Connected) //{ // return 0; //} WorkingStatistics ws = null; try { ws = _gateway.GetWorkingStatistics(id); } catch (Exception ex) { return(0); } decimal wage; if (ws.PayHourly) { wage = ws.WorkingHours * ws.HourSalary; } else { wage = ws.MonthSalary; } _logger.Info($"Customer ID={id}, Wage:{wage}"); return(wage); }
public decimal CalculateWage(int id) { WorkingStatistics ws = gateway.GetWorkingStatistics(id); decimal wage; if (ws.PayHourly) { wage = ws.WorkingHours * ws.HourSalary; } else { wage = ws.MonthSalary; } logger.Info($"Customer ID={id}, Wage:{wage}"); return(wage); }