public IDataResult <List <CarImage> > GetImagesByCarId(int carId) { var errorResult = BusinessTool.GetFailedLogic(CheckCarImageIdIsExist(carId)); if (errorResult != null) { return(new SuccessDataResult <List <CarImage> >(CheckCarImageIsNull(carId), Messages.SuccessfullyListedObjects)); } return(new ErrorDataResult <List <CarImage> >(null, errorResult.Message)); }
public IDataResult <CarImage> Get(int id) { var errorResult = BusinessTool.GetFailedLogic(CheckCarImageIdIsExist(id)); if (errorResult != null) { return(new ErrorDataResult <CarImage>(null, errorResult.Message)); } return(new SuccessDataResult <CarImage>(_iCarImageDal.Get(c => c.Id == id), Messages.SuccessfullyGotObject)); }
public IResult Add(Rental rental) { IResult failedLogic = BusinessTool.GetFailedLogic(CheckRentedCarIsReturnedDateExist(rental.ReturnDate)); if (failedLogic != null) { return(failedLogic); } _iRentalDal.Add(rental); return(new SuccessResult(Messages.SuccessfullyAdded)); }
public MainWindow() { InitializeComponent(); try { BusinessTool BIApp = new BusinessTool(); //this.AppsListBox.ItemsSource = BIApp._businessApplications; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public IResult Update(IFormFile file, CarImage carImage) { var errorResult = BusinessTool.GetFailedLogic(CheckImageLimitExceed(carImage.CarId)); if (errorResult != null) { return(errorResult); } carImage.ImagePath = FileHelper.UpdateImage(carImage.ImagePath, file); carImage.CreatedDate = DateTime.Now; _iCarImageDal.Update(carImage); return(new SuccessResult(Messages.SuccessfullyUpdated)); }
public IResult Add(Car car) { // the following rules will be in ValidationAspect give as an attribute var errorLogic = BusinessTool.GetFailedLogic(CheckAddedCarAlreadyExist(car.Id)); if (errorLogic != null) { return(errorLogic); } _iCarDal.Add(car); return(new SuccessResult(Messages.SuccessfullyAdded)); }