Skip to content

Commit

Permalink
Rolback de ajuste da nova versão
Browse files Browse the repository at this point in the history
  • Loading branch information
VanderleiDenir committed Jun 20, 2020
1 parent 80d846f commit e9f702d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions OPS.Core/DAO/DeputadoDao.cs
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,14 @@ FROM cf_sessao_presenca sp
break;
}

if (filtro.Partido.Any())
if (!string.IsNullOrEmpty(filtro.Partido))
{
strSql.AppendLine(" AND d.id_partido IN(" + string.Join(",", filtro.Partido) + ") ");
strSql.AppendLine(" AND d.id_partido IN(" + Utils.MySqlEscapeNumberToIn(filtro.Partido) + ") ");
}

if (filtro.Estado.Any())
if (!string.IsNullOrEmpty(filtro.Uf))
{
strSql.AppendLine(" AND d.id_estado IN(" + string.Join(",", filtro.Estado) + ") ");
strSql.AppendLine(" AND d.id_estado IN(" + Utils.MySqlEscapeNumberToIn(filtro.Uf) + ") ");
}

strSql.AppendLine(@"
Expand Down Expand Up @@ -1187,17 +1187,17 @@ private static void AdicionaFiltroPeriodo(FiltroParlamentarDTO filtro, StringBui

private static void AdicionaFiltroPartidoDeputado(FiltroParlamentarDTO filtro, StringBuilder sqlSelect)
{
if (filtro.Partido.Any())
if (!string.IsNullOrEmpty(filtro.Partido))
{
sqlSelect.AppendLine(" AND l.id_cf_deputado IN (SELECT id FROM cf_deputado where id_partido IN(" + string.Join(",", filtro.Partido) + ")) ");
sqlSelect.AppendLine(" AND l.id_cf_deputado IN (SELECT id FROM cf_deputado where id_partido IN(" + Utils.MySqlEscapeNumberToIn(filtro.Partido) + ")) ");
}
}

private static void AdicionaFiltroEstadoDeputado(FiltroParlamentarDTO filtro, StringBuilder sqlSelect)
{
if (filtro.Estado.Any())
if (!string.IsNullOrEmpty(filtro.Uf))
{
sqlSelect.AppendLine(" AND l.id_cf_deputado IN (SELECT id FROM cf_deputado where id_estado IN(" + string.Join(",", filtro.Estado) + ")) ");
sqlSelect.AppendLine(" AND l.id_cf_deputado IN (SELECT id FROM cf_deputado where id_estado IN(" + Utils.MySqlEscapeNumberToIn(filtro.Uf) + ")) ");
}
}

Expand Down
8 changes: 4 additions & 4 deletions OPS.Core/DAO/DeputadoEstadualDao.cs
Original file line number Diff line number Diff line change
Expand Up @@ -871,17 +871,17 @@ private static void AdicionaFiltroPeriodo(FiltroParlamentarDTO filtro, StringBui

private static void AdicionaFiltroEstadoDeputadoEstadual(FiltroParlamentarDTO filtro, StringBuilder sqlSelect)
{
if (filtro.Partido.Any())
if (!string.IsNullOrEmpty(filtro.Partido))
{
sqlSelect.AppendLine(" AND l.id_cl_deputado IN (SELECT id FROM cl_deputado where id_partido IN(" + string.Join(",", filtro.Partido) + ")) ");
sqlSelect.AppendLine(" AND l.id_cl_deputado IN (SELECT id FROM cl_deputado where id_partido IN(" + Utils.MySqlEscapeNumberToIn(filtro.Partido) + ")) ");
}
}

private static void AdicionaFiltroPartidoDeputadoEstadual(FiltroParlamentarDTO filtro, StringBuilder sqlSelect)
{
if (filtro.Estado.Any())
if (!string.IsNullOrEmpty(filtro.Uf))
{
sqlSelect.AppendLine(" AND l.id_cl_deputado IN (SELECT id FROM cl_deputado where id_estado IN(" + string.Join(",", filtro.Estado) + ")) ");
sqlSelect.AppendLine(" AND l.id_cl_deputado IN (SELECT id FROM cl_deputado where id_estado IN(" + Utils.MySqlEscapeNumberToIn(filtro.Uf) + ")) ");
}
}

Expand Down
8 changes: 4 additions & 4 deletions OPS.Core/DAO/SenadorDao.cs
Original file line number Diff line number Diff line change
Expand Up @@ -856,17 +856,17 @@ private static void AdicionaFiltroPeriodo(FiltroParlamentarDTO filtro, StringBui

private static void AdicionaFiltroEstadoSenador(FiltroParlamentarDTO filtro, StringBuilder sqlSelect)
{
if (filtro.Partido.Any())
if (!string.IsNullOrEmpty(filtro.Partido))
{
sqlSelect.AppendLine(" AND l.id_sf_senador IN (SELECT id FROM sf_senador where id_partido IN(" + string.Join(",", filtro.Partido) + ")) ");
sqlSelect.AppendLine(" AND l.id_sf_senador IN (SELECT id FROM sf_senador where id_partido IN(" + Utils.MySqlEscapeNumberToIn(filtro.Partido) + ")) ");
}
}

private static void AdicionaFiltroPartidoSenador(FiltroParlamentarDTO filtro, StringBuilder sqlSelect)
{
if (filtro.Estado.Any())
if (!string.IsNullOrEmpty(filtro.Uf))
{
sqlSelect.AppendLine(" AND l.id_sf_senador IN (SELECT id FROM sf_senador where id_estado IN(" + string.Join(",", filtro.Estado) + ")) ");
sqlSelect.AppendLine(" AND l.id_sf_senador IN (SELECT id FROM sf_senador where id_estado IN(" + Utils.MySqlEscapeNumberToIn(filtro.Uf) + ")) ");
}
}

Expand Down

0 comments on commit e9f702d

Please sign in to comment.