public SeguradoraDTO salvarAtualizarSeguradora(SeguradoraDTO seguradora) { try { using (ISession session = NHibernateHelper.getSessionFactory().OpenSession()) { NHibernateDAL <SeguradoraDTO> DAL = new NHibernateDAL <SeguradoraDTO>(session); DAL.saveOrUpdate(seguradora); session.Flush(); } return(seguradora); } catch (Exception ex) { throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : "")); } }
public IList <SeguradoraDTO> selectSeguradora(SeguradoraDTO seguradora) { try { IList <SeguradoraDTO> resultado = null; using (ISession session = NHibernateHelper.getSessionFactory().OpenSession()) { NHibernateDAL <SeguradoraDTO> DAL = new NHibernateDAL <SeguradoraDTO>(session); resultado = DAL.select(seguradora); } return(resultado); } catch (Exception ex) { throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : "")); } }
public int deleteSeguradora(SeguradoraDTO seguradora) { try { int resultado = -1; using (ISession session = NHibernateHelper.getSessionFactory().OpenSession()) { NHibernateDAL <SeguradoraDTO> DAL = new NHibernateDAL <SeguradoraDTO>(session); DAL.delete(seguradora); session.Flush(); resultado = 0; } return(resultado); } catch (Exception ex) { throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : "")); } }
public new List <SeguradoraDTO> selectSeguradora(SeguradoraDTO dtoPesquisa) { return(base.selectSeguradora(dtoPesquisa)); }