public IDataResult <List <Rentals> > GetAll() { if (DateTime.Now.Hour == 22) { return(new ErrorDataResult <List <Rentals> >(Messages.MaintenanceTime)); } return(new SuccessDataResult <List <Rentals> >(_rentalsDal.GetAll(), Messages.Listed)); }
public IResult Add(Rentals rental) { var rentalsReturnDate = _rentalDal.GetAll(r => r.CarId == rental.CarId); if (rentalsReturnDate.Count > 0) { foreach (var rentalReturnDate in rentalsReturnDate) { if (rentalReturnDate.ReturnDate == null) { return(new ErrorResult(Messages.RentalReturnDateIsNull)); } } } _rentalDal.Add(rental); return(new SuccessResult(Messages.RentalAdded)); }
public IDataResult <List <Rentals> > GetAll() { return(new SuccessDataResult <List <Rentals> >(_rentalsDal.GetAll(), "başarılı")); }
public IDataResult <List <Rentals> > GetAll() { return(new DataResult <List <Rentals> >(_rentalsDal.GetAll(), true, "Kiralananlar listelendi.")); }
public IDataResult <List <Rental> > GetAll() { return(new SuccessesDataResult <List <Rental> >(_RentalsDal.GetAll(), Messages.ProductListed)); }
public IDataResult <List <Rentals> > GetAll() { return(new SuccessDataResult <List <Rentals> >(_rentalsDal.GetAll(), Messages.Listed)); }
public IDataResult <List <Rental> > GetAll() { return(new SuccessDataResult <List <Rental> >(_rentalsDal.GetAll())); }