Esempio n. 1
0
        public AttachmentsSaveStatus AddDocument(int CaseID, long?SessionID, vw_Documents Document)
        {
            if (FoldersRepository.DocumentsOverFlowNumber(Document.FolderID))
            {
                return(AttachmentsSaveStatus.NumberOfDocumentOverFlow);
            }
            else
            {
                if (SessionID.HasValue)
                {
                    Document.FolderID = FoldersRepository.SessionParentFolder(CaseID, SessionID.Value);
                }
                else if (!Document.FolderID.HasValue)
                {
                    Document.FolderID = FoldersRepository.CaseParentFolder(CaseID);
                }

                return(DocumentsRepository.AddDocument(CaseID, SessionID, Document));
            }
        }