public static AttachmentInfoList AttachmentFetchInfoList(int[] sourceId, SourceType sourceType)
 {
     return
         (AttachmentRepository.AttachmentFetchInfoList(
              new AttachmentDataCriteria
     {
         SourceId = sourceId,
         SourceTypeId = (int)sourceType
     }));
 }
        public static Attachment AttachmentSave(Attachment attachment)
        {
            if (!attachment.IsValid)
            {
                return(attachment);
            }

            Attachment result;

            if (attachment.IsNew)
            {
                result = AttachmentRepository.AttachmentInsert(attachment);
            }
            else
            {
                result = AttachmentRepository.AttachmentUpdate(attachment);
            }

            return(result);
        }
 public static bool AttachmentDelete(int attachmentId)
 {
     return(AttachmentRepository.AttachmentDelete(
                AttachmentRepository.AttachmentFetch(attachmentId)));
 }