예제 #1
0
        public ActionResult Get(string employeeID)
        {
            EmployeeInformation employeeRecord = _employeAdapter.GetByUniqueID(employeeID);

            if (string.IsNullOrEmpty(employeeRecord.Employee.EmployeeID))
            {
                return(BadRequest(string.Format($"Given EmployeeID: {employeeID} didnot return any employee data. Please provide a valid employee ID")));
            }

            string result = JsonConvert.SerializeObject(employeeRecord);

            return(Ok(result));
        }
예제 #2
0
        public ActionResult Get(string employeeID)
        {
            EmployeeInformation employeeRecord = _employeAdapter.GetByUniqueID(employeeID);

            if (string.IsNullOrEmpty(employeeRecord.Employee.EmployeeID))
            {
                return(BadRequest(string.Format($"Given EmployeeID: {employeeID} doesnot exist. Please provide the right employeeID")));
            }

            EmployeeSalaryInformation _salary = _benefitCostCalculator.CalculateEmployeeSalary(employeeRecord);

            string result = JsonConvert.SerializeObject(_salary);

            return(Ok(result));
        }