feat: add format=jpgEnc support (filename from rpt_CertificatesChartsAlias SP)
This commit is contained in:
@@ -14,6 +14,12 @@ namespace CertReports.Syncfusion.Services.Implementations;
|
||||
public interface IChartDataServiceV2
|
||||
{
|
||||
Task<ChartDataV2?> GetChartDataV2Async(string isin);
|
||||
|
||||
/// <summary>
|
||||
/// Ritorna l'AliasID codificato per il grafico (SP rpt_CertificatesChartsAlias).
|
||||
/// Usato dal formato jpgEnc per impostare il nome file nella risposta HTTP.
|
||||
/// </summary>
|
||||
Task<string?> GetChartAliasAsync(string isin);
|
||||
}
|
||||
|
||||
public class ChartDataServiceV2 : IChartDataServiceV2
|
||||
@@ -104,6 +110,19 @@ public class ChartDataServiceV2 : IChartDataServiceV2
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<string?> GetChartAliasAsync(string isin)
|
||||
{
|
||||
await using var conn = new SqlConnection(_connectionString);
|
||||
await conn.OpenAsync();
|
||||
|
||||
await using var cmd = new SqlCommand("rpt_CertificatesChartsAlias", conn)
|
||||
{ CommandType = CommandType.StoredProcedure };
|
||||
cmd.Parameters.AddWithValue("@isin", isin);
|
||||
|
||||
var result = await cmd.ExecuteScalarAsync();
|
||||
return result == null || result == DBNull.Value ? null : result.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Legge un campo numerico come decimal indipendentemente dal tipo SQL
|
||||
/// (decimal, float, real, int). Necessario perché cedlab_Chart_UL1 ritorna
|
||||
|
||||
Reference in New Issue
Block a user