public FreteVendaDTO salvarAtualizarFreteVenda(FreteVendaDTO freteVenda) { try { using (ISession session = NHibernateHelper.getSessionFactory().OpenSession()) { NHibernateDAL <FreteVendaDTO> DAL = new NHibernateDAL <FreteVendaDTO>(session); DAL.saveOrUpdate(freteVenda); session.Flush(); } return(freteVenda); } catch (Exception ex) { throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : "")); } }
public IList <FreteVendaDTO> selectFreteVenda(FreteVendaDTO freteVenda) { try { IList <FreteVendaDTO> resultado = null; using (ISession session = NHibernateHelper.getSessionFactory().OpenSession()) { NHibernateDAL <FreteVendaDTO> DAL = new NHibernateDAL <FreteVendaDTO>(session); resultado = DAL.select(freteVenda); } return(resultado); } catch (Exception ex) { throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : "")); } }
public int deleteFreteVenda(FreteVendaDTO freteVenda) { try { int resultado = -1; using (ISession session = NHibernateHelper.getSessionFactory().OpenSession()) { NHibernateDAL <FreteVendaDTO> DAL = new NHibernateDAL <FreteVendaDTO>(session); DAL.delete(freteVenda); session.Flush(); resultado = 0; } return(resultado); } catch (Exception ex) { throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : "")); } }