예제 #1
0
        public Compensation Create(Compensation compensation)
        {
            if (compensation == null || string.IsNullOrWhiteSpace(compensation.EmployeeId))
            {
                return(null);
            }

            _compensationRepository.Add(compensation);
            _compensationRepository.SaveAsync().Wait();

            return(_compensationRepository.GetByEmployeeId(compensation.EmployeeId));
        }
        public Compensation GetByEmployeeId(string id)
        {
            if (!String.IsNullOrEmpty(id))
            {
                return(_compensationRepository.GetByEmployeeId(id));
            }

            return(null);
        }
        public Compensation GetByEmployeeId(String employeeId)
        {
            if (!String.IsNullOrEmpty(employeeId))
            {
                return _compensationRepository.GetByEmployeeId(employeeId);
            }

            return null;
        }
예제 #4
0
        /// <summary>
        /// This method will return the compensation with the newest effective date
        /// </summary>
        /// <param name="employeeID"></param>
        /// <returns></returns>
        public Compensation GetRecentCompensation(string employeeID)
        {
            Compensation recentCompensation = _compensationRepository.GetByEmployeeId(employeeID).OrderByDescending(c => c.EffectiveDate).FirstOrDefault();

            return(recentCompensation);
        }