Exemplo n.º 1
0
        public IResult Add(Car car)
        {
            var result = BusinessRun.Run(CheckCarUnitPrice(car));

            if (result == null)
            {
                _carDal.Add(car);
                return(new SuccessResult(Messages.CarAdded));
            }
            return(new ErrorResult(Messages.DailyPriceOfCarNotLessThan));
        }
Exemplo n.º 2
0
        public IResult Delete(CarImage carImage)
        {
            var result = BusinessRun.Run(CheckCarId(carImage.CarId),
                                         CarImageDeleteFile(carImage));

            if (result != null)
            {
                return(result);
            }

            _carImageDal.Delete(carImage);
            return(new SuccessResult(Messages.CarImageDeleted));;
        }
Exemplo n.º 3
0
        public IResult AddDefault(CarImage carImage)
        {
            var result = BusinessRun.Run(CheckIMageLimitExceeded(carImage.CarId),
                                         CarImageAddedDate(carImage),
                                         CarImageDeterminedDefault(carImage),
                                         CheckCarId(carImage.CarId));

            if (result != null)
            {
                return(result);
            }
            _carImageDal.Add(carImage);
            return(new SuccessResult(Messages.CarImageAdded));
        }
Exemplo n.º 4
0
        public IResult Add(IFormFile file, CarImage carImage)
        {
            var result = BusinessRun.Run(CheckIMageLimitExceeded(carImage.CarId),
                                         CarImageAddedDate(carImage),
                                         CheckCarId(carImage.CarId),
                                         CarImageAddFile(file, carImage));

            if (result != null)
            {
                return(result);
            }
            _carImageDal.Add(carImage);
            return(new SuccessResult(Messages.CarImageAdded));
        }