From 38e8488cbf1c4abcac238d119ecd7f4bfd505b5b Mon Sep 17 00:00:00 2001 From: Andres Ramos Date: Fri, 15 Dec 2023 20:03:18 -0600 Subject: [PATCH] agrega ejemplo de como relacionar documentos cfdi --- .../DependencyInjection.cs | 1 + .../Documentos/RelacionarDocumento.cs | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 samples/Sdk.Extras.ConsoleApp/Documentos/RelacionarDocumento.cs diff --git a/samples/Sdk.Extras.ConsoleApp/DependencyInjection.cs b/samples/Sdk.Extras.ConsoleApp/DependencyInjection.cs index ff9ba5b..6ce70ee 100644 --- a/samples/Sdk.Extras.ConsoleApp/DependencyInjection.cs +++ b/samples/Sdk.Extras.ConsoleApp/DependencyInjection.cs @@ -48,6 +48,7 @@ public static IServiceCollection AddEjemplos(this IServiceCollection serviceColl serviceCollection.AddTransient(); serviceCollection.AddTransient(); serviceCollection.AddTransient(); + serviceCollection.AddTransient(); serviceCollection.AddTransient(); serviceCollection.AddTransient(); diff --git a/samples/Sdk.Extras.ConsoleApp/Documentos/RelacionarDocumento.cs b/samples/Sdk.Extras.ConsoleApp/Documentos/RelacionarDocumento.cs new file mode 100644 index 0000000..93ebd27 --- /dev/null +++ b/samples/Sdk.Extras.ConsoleApp/Documentos/RelacionarDocumento.cs @@ -0,0 +1,29 @@ +using ARSoftware.Contpaqi.Comercial.Sdk.DatosAbstractos; +using ARSoftware.Contpaqi.Comercial.Sdk.Extras.Interfaces; + +namespace Sdk.Extras.ConsoleApp; + +public sealed class RelacionarDocumento +{ + private readonly IDocumentoService _documentoService; + + public RelacionarDocumento(IDocumentoService documentoService) + { + _documentoService = documentoService; + } + + public void RelacionPorLlave() + { + var documento = new tLlaveDoc { aCodConcepto = "PRUEBAFACTURA", aSerie = "PRUEBA", aFolio = 1 }; + var documentoARelacionar = new tLlaveDoc { aCodConcepto = "PRUEBAFACTURA", aSerie = "PRUEBA", aFolio = 2 }; + + _documentoService.RelacionarDocumentos(documento, "01", documentoARelacionar); + } + + public void RelacionPorUuid() + { + var documento = new tLlaveDoc { aCodConcepto = "PRUEBAFACTURA", aSerie = "PRUEBA", aFolio = 1 }; + + _documentoService.RelacionarDocumentos(documento, "03", "51F58A42-3827-49A3-A1E5-54CADF80F9C6"); + } +}