Beispiel #1
0
        private void AddDocumentToRequest(AssociatedDoc assDoc, FaxRequest request)
        {
            var  originalSelection = ImagesEventManager.Instance.CurrentSelected;
            var  associatedDocsDto = originalSelection;
            bool wasChanged        = false;

            try
            {
                if (originalSelection.DocsId != assDoc.Id || originalSelection.Type != ImagesDtoType.Associated)
                {
                    associatedDocsDto = imagesDal.GetByDocId(assDoc.Id, ImagesDtoType.Associated);
                    ImagesEventManager.Instance.Raise(new ImagesSelectedEventArgs(associatedDocsDto, false));
                    wasChanged = true;
                }

                var currentEditor  = TifEditor.GetCurrentEditor();
                var publishToBytes = currentEditor.PublishToBytes();
                associatedDocsDto.MarkupImage = publishToBytes;
                imagesDal.Update(associatedDocsDto);
                vaulter.VaultAssociatedDoc(assDoc.Id, null);

                request.AddDocument(assDoc.FileName, currentEditor.TotalPages, publishToBytes);
            }
            finally
            {
                if (wasChanged)
                {
                    ImagesEventManager.Instance.Raise(new ImagesSelectedEventArgs(originalSelection, false));
                }
            }
        }
Beispiel #2
0
        public IResult Update(IFormFile file, Images carImage)
        {
            var isImage = _imagesDal.Get(c => c.Id == carImage.Id);

            if (isImage == null)
            {
                return(new ErrorResult("Resim Bulunamadı"));
            }

            var updatedFile = FileHelper.Update(file, isImage.ImagePath);

            if (!updatedFile.Success)
            {
                return(new ErrorResult(updatedFile.Message));
            }
            carImage.ImagePath = updatedFile.Message;
            _imagesDal.Update(carImage);
            return(new SuccessResult("Güncelleme başarılı."));
        }
Beispiel #3
0
        public IResult Update(IFormFile file, Images carImage)
        {
            var isImage = _carImageDAL.Get(c => c.Id == carImage.Id);

            if (isImage == null)
            {
                return(new ErrorResult("Image not found"));
            }

            var updatedFile = FileHelper.Update(file, isImage.ImagePath);

            if (!updatedFile.Success)
            {
                return(new ErrorResult(updatedFile.Message));
            }
            carImage.ImagePath = updatedFile.Message;
            _carImageDAL.Update(carImage);
            return(new SuccessResult("Car image updated"));
        }
Beispiel #4
0
        public IResult Update(IFormFile file, Images filmImage)
        {
            var isImage = _filmImagesDal.Get(f => f.Id == filmImage.Id);

            if (isImage == null)
            {
                return(new ErrorResult("Image not found"));
            }

            var updatedFile = FileHelper.Update(file, isImage.ImagePath);

            if (!updatedFile.Success)
            {
                return(new ErrorResult(updatedFile.Message));
            }
            filmImage.ImagePath = updatedFile.Message;
            _filmImagesDal.Update(filmImage);
            return(new SuccessResult("Car image updated"));
        }