diff --git a/Program.cs b/Program.cs index d83d412..05fbbf2 100644 --- a/Program.cs +++ b/Program.cs @@ -59,7 +59,7 @@ class Program await pipefyApi.CreateRecordsAsync(AppSettings.PIPEFY_TABLE_ID, recordsMissingInJson); int maxCId = recordsMissingInJson.OrderByDescending(s => s.c_digo_smart!.Length).First().c_digo_smart!.Length; int maxCNome = recordsMissingInJson.OrderByDescending(s => s.nome_da_empresa!.Length).First().nome_da_empresa!.Length; - int maxCMod = recordsMissingInJson.OrderByDescending(s => (s.modalidade ?? "").Length).First().modalidade!.Length; + int maxCMod = (recordsMissingInJson.OrderByDescending(s => (s.modalidade ?? "Modalidade").Length).First().modalidade ?? "Modalidade").Length; int maxCGestao = recordsMissingInJson.OrderByDescending(s => s.gestores!.Length).First().gestores!.Length; foreach (var record in recordsMissingInJson) { diff --git a/Services/DatabaseService.cs b/Services/DatabaseService.cs index 0fece89..acbacc9 100644 --- a/Services/DatabaseService.cs +++ b/Services/DatabaseService.cs @@ -19,7 +19,7 @@ namespace Pipefy.Services gestao AS gestores FROM dados_cadastrais WHERE cod_smart_unidade LIKE '%001' - AND unidade_gerenciada;"; + AND unidade_gerenciada AND modalidade <> '';"; var data = connection.Query(sqlQuery).AsList(); // rec_id is not in the DB, set to empty string foreach (var item in data)