private DS3Connector.DTO.Document <DS3Connector.DTO.BoxInfo, DS3Connector.DTO.BoxDocType> RecuperaBoxTeste(int?documentId = null) { var documentList = documentProxy.Search(new DS3Connector.DTO.SearchRequest <DS3Connector.DTO.IBoxSearchRequest>() { Id = documentId, DocumentInfo = boxInfo }); if (documentList.Status == Constants.SUCCESS && documentList.TotalFound > 0 && documentList.Data != null && documentList.Data.Count > 0) { return(documentList.Data.First()); } else { return(null); } }
public DsMessage PesquisarArquivos(string NomeDocumento, List <DsKeyword> ChavesDocumento) { var docTypeId = ConvertTo.DocTypeId(NomeDocumento); if (!docTypeId.HasValue) { throw new InvalidCastException("Tipo de documento inválido!"); } if (docTypeId == 65) { var documentList = documentProxy.Search(new DS3Connector.DTO.SearchRequest <DTO.IBoxSearchRequest>() { DocumentInfo = ConvertTo.BoxSearchRequestInfo(ChavesDocumento) }); return(new DsMessage(documentList.Message, (documentList.Status == SUCCESS && documentList.TotalFound > 0 ? 0 : 404))); } else { var documentList = documentProxy.Search(new DS3Connector.DTO.SearchRequest <DTO.IProcessSearchRequest>() { DocumentInfo = ConvertTo.ProcessSearchRequestInfo(ChavesDocumento) }); return(new DsMessage(documentList.Message, (documentList.Status == SUCCESS && documentList.TotalFound > 0 ? 0 : 404))); } }
public void ConsultaDocumento() { var documentList = proxy.Search(new DS3Connector.DTO.SearchRequest <DS3Connector.DTO.IBoxSearchRequest>() { DocumentInfo = new DS3Connector.DTO.BoxSearchRequestInfo() { ComarcaID = "64088", VaraID = "10003220", NroPacote = "582", AnoPacote = "2002", NroCaixa = "9009482868" } }); Assert.IsTrue(documentList.Status == Constants.SUCCESS); Assert.IsTrue(documentList.TotalFound == 1); Assert.IsTrue(documentList.Data.Count == 1); }