public IResult Add(Rentals rentals) { ValidationTool.Validate(new RentalsValidator(), rentals); _rentalsDal.Add(rentals); return(new SuccessResult(Messages.RentalAdded)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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")); } }
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)); } }
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)); }
public IResult Add(Rentals entity) { _rentalsDal.Add(entity); return(new SuccessResult(Massages.Added)); }
public IResult Add(Rentals rent) { _rentalDal.Add(rent); return(new SuccessResult(Messages.CarRented)); }
//[ValidationAspect(typeof(RentalsValidator))] public IResult Add(Rentals rental) { _rentalDal.Add(rental); return(new SuccessResult(Messages.RentalsAdded)); }