Esempio n. 1
0
        public DsMessage ExcluirArquivo(string NomeDocumento, List <DsKeyword> ChavesDocumento)
        {
            var docTypeId = ConvertTo.DocTypeId(NomeDocumento);

            if (!docTypeId.HasValue)
            {
                throw new InvalidCastException("Tipo de documento inválido!");
            }

            //Apaga Documento
            if (docTypeId == 65)
            {
                var resultDelete = documentProxy.Delete(new DS3Connector.DTO.UpdateDocument <BoxInfo>()
                {
                    DocumentInfo = ConvertTo.BoxInfo(ChavesDocumento)
                });

                return(new DsMessage(resultDelete.Message, (resultDelete.Status == SUCCESS && resultDelete.TotalFound > 0 ? 0 : 404)));
            }
            else
            {
                var resultDelete = documentProxy.Delete(new DS3Connector.DTO.UpdateDocument <ProcessInfo>()
                {
                    DocumentInfo = ConvertTo.ProcessInfo(ChavesDocumento)
                });

                return(new DsMessage(resultDelete.Message, (resultDelete.Status == SUCCESS && resultDelete.TotalFound > 0 ? 0 : 404)));
            }
        }
        public void CleanUp()
        {
            var newDocument = RecuperaDocumentoTeste(documentId);

            if (newDocument != null)
            {
                //Delete Document
                var deleteResult = proxy.Delete(new DS3Connector.DTO.UpdateDocument <DS3Connector.DTO.BoxInfo>()
                {
                    Id           = newDocument.Id,
                    DocumentInfo = newDocument.DocumentInfo
                });

                if (deleteResult.Status != Constants.SUCCESS)
                {
                    Assert.Fail("Falha na exclusão do registro de teste!");
                }
            }
        }