private CollectionCarDetailDTO CheckInsuranceDateExpiredAndReturn(InfoCustomerWithInsuranceInfoDTO inforFound) { if (inforFound.CollectionCarDetail != null && inforFound.CollectionCarDetail.IsInsurance) { if (inforFound.CollectionCarDetail.InsuranceExpiredDate < DateTime.Now) { return(null); } } return(Mapper.Map <CollectionCarDetailDTO>(inforFound.CollectionCarDetail)); }
private CollectionCarDetailDTO GetCollectionCarDetailMappingWithCustomer(string plate, InfoCustomerDTO inforReturn) { IQueryable <InfoCustomerWithInsuranceInfoDTO> insuranceInfos = GetInfoCustomerAndInsuranceInfoCollectWithPlate(plate); InfoCustomerWithInsuranceInfoDTO inforFound = insuranceInfos.FirstOrDefault(x => x.InfoCustomer.Id == inforReturn.Id); if (inforFound != null) { return(CheckInsuranceDateExpiredAndReturn(inforFound)); } return(null); }