Developer 02 2ba7f41a21 Remove SQL command string from DocumentCreateReadSQL
This commit removes a SQL command string from the `Raw` property in the `DocumentCreateReadSQL` class. The changes include the deletion of a `USE` statement for the `[DD_ECM]` database, variable declarations, and the execution of a stored procedure. This alters the structure and execution of SQL commands within the class.
2025-05-07 14:27:09 +02:00

44 lines
1.1 KiB
C#

using Dapper;
using EnvelopeGenerator.Application.Contracts.SQLExecutor;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.SQL;
/// <summary>
///
/// </summary>
public class DocumentCreateReadSQL : ISQL<EnvelopeDocument>
{
/// <summary>
/// Base64, OUT_UID
/// </summary>
public string Raw => @"
DECLARE @BYTE_DATA1 as VARBINARY(MAX)
SET @BYTE_DATA1 = CONVERT(VARBINARY(MAX),{0})
DECLARE @OUT_DOCID int
EXEC [dbo].[PRSIG_API_ADD_DOC]
@ENV_UID = {1},
@BYTE_DATA = @BYTE_DATA1,
@OUT_DOCID = @OUT_DOCID OUTPUT
SELECT TOP(1) *
FROM [dbo].[TBSIG_ENVELOPE_DOCUMENT]
WHERE [GUID] = @OUT_DOCID
";
/// <summary>
///
/// </summary>
/// <param name="base64"></param>
/// <param name="envelope_uuid"></param>
/// <returns></returns>
public static DynamicParameters CreateParmas(string base64, string envelope_uuid)
{
var parameters = new DynamicParameters();
parameters.Add("@Base64", base64);
parameters.Add("@OUT_UID", envelope_uuid);
return parameters;
}
}