Atualiza a demanda contratada nos dados cadastrais conforme a TUSD.
This commit is contained in:
parent
76650c282b
commit
dab453279b
@ -3,6 +3,7 @@
|
||||
using System.Data.OleDb;
|
||||
using System.Globalization;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
@ -225,14 +226,42 @@
|
||||
|
||||
// Demanda Ponta
|
||||
case ("demand", "peak"):
|
||||
dadosTusd.Dem_Cont_P = item.contract == 0 ? dadosTusd.Dem_Cont_P : item.contract;
|
||||
dadosTusd.Dem_Reg_P = item.billed;
|
||||
|
||||
if (item.contract != 0)
|
||||
{
|
||||
dadosTusd.Dem_Cont_P = item.contract;
|
||||
if (dadosTusd.Perfil == "AZUL")
|
||||
{
|
||||
cmd.CommandText = $"UPDATE Dados_cadastrais SET Demanda_P = {item.contract} WHERE Cod_Smart_unidade = {dadosTusd.Cod_Smart_unidade}";
|
||||
}
|
||||
else if (dadosTusd.Perfil == "VERDE")
|
||||
{
|
||||
cmd.CommandText = $"UPDATE Dados_cadastrais SET Demanda_P = {item.contract}, Demanda_FP = {item.contract} WHERE Cod_Smart_unidade = {dadosTusd.Cod_Smart_unidade}";
|
||||
}
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// Demanda Fora de Ponta
|
||||
case ("demand", "off-peak"):
|
||||
dadosTusd.Dem_Cont_FP = item.contract == 0 ? dadosTusd.Dem_Cont_FP : item.contract;
|
||||
dadosTusd.Dem_Reg_FP = item.billed;
|
||||
|
||||
if (item.contract != 0)
|
||||
{
|
||||
dadosTusd.Dem_Cont_FP = item.contract;
|
||||
if (dadosTusd.Perfil == "AZUL")
|
||||
{
|
||||
cmd.CommandText = $"UPDATE Dados_cadastrais SET Demanda_FP = {item.contract} WHERE Cod_Smart_unidade = {dadosTusd.Cod_Smart_unidade}";
|
||||
}
|
||||
else if (dadosTusd.Perfil == "VERDE")
|
||||
{
|
||||
cmd.CommandText = $"UPDATE Dados_cadastrais SET Demanda_P = {item.contract}, Demanda_FP = {item.contract} WHERE Cod_Smart_unidade = {dadosTusd.Cod_Smart_unidade}";
|
||||
}
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// Ilum. publica
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user