Esempio n. 1
0
 public IResult Update(IFormFile file, Image image)
 {
     image.ImagePath = FileHelper.Update(_imageDal.Get(i => i.Id == image.Id).ImagePath, file);
     image.Date      = DateTime.Now;
     _imageDal.Update(image);
     return(new SuccessResult(Messages.ImageUpdated));
 }
Esempio n. 2
0
        public IResult Update(IFormFile file, CarImage carImage)
        {
            carImage.ImagePath = FileHelper.Update(_ımageDal.Get(p => p.Id == carImage.Id).ImagePath, file);
            carImage.Date      = DateTime.Now;

            _ımageDal.Update(carImage);

            return(new SuccessResult());
        }
Esempio n. 3
0
        public IResult Update(IFormFile file, Image image)
        {
            var oldPath = _imageDal.Get(p => p.Id == image.Id).ImagePath;

            image.ImagePath = FileHelper.Update(file, oldPath);
            image.Date      = DateTime.Now;
            _imageDal.Update(image);

            return(new SuccessResult());
        }
Esempio n. 4
0
        public IResult Update(IFormFile file, Image image)
        {
            var oldpath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..\\..\\..\\Root")) +
                          _imageDal.Get(p => p.Id == image.Id).ImagePath;

            image.ImagePath = FileHelper.UpdateAsync(oldpath, file);
            image.Date      = DateTime.Now;
            _imageDal.Update(image);
            return(new SuccessResult(Messages.ImageUpdated));
        }
Esempio n. 5
0
 public bool Update(Image model)
 {
     try
     {
         return(imageDal.Update(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 6
0
        public IResult Update(Car car)
        {
            _iCarDal.Update(car);
            Image image = _imageDal.Get(i => i.CarId == car.CarId);

            if (image != null)
            {
                image.ImagePath = car.Thumbnail;
            }
            _imageDal.Update(image);
            return(new SuccessResult("Car had updated successfuly"));
        }
Esempio n. 7
0
        public IResult Update(IFormFile file, CarImage carImage)
        {
            IResult result = BusinessRules.Run(CheckIfImageLimitExceded(carImage.CarId));

            if (result != null)
            {
                return(result);
            }
            carImage.Date = DateTime.Now;
            _imageDal.Update(carImage);
            return(new SuccessResult());
        }
        public IResult Update(IFormFile file, Image image)
        {
            IResult result = BusinessRules.Run(CheckIfImageLimitBorder(image.CarId));

            if (result != null)
            {
                return(result);
            }
            var result1 = _imageDal.Get(c => c.ImageId == image.ImageId);

            image.ImagePath = ImageFileHelper.Update(file, result1.ImagePath);
            image.Date      = DateTime.Now;
            _imageDal.Update(image);
            return(new SuccessResult(Messages.ImageUpdated));
        }
        public IResult Update(CarImage carImage, IFormFile formFile)
        {
            var oldFilePath = carImage.ImagePath;
            var newFilePath = FileHelper.UpdateFile(oldFilePath, formFile);

            if (newFilePath.Success)
            {
                _imageDal.Update(new CarImage
                {
                    Id        = carImage.Id,
                    CarId     = carImage.CarId,
                    ImagePath = newFilePath.Data
                });
                return(new SuccessResult());
            }
            return(new ErrorResult());
        }
        public IResult Update(IFormFile file, Image image)
        {
            var check = BusinessRules.Run(CheckTheCarExists(image.CarId));

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

            var result = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../wwwroot")) +
                         _imageDal.Get(i => i.Id == image.Id).ImagePath;

            image.ImagePath = FormFileHelper.Update(file, result);
            image.Date      = DateTime.Now;
            _imageDal.Update(image);
            return(new SuccessResult(Messages.ImageUpdated));
        }
Esempio n. 11
0
 public IResult Update(IFormFile file, Image image)
 {
     _imageDal.Update(image);
     return(new SuccessResult());
 }
Esempio n. 12
0
 public void Update(Image image)
 {
     _imageDal.Update(image);
 }
Esempio n. 13
0
 public IResult Update(CarImages carImages)
 {
     _ımageDal.Update(carImages);
     return(new SuccessResult());
 }