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; } }
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; } }