/// <summary> /// List of documents /// </summary> public static DocumentListResponse DocumentListX(DocumentListRequest documentListRequest) { var documentListResponse = new DocumentListResponse(); documentListResponse.response = new ResponseStatus(); documentListResponse.documentList = RepDocument.List(documentListRequest.headerInfo, documentListRequest.inCondition); return(documentListResponse); }
/// <summary> /// List of clients /// </summary> public static DocumentListResponse DocumentList(HeaderInfo headerInfo) { var documentListResponse = new DocumentListResponse(); documentListResponse.response = new ResponseStatus(); documentListResponse.documentList = RepDocument.List(headerInfo); return(documentListResponse); }
/// <summary> /// Load document into document set /// </summary> public void LoadAllDocuments() { // Retrieve all documents // For each document (order by parent uid) // check if it is already connected to current Document Set // If it is not, connect document // Link with parent document in the set // Replicate Document Links // 21/08/2013 // Stop using DocumentList // //DocumentList dl = new DocumentList(); //dl.List(); List <Document> docl = RepDocument.List(HeaderInfo.Instance); foreach (Document document in docl) { var found = DocumentSet.FindDocumentInSet(this.UID, document.UID); if (found.document.UID > 0) { continue; } else { DocumentSetDocument dsl = new DocumentSetDocument(); // Generate new UID dsl.UID = this.GetLastUID() + 1; // Add document to set // dsl.FKDocumentSetUID = this.UID; dsl.FKDocumentUID = document.UID; dsl.Location = document.Location; dsl.IsVoid = 'N'; dsl.StartDate = System.DateTime.Today; dsl.EndDate = System.DateTime.MaxValue; dsl.FKParentDocumentUID = document.ParentUID; // Uses the Document UID as the source (Has to be combined with Doc Set) dsl.FKParentDocumentSetUID = dsl.FKDocumentSetUID; dsl.SequenceNumber = document.SequenceNumber; dsl.Add(); } } // Replicate document links // foreach (Document document in docl) { var children = DocumentLinkList.ListRelatedDocuments(document.UID); foreach (var child in children.documentLinkList) { // DocumentSetDocumentLink dsdl = new DocumentSetDocumentLink(); dsdl.FKParentDocumentUID = 0; dsdl.FKChildDocumentUID = 0; dsdl.IsVoid = 'N'; dsdl.LinkType = child.LinkType; dsdl.UID = GetLastUID() + 1; // Find parent var parent1 = DocumentSet.FindDocumentInSet(this.UID, child.FKParentDocumentUID); // Find child var child1 = DocumentSet.FindDocumentInSet(this.UID, child.FKChildDocumentUID); dsdl.FKParentDocumentUID = parent1.DocumentSetDocument.UID; dsdl.FKChildDocumentUID = child1.DocumentSetDocument.UID; dsdl.Add(); } } }