public IResult CheckReturnDate(int carId)
        {
            int      fark   = 0;
            var      result = _irentalDal.GetAll(c => c.CarId == carId).LastOrDefault();
            DateTime date   = DateTime.Now;

            if (result != null)
            {
                fark = DateTime.Compare(result.ReturnDate, date);
            }

            if (result == null || fark < 0)
            {
                return(new SuccessResult());
            }


            return(new ErrorResult());
        }
 public IDataResult <List <Rental> > GetAll()
 {
     return(new SuccessDataResult <List <Rental> >(_rentalDAL.GetAll()));
 }
Exemple #3
0
 public IDataResult <List <NRental> > GetAll()
 {
     return(new SuccessDataResult <List <NRental> >(_iRentalDal.GetAll()));
 }
Exemple #4
0
 public IDataResult <List <Rental> > GetAll()
 {
     return(new SuccessDataResult <List <Rental> >(_rentalDAL.GetAll(), Messages.RentalsListed));
 }