public IResult Add(Rental rental) { if (rental.ReturnDate != null) { _rentalDal.Add(rental); return(new SuccessResult()); } else { return(new ErrorResult(Messages.UndeliveredCar)); } }
public IResult Add(Rental rental) { var result = BusinessRules.Run(CheckCarIsAvailable(rental)); if (result != null) { return(result); } _rentalDal.Add(rental); return(new SuccessResult()); }
public IResult Add(Rental rental) { if (rental.ReturnDate.HasValue) { return(new ErrorResult(Messages.Rental.NotReturned)); } else { _rentalDal.Add(rental); return(new SuccessResult(Messages.Rental.Added)); } }
public IResult Add(Rental rental) { if (rental.ReturnDate == null) { return(new ErrorResult(Messages.CarNameInvalid)); } else { _rentalDal.Add(rental); return(new SuccessResult(Messages.CarAdded)); } }
public IResult Add(Rental rental) { if (rental.ReturnDate == null) { return(new ErrorResult(Messages.NotAvailable)); } else { _rentalDal.Add(rental); return(new SuccessResult(Messages.RentalAdded)); } }
public IResult Add(Rental rental) { var result = _rentalDal.Any(p => p.CarId == rental.CarId && (p.ReturnDate == null || p.ReturnDate > DateTime.Now)); if (result) { return(new ErrorResult("Araba hala kullanılıyor")); } _rentalDal.Add(rental); return(new SuccessResult("Araba Eklendi")); }
public IResult Add(Rental rental) { var result = _rentalDal.Get(c => c.CarId == rental.CarId); if (result.ReturnDate == null) { return(new ErrorResult(Messages.ReturnDateError)); } _rentalDal.Add(rental); return(new SuccessResult(Messages.Added)); }
public IResult Add(Rental rental) { var result = _rentalDal.GetAll(r => r.CarId == rental.CarId && r.ReturnDate == null); if (result == null || !result.Any()) { _rentalDal.Add(rental); return(new SuccessResult("Messages.RentalAdded")); } return(new ErrorResult("Messages.OperationNotValid")); }
public IResult Add(Rental rental) { if (rental.ReturnDate == null) { return(new SuccessResult(Messages.CarNotReturn)); } else { _rentalDal.Add(rental); return(new SuccessResult(Messages.CarRented)); } }
public IResult Add(Rental rental) { var result = _rentalDal.Get(f => f.CarId == rental.CarId && (f.ReturnDate == null || f.ReturnDate > DateTime.Now)); if (result != null) { return(new ErrorResult(Messages.CarAlreadyRented)); } _rentalDal.Add(rental); return(new SuccessResult(Messages.RentalCreated)); }
public IResult Add(Rental rental) { var result = _rentalDal.Get(r => r.CarId == rental.CarId && r.ReturnDate == null); if (result != null) { return(new ErrorResult("Araba şu an kirada")); } _rentalDal.Add(rental); return(new SuccessResult("Rental added.")); }
public IResult Add(Rental rental) { IResult result = BusinessRules.Run(FindexQuery(rental), CarStateContolller(rental)); if (result != null) { return(result); } _rentalDal.Add(rental); return(new SuccessResult(Messages.CreatedRental)); }
public IResult Add(Rental rental) { if (_rentalDal.GetAll(r => r.CarId == rental.CarId && r.ReturnDate == null).Count >= 1) { return(new ErrorResult(GenericMessages <Rental> .ObjHandler + Messages.NotAvailable)); } else { _rentalDal.Add(rental); return(new SuccessResult(GenericMessages <Rental> .ObjHandler + Messages.IsAdded)); } }
public IResult Add(Rental rental) { Rental searchItem = new Rental(); searchItem = _rentalDal.Get(r => r.CarId == rental.CarId); if ((searchItem == null) || (searchItem.ReturnDate != null)) { _rentalDal.Add(rental); return(new SuccessResult()); } return(new ErrorResult()); }
public IResult Add(Rental rental) { if (rental.ReturnDate == null) { return(new ErrorResult("Araba teslim edilmemiş")); } else { _rentalDal.Add(rental); return(new SuccessResult("Araba teslim edildi")); } }
public IResult Add(Rental rental) { var result = BusinessRules.Run(CheckIfCarIdLimit(rental.CarId)); if (result == null) { _rentalDal.Add(rental); return(new SuccessResult()); } return(new ErrorResult("Bu Araba Zaten Kiralandı")); }
public IResult Add(Rental rental) { var result = BusinessRules.Run(CheckReturnDate(rental.CarId), RentalCheck(rental), CheckFindeksScore(rental)); if (result != null) { return(result); } _rentalDal.Add(rental); IncreasingFindeksScore(rental.CustomerId); return(new SuccessResult(Messages.RentalSuccessful)); }
public IResult Add(Rental rental) { var result = BusinessRules.Run(FindeksScoreCheck(rental.CustomerId, rental.Id), UpdateCustomerFindexPoint(rental.CustomerId, rental.Id)); if (result != null) { return(result); } _rentalDal.Add(rental); return(new SuccessResult(Messages.RentalAdded)); }
public IDataResult Add(Rental rental) { Rental result = _rentalDal.Get(f => f.CarId == rental.CarId && (f.ReturnDate == null || f.ReturnDate > DateTime.Now)); if (result != null) { return(new ErrorResult(Messages.RentalInvalid)); } _rentalDal.Add(rental); return(new SuccessResult(Messages.RentalAdded)); }
public IResult Add(Rental rental) { var result = _rentalDal.GetAll(r => r.CarId == rental.CarId && (r.ReturnDate == null || r.ReturnDate > DateTime.Now)).Any(); if (result) { return(new ErrorResult(Messages.Exception)); } _rentalDal.Add(rental); return(new SuccessResult(Messages.Added)); }
public IResult Add(Rental rental) { IResult result = BusinessRules.Run(CheckIfRentalCarIsAvailable(rental.CarId)); if (result != null) { return(result); } _rentalDal.Add(rental); return(new SuccessResult(Messages.RentalSuccess)); }
public IResult Add(Rental rentals) { if (rentals.RentDate != null && rentals.ReturnDate != null) { rentalDal.Add(rentals); return(new SuccessResult()); } else { return(new ErrorResult()); } }
public IResult Add(Rental rental) { if (_rentalDal.Get(r => r.CarID == rental.CarID).ReturnDate != null) { return(new ErrorResult(Messages.CarNotSuccessfullAdded)); } else { _rentalDal.Add(rental); return(new SuccessResult()); } }
public IResult Add(Rental rental) { if (rental.ReturnDate != null) { _rentalDal.Add(rental); return(new SuccessResult(Messages.RentationSuccessMessage)); } else { return(new ErrorResult(Messages.RentationFailedMessage)); } }
public IResult Add(Rental rental) { List <Rental> result = _rentalDal.GetAll(r => r.CarId == rental.CarId && r.ReturnDate == null); if (result.Count > 0) { return(new ErrorResult(Messages.CarNotReturned)); } _rentalDal.Add(rental); return(new SuccessResult(Messages.CarRented)); }
public IResult Add(Rental rental) { var carToRent = _rentalDal.Get(r => r.CarId == rental.CarId); //added ile desc sıralamayı ayarla çünkü eklenecek araba ıd sinin en son hali önemli if (carToRent.ReturnDate.HasValue) { _rentalDal.Add(rental); return(new SuccessResult(Messages.CarAdded)); } return(new ErrorResult(Messages.RentalNotAdded)); }
public IResult Add(Rental rental) { var results = _rentalDal.GetAll(r => r.CarId == rental.CarId && r.ReturnDate == null); if (results.Count > 0) { return(new ErrorResult(Messages.NotAvaliable)); } _rentalDal.Add(rental); return(new SuccessResult(Messages.RentaldAdded)); }
public IResult Add(Rental rental) { if (BusinessRules.Run(CheckCarAvailable(rental)) != null) { return(new ErrorResult(Messages.CarAlreadyRented)); } else { _rentalDal.Add(rental); return(new SuccessResult(Messages.CarRented)); } }
public IResult Add(Rental rental) { var result = BusinessRules.Run(CarRentedCheck(rental)); if (result != null) { return(result); } _rentalDal.Add(rental); return(new SuccessResult(Messages.RentalAdded)); }
public IResult Add(Rental rental) { var result = CheckReturnDate(rental.CarId); if (!result.Success) { return(new ErrorResult(result.Message)); } _rentalDal.Add(rental); return(new SuccessResult(Messages.RentalAdded)); }