diff --git a/EnvelopeGenerator.Application/SQL/DocumentCreateReadSQL.cs b/EnvelopeGenerator.Application/SQL/DocumentCreateReadSQL.cs index 02b4ec73..f4f1ffb1 100644 --- a/EnvelopeGenerator.Application/SQL/DocumentCreateReadSQL.cs +++ b/EnvelopeGenerator.Application/SQL/DocumentCreateReadSQL.cs @@ -10,17 +10,17 @@ namespace EnvelopeGenerator.Application.SQL; public class DocumentCreateReadSQL : ISQL { /// - /// + /// Base64, OUT_UID /// public string Raw => @" USE [DD_ECM] DECLARE @BYTE_DATA1 as VARBINARY(MAX) - SET @BYTE_DATA1 = CONVERT(VARBINARY(MAX),'@Base64') + SET @BYTE_DATA1 = CONVERT(VARBINARY(MAX),{0}) DECLARE @OUT_DOCID int EXEC [dbo].[PRSIG_API_ADD_DOC] - @ENV_UID = @OUT_UID, + @ENV_UID = {1}, @BYTE_DATA = @BYTE_DATA1, @OUT_DOCID = @OUT_DOCID OUTPUT diff --git a/EnvelopeGenerator.Infrastructure/Executor/DocumentExecutor.cs b/EnvelopeGenerator.Infrastructure/Executor/DocumentExecutor.cs index 7143b81e..aec62eed 100644 --- a/EnvelopeGenerator.Infrastructure/Executor/DocumentExecutor.cs +++ b/EnvelopeGenerator.Infrastructure/Executor/DocumentExecutor.cs @@ -18,9 +18,9 @@ public class DocumentExecutor : SQLExecutor, IDocumentExecutor { using var connection = new SqlConnection(Params.ConnectionString); var sql = Provider.GetRequiredService(); + var formattedSql = string.Format(sql.Raw, base64, envelope_uuid); await connection.OpenAsync(cancellation); - var parameters = DocumentCreateReadSQL.CreateParmas(base64, envelope_uuid); - var documents = await connection.QueryAsync(sql.Raw, parameters); + var documents = await connection.QueryAsync(formattedSql); return documents.FirstOrDefault() ?? throw new InvalidOperationException($"Document creation failed. Parameters:" + $"base64={base64}, envelope_uuid='{envelope_uuid}'.");