Exemple #1
0
        private void SaveAttachedFileDTO(IFileDTOContainer container)
        {
            if (container.Files == null)
            {
                return;
            }

            foreach (var itemFileLink in container.Files)
            {
                if (itemFileLink.File == null)
                {
                    continue;
                }
                if (itemFileLink.ParentId <= 0)
                {
                    itemFileLink.ParentId = container.ItemId;
                }
                if (itemFileLink.File.ItemId > 0 && itemFileLink.File.IsDeleted)
                {
                    _filesSmartCore.DeleteAttachedFileDTO(itemFileLink);
                }
                else
                {
                    _filesSmartCore.SaveAttachedFileDTO(itemFileLink);
                }
            }
        }
Exemple #2
0
        private void DeleteAttachedFileDTO(IFileDTOContainer container)
        {
            if (container.Files == null)
            {
                return;
            }

            foreach (var itemFileLink in container.Files)
            {
                if (itemFileLink.File == null)
                {
                    continue;
                }
                if (itemFileLink.File.ItemId > 0)
                {
                    _filesSmartCore.DeleteAttachedFileDTO(itemFileLink);
                }
            }
        }