Skip to content

Commit f3d7069

Browse files
Merge pull request #1598 from AgnaldoSilva0/Branch_23049_ci
cleanup: refatoração de código que gera avisos no pipeline
2 parents c077684 + e353c53 commit f3d7069

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

CTe.Classes/CTeOutrosServicos/Extensoes/extretCteOS.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,10 @@ public static void SalvarXmlEmDisco(this retCTeOS retEnviCte, ConfiguracaoServic
3535
{
3636
if (config.NaoSalvarXml()) return;
3737

38-
var dataEnvio = DateTimeOffset.Now;
39-
40-
if (retEnviCte != null && retEnviCte.protCTe != null
41-
&& retEnviCte.protCTe.infProt != null
42-
&& retEnviCte.protCTe.infProt.dhRecbto != null)
43-
{
44-
dataEnvio = retEnviCte.protCTe.infProt.dhRecbto;
45-
}
46-
4738
var caminhoXml = config.DiretorioSalvarXml;
48-
4939
var protocolo = "000000";
50-
51-
52-
if (retEnviCte != null && retEnviCte.protCTe != null
53-
&& retEnviCte.protCTe.infProt != null
54-
&& retEnviCte.protCTe.infProt.nProt != null)
40+
41+
if (retEnviCte?.protCTe?.infProt?.nProt != null)
5542
{
5643
protocolo = retEnviCte.protCTe.infProt.nProt;
5744
}

CTe.Servicos/DistribuicaoDFe/RetornoCteDistDFeInt.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
/* Rua Comendador Francisco josé da Cunha, 111 - Itabaiana - SE - 49500-000 */
3232
/********************************************************************************/
3333

34-
35-
3634
using CTe.Classes.Servicos.DistribuicaoDFe;
3735

3836
namespace CTe.Servicos.DistribuicaoDFe
@@ -46,12 +44,11 @@ public RetornoCteDistDFeInt(string envioStr, string retornoStr, string retornoCo
4644
RetornoCompletoStr = retornoCompletaStr;
4745
Retorno = retorno;
4846
}
49-
50-
47+
5148
public string EnvioStr { get; protected set; }
5249
public string RetornoStr { get; protected set; }
5350
public string RetornoCompletoStr { get; protected set; }
5451

55-
public new retDistDFeInt Retorno { get; set; }
52+
public retDistDFeInt Retorno { get; set; }
5653
}
5754
}

DFe.Utils/FrxFileHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static byte[] TryGetFrxFile(string caminho)
1919
var bytes = File.ReadAllBytes(path);
2020
return bytes.Length == 0 ? null : bytes;
2121
}
22-
catch (Exception e)
22+
catch (Exception)
2323
{
2424
return null;
2525
}

NFe.Classes/Informacoes/Agropecuario/agropecuario.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ public class agropecuario
44
{
55
#if NET5_0_OR_GREATER//o uso de tipos de referência anuláveis não é permitido até o C# 8.0.
66

7+
#nullable enable
8+
79
/// <summary>
810
/// ZF02 - serieGuia
911
/// </summary>
@@ -13,6 +15,8 @@ public class agropecuario
1315
/// ZF04 - Guia de Trânsito
1416
/// </summary>
1517
public guiaTransito? guiaTransito { get; set; }
18+
19+
#nullable disable
1620

1721
public bool ShouldSerializedefensivo()
1822
{

NFe.Classes/Informacoes/Agropecuario/guiaTransito.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public class guiaTransito
88
/// </summary>
99
public TipoGuia tpGuia { get; set; }
1010

11+
#nullable enable
12+
1113
/// <summary>
1214
/// ZF06 - UF de emissão
1315
/// </summary>
@@ -18,6 +20,8 @@ public class guiaTransito
1820
/// </summary>
1921
public string? serieGuia { get; set; }
2022

23+
#nullable disable
24+
2125
/// <summary>
2226
/// ZF08 - Número da Guia
2327
/// </summary>

NFe.Classes/Servicos/Status/retConsStatServ.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ public string ProxydhRetorno
108108
/// FR11 - Informações adicionais para o Contribuinte
109109
/// </summary>
110110
#if NET5_0_OR_GREATER//o uso de tipos de referência anuláveis não é permitido até o C# 8.0.
111+
112+
#nullable enable
113+
111114
public string? xObs { get; set; }
115+
116+
#nullable disable
112117
#else
113118
public string xObs { get; set; }
114119
#endif

0 commit comments

Comments
 (0)