Beispiel #1
0
        public static void SynchronizeAddendaAndAttachmentsGroup(Sungero.Workflow.Interfaces.IWorkflowEntityAttachmentGroup group, IElectronicDocument document)
        {
            if (document == null)
            {
                foreach (var addendum in group.All)
                {
                    group.All.Remove(addendum);
                }
                return;
            }

            var documentAddenda = document.Relations.GetRelated(Docflow.Constants.Module.AddendumRelationName);

            foreach (var addendum in group.All.Select(e => ElectronicDocuments.As(e)).Where(d => d != null && !documentAddenda.Contains(d)))
            {
                group.All.Remove(addendum);
            }

            var newAddenda = documentAddenda.Where(d => !group.All.Contains(d)).ToList();

            foreach (var addendum in newAddenda)
            {
                group.All.Add(addendum);
            }
        }
 public virtual void DocumentGroupAdded(Sungero.Workflow.Interfaces.AttachmentAddedEventArgs e)
 {
     _obj.DocumentToReturn = ElectronicDocuments.As(e.Attachment);
     using (TenantInfo.Culture.SwitchTo())
         _obj.Subject = CheckReturnTasks.Resources.ReturnTaskSubjectFormat(_obj.DocumentToReturn.Name);
 }