Ejemplo n.º 1
0
 private void validarCTipoCombustivel(string cTipoCombustivel)
 {
     if (string.IsNullOrEmpty(cTipoCombustivel))
     {
         ListaErros.Add("O Tipo de combustivel não pode ser vazio.");
     }
     else
     {
         TipoCombustivel.setNCodCombustivel(int.Parse(cTipoCombustivel));
     }
 }
Ejemplo n.º 2
0
        private void validarTipoCombustivel(string tipoCombustivel)
        {
            int auxtipoCombustivel;

            if (int.TryParse(tipoCombustivel, out auxtipoCombustivel))
            {
                TipoCombustivel.setNCodCombustivel(auxtipoCombustivel);
            }
            else
            {
                ListaErros.Add("O tipo de combustível está incorreto");
            }
        }