Esempio n. 1
0
        public IResult Add(Rentals rentals)
        {
            ValidationTool.Validate(new RentalsValidator(), rentals);

            _rentalsDal.Add(rentals);
            return(new SuccessResult(Messages.RentalAdded));
        }
Esempio n. 2
0
 public IResult Add(Rentals rent)
 {
     if (rent.ReturnDate == null)
     {
         return(new ErrorResult(Messages.Rented));
     }
     _rentalsDal.Add(rent);
     return(new SuccessResult(Messages.RentOk));
 }
 public IResult Add(Rentals rentals)
 {
     if (_rental.ReturnDate == null)
     {
         _rentalsDal.Add(rentals);
         return(new SuccessResult(SuccessMessages.RentalAdded));
     }
     return(new ErrorResult(ErrorMessages.CouldntRentalAdded));
 }
Esempio n. 4
0
 public IResult Add(Rental rentals)
 {
     if (rentals.ReturnDate == null && _rentalsDal.GetRentalDetails(I => I.CarId == rentals.CarId).Count > 0)
     {
         return(new ErrorResult("hata"));
     }
     _rentalsDal.Add(rentals);
     return(new SuccessResult(Messages.Added));
 }
Esempio n. 5
0
 public IResult Add(Rentals rentals)
 {
     if (rentals.RentDate.Hour >= 18 && rentals.RentDate.Hour <= 7)
     {
         return(new SuccessResult(Messages.RentHourInvalid));
     }
     _rentalDal.Add(rentals);
     return(new SuccessResult(Messages.RentalsAdded));
 }
Esempio n. 6
0
 public IResult Add(Rentals rentals)
 {
     if (rentals.ReturnDate > DateTime.Now)
     {
         Console.WriteLine("Araba Kiralanamadı Daha teslim edilmedi");
     }
     _rentalsDal.Add(rentals);
     return(new  SuccesResult(Messages.CarRent));
 }
Esempio n. 7
0
        public IResult Add(Rental rentals)
        {
            var result = GetRentalsDetails().Data.SingleOrDefault(p => p.CarId == rentals.CarId);

            if (result.ReturnDate != null)
            {
                _RentalsDal.Add(rentals);
                return(new SuccessesResult(Messages.ProductAdded));
            }
            return(new ErrorResult(Messages.ProductNameInvalid));
        }
Esempio n. 8
0
 public IResult Add(Rentals rentals)
 {
     if (rentals.ReturnDate != null)
     {
         _rentalsDal.Add(rentals);
         return(new SuccessResult("başarılı"));
     }
     else
     {
         return(new ErrorResult("başarısız"));
     }
 }
Esempio n. 9
0
 public IResult Add(Rentals rentals)
 {
     if (rentals.ReturnDate <= rentals.RentDate && rentals.ReturnDate == null)
     {
         return(new ErrorResult(Messages.CarNameInvalid));
     }
     else
     {
         _rentalsDal.Add(rentals);
         return(new SuccessResult(Messages.CustomerAdded));
     }
 }
Esempio n. 10
0
        public IResult Add(Rentals rentals)
        {
            var result = CheckReturnDate(rentals.RentalsId);

            if (!result.Success)
            {
                return(new ErrorResult(result.Message));
            }

            _rentalsDal.Add(rentals);
            return(new SuccessResult(Messages.RentalsAdded));
        }
        public IResult Add(Rentals rentals)
        {
            var dateRent   = rentals.RentDate;
            var dateReturn = rentals.ReturnDate;

            if (dateRent < dateReturn || dateReturn == null)
            {
                return(new ErrorResult(Messages.RentalsError));
            }
            else
            {
                _rentalsDal.Add(rentals);
                return(new SuccessResult(Messages.RentalsAdded));
            }
        }
        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));
        }
Esempio n. 13
0
 public IResult Add(Rentals entity)
 {
     _rentalsDal.Add(entity);
     return(new SuccessResult(Massages.Added));
 }
Esempio n. 14
0
 public IResult Add(Rentals rent)
 {
     _rentalDal.Add(rent);
     return(new SuccessResult(Messages.CarRented));
 }
Esempio n. 15
0
 //[ValidationAspect(typeof(RentalsValidator))]
 public IResult Add(Rentals rental)
 {
     _rentalDal.Add(rental);
     return(new SuccessResult(Messages.RentalsAdded));
 }