public void ExcluirRegistroHoras(RegistroHoras registroHora) { try { DAO.Delete(registroHora); } catch (DbUpdateException) { throw new Exceptions.ErroAoExcluir(registroHora); } catch (Exception) { throw new Exceptions.ErroDesconhecido(); } }
public void SalvarRegistroHoras(RegistroHoras registroHora) { try { if (registroHora.registro == 0) { registroHora.saida = DateTime.Parse("1900-01-01"); DAO.Add(registroHora); DAO.CommitChanges(); } else { DAO.Update(registroHora, registroHora.registro); } } catch (DbUpdateException) { throw new Exceptions.ErroAoAtualizar(registroHora); } catch (Exception) { throw new Exceptions.ErroAoSalvar(registroHora); } }