cambios variables de ambiente

This commit is contained in:
bcastrogallardo 2025-07-01 09:59:59 -04:00
parent 222d5fdc08
commit 0d67a44d36
20 changed files with 261 additions and 297 deletions

View file

@ -9,25 +9,17 @@ using System.Text;
using System.Threading.Tasks;
using Dapper;
using Microsoft.Extensions.Configuration;
using Shared.Utils.Variables_Entorno;
using Shared.DTO.VariablesEntorno;
namespace DAL
{
public class JobsDgaRepository
{
private readonly IConfiguration _configuration;
private readonly BD_Conexion _bdConexion;
public JobsDgaRepository(IConfiguration configuration,BD_Conexion bdConexion)
{
_configuration = configuration;
_bdConexion = bdConexion;
}
public async Task<bool> InsertarDgaMacroResultado(List<DgaMacroResultado> dgaMacroResultados)
{
try
{
using (SqlConnection connection = new SqlConnection(_bdConexion.stringConnection))
using (SqlConnection connection = new SqlConnection(BdConexion.StringConnection))
{
await connection.OpenAsync();
// 1. Truncar la tabla antes de insertar
@ -49,7 +41,7 @@ namespace DAL
{
try
{
using (var connection = new SqlConnection(_bdConexion.stringConnection))
using (var connection = new SqlConnection(BdConexion.StringConnection))
{
await connection.OpenAsync();
@ -77,7 +69,7 @@ namespace DAL
try
{
// Configurar la conexión a la base de datos
using (SqlConnection connection = new SqlConnection(_bdConexion.stringConnection))
using (SqlConnection connection = new SqlConnection(BdConexion.StringConnection))
{
await connection.OpenAsync();
// Truncar la tabla antes de insertar
@ -102,7 +94,7 @@ namespace DAL
{
try
{
using (var connection = new SqlConnection(_bdConexion.stringConnection))
using (var connection = new SqlConnection(BdConexion.StringConnection))
{
await connection.OpenAsync();
// Ejecuta el stored procedure sin parámetros
@ -120,7 +112,7 @@ namespace DAL
{
try
{
using (var connection = new SqlConnection(_bdConexion.stringConnection))
using (var connection = new SqlConnection(BdConexion.StringConnection))
{
await connection.OpenAsync();
await connection.ExecuteAsync(
@ -140,7 +132,7 @@ namespace DAL
{
try
{
using (var connection = new SqlConnection(_bdConexion.stringConnection))
using (var connection = new SqlConnection(BdConexion.StringConnection))
{
await connection.OpenAsync();
await connection.ExecuteAsync(