private Employee CalculateCosts(Employee employee)
        {
            _employeeBenefitService.GetYearlyBenefitCost(employee);
            _employeeBenefitService.GetPayCheckBenefitCost(employee);
            _employeeBenefitService.GetPayCheckSalaryAfterDeduction(employee);
            _employeeBenefitService.GetYearlySalaryAfterDeduction(employee);

            return(employee);
        }
示例#2
0
        public IActionResult OnGet()
        {
            try
            {
                Employees = _employeeService.SearchEmployees(SearchTerm);
                foreach (Employee emp in Employees)
                {
                    // _employeeService.CalculateCosts(emp);
                    _employeeBenefitService.GetYearlyBenefitCost(emp);
                    _employeeBenefitService.GetPayCheckBenefitCost(emp);
                    _employeeBenefitService.GetPayCheckSalaryAfterDeduction(emp);
                    _employeeBenefitService.GetYearlySalaryAfterDeduction(emp);
                }
                ;

                return(Page());
            }

            catch (ServiceException ex)
            {
                _logger.LogError("Error On Employees Page: ErroCode: {0}, Message {1}", ex.ErrorCode, ex.ToString());
                throw ex;
            }
        }
        public IActionResult OnGet(int id = 1)
        {
            try
            {
                Employee = _employeeService.GetEmployee(id);
                _employeeBenefitService.GetYearlyBenefitCost(Employee);
                _employeeBenefitService.GetPayCheckBenefitCost(Employee);
                _employeeBenefitService.GetPayCheckSalaryAfterDeduction(Employee);
                _employeeBenefitService.GetYearlySalaryAfterDeduction(Employee);

                if (Employee == null)
                {
                    return(RedirectToPage("/NotFound"));
                }
            }

            catch (ServiceException ex)
            {
                _logger.LogError("Error On Employees Page ErroCode: {0}, Message {1}", ex.ErrorCode, ex.ToString());
                throw ex;
            }

            return(Page());
        }