Demandas não estavam sendo atualizadas nos dados cadastrais. Correção realizada
This commit is contained in:
parent
cf2026862c
commit
0beff7380d
@ -269,33 +269,40 @@
|
||||
dadosTusd.Dem_Cont_FP = item.contract;
|
||||
}
|
||||
|
||||
using (OleDbCommand cmd = new OleDbCommand(sqlQuery, conn))
|
||||
{
|
||||
if (dadosTusd.Perfil == "AZUL")
|
||||
{
|
||||
if (item.period == "peak")
|
||||
{
|
||||
sqlQuery = $"UPDATE Dados_cadastrais SET Demanda_P = @demanda WHERE Cod_Smart_unidade = @cod_smart_unidade";
|
||||
using (OleDbCommand cmd = new OleDbCommand(sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@demanda", item.contract);
|
||||
cmd.Parameters.AddWithValue("@cod_smart_unidade", dadosTusd.Cod_Smart_unidade);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
else if (item.period == "off-peak")
|
||||
{
|
||||
sqlQuery = $"UPDATE Dados_cadastrais SET Demanda_FP = @demanda WHERE Cod_Smart_unidade = @cod_smart_unidade";
|
||||
using (OleDbCommand cmd = new OleDbCommand(sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@demanda", item.contract);
|
||||
cmd.Parameters.AddWithValue("@cod_smart_unidade", dadosTusd.Cod_Smart_unidade);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (dadosTusd.Perfil == "VERDE")
|
||||
{
|
||||
sqlQuery = $"UPDATE Dados_cadastrais SET Demanda_P = @demanda, Demanda_FP = @demanda WHERE Cod_Smart_unidade = @cod_smart_unidade";
|
||||
using (OleDbCommand cmd = new OleDbCommand(sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@demanda", item.contract);
|
||||
cmd.Parameters.AddWithValue("@cod_smart_unidade", dadosTusd.Cod_Smart_unidade);
|
||||
}
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user