public virtual IEnumerable <EmployeePayrollItem> GetByCutoffDates(DateTime dateFrom, DateTime dateTo) { var payroll = _employeePayrollRepository.Find(x => x.IsActive && x.CutOffStartDate >= dateFrom && x.CutOffEndDate <= dateTo); var payrollItems = from payrollItem in _employeePayrollItemRepository.GetAllActive() join pay in payroll on payrollItem.PayrollId equals pay.PayrollId select payrollItem; return(payrollItems); }
public bool Delete(int id) { var itemToDelete = payrollRepository.Find(id); if (itemToDelete == null) { return(false); } payrollRepository.Delete(itemToDelete); payrollRepository.SaveChanges(); return(true); }
public virtual bool IsPayrollComputed(DateTime startDate, DateTime endDate) { return(_employeePayrollRepository.Find(x => x.IsActive && x.CutOffStartDate == startDate && x.CutOffEndDate == endDate).Any()); }