Exemplo n.º 1
0
        /// <summary>
        /// Converter uma linha do tipo 80 ema <see cref="NotaFiscal"/>
        /// </summary>
        /// <param name="file">linha do arquivo a ser convertida</param>
        private void lerNotaFiscal(TextFieldParser file)
        {
            var param = new int[] { 2, 12, 25, 8, 6, 8, 3, 15, 15, 13, 1, 12, 204, 25, 1 };

            file.SetFieldWidths(param);
            var array = file.ReadFields();

            using (var nfBus = new NotaFiscalBusiness())
            {
                var nf = nfBus.Parse(array, _conta);
                nfBus.SaveOrUpdate(nf);
            }
        }