Example #1
0
        public List <NotaFiscalDao> Listar(NotaFiscalDao notaFiscalDao)
        {
            try
            {
                return(notaFiscalRepository.Listar(notaFiscalDao.ToBd()).Select(x => x.ToApp()).ToList());
            }
            catch (BusinessException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                logRepository.Incluir(new Log()
                {
                    Descricao = ex.ToString(), DataHora = DateTime.Now
                });

                throw ex;
            }
        }
Example #2
0
        public int Incluir(NotaFiscalDao notaFiscalDao)
        {
            try
            {
                ValidarIncluir(notaFiscalDao);

                return(notaFiscalRepository.Incluir(notaFiscalDao.ToBd()));
            }
            catch (BusinessException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                logRepository.Incluir(new Log()
                {
                    Descricao = ex.ToString(), DataHora = DateTime.Now
                });

                throw ex;
            }
        }