public List <TRA_CRF> GetList(TraCrfEpafParamInput input = null) { Expression <Func <TRA_CRF, bool> > queryFilterCrf = c => c.IS_ACTIVE; if (input != null) { if (input.IsActive.HasValue) { queryFilterCrf = c => c.IS_ACTIVE == input.IsActive.Value; } if (!string.IsNullOrEmpty(input.EmployeeId)) { queryFilterCrf = queryFilterCrf.And(c => c.EMPLOYEE_ID == input.EmployeeId); } if (!string.IsNullOrEmpty(input.CurrentLocation)) { queryFilterCrf = queryFilterCrf.And(c => c.LOCATION_CITY == input.CurrentLocation); } if (!string.IsNullOrEmpty(input.RelocateLocation)) { queryFilterCrf = queryFilterCrf.And(c => c.LOCATION_CITY_NEW == input.RelocateLocation); } if (input.EffectiveDate.HasValue) { queryFilterCrf = queryFilterCrf.And(c => c.EFFECTIVE_DATE == input.EffectiveDate.Value); } if (!string.IsNullOrEmpty(input.DocumentNumber)) { queryFilterCrf = queryFilterCrf.And(c => c.DOCUMENT_NUMBER == input.DocumentNumber); } if (input.EffectiveDateComplete.HasValue) { var currentDate = input.EffectiveDateComplete.Value.AddDays(1); queryFilterCrf = queryFilterCrf.And(c => c.EFFECTIVE_DATE <= currentDate); queryFilterCrf = queryFilterCrf.And(c => c.DOCUMENT_STATUS == (int)Enums.DocumentStatus.InProgress); } } return(_crfRepository.Get(queryFilterCrf, null, "").ToList()); }
public List <TraCrfDto> GetCrfByParam(TraCrfEpafParamInput input) { var data = _CrfService.GetList(input); return(Mapper.Map <List <TraCrfDto> >(data)); }