public IList <CondicoesPagamentoDTO> selectCondicoesPagamentoPagina(int primeiroResultado, int quantidadeResultados, CondicoesPagamentoDTO condicoesPagamento) { try { IList <CondicoesPagamentoDTO> resultado = null; using (ISession session = NHibernateHelper.getSessionFactory().OpenSession()) { CondicoesPagamentoDAL DAL = new CondicoesPagamentoDAL(session); resultado = DAL.selectPagina(primeiroResultado, quantidadeResultados, condicoesPagamento); } return(resultado); } catch (Exception ex) { throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : "")); } }
public CondicoesPagamentoDTO salvarAtualizarCondicoesPagamento(CondicoesPagamentoDTO condicoesPagamento) { try { using (ISession session = NHibernateHelper.getSessionFactory().OpenSession()) { CondicoesPagamentoDAL DAL = new CondicoesPagamentoDAL(session); DAL.saveOrUpdate(condicoesPagamento); session.Flush(); } return(condicoesPagamento); } catch (Exception ex) { throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : "")); } }
public int deleteCondicoesPagamento(CondicoesPagamentoDTO condicoesPagamento) { try { int resultado = -1; using (ISession session = NHibernateHelper.getSessionFactory().OpenSession()) { CondicoesPagamentoDAL DAL = new CondicoesPagamentoDAL(session); DAL.delete(condicoesPagamento); session.Flush(); resultado = 0; } return(resultado); } catch (Exception ex) { throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : "")); } }