Exemple #1
0
 public PontoParametroDTO salvarAtualizarPontoParametro(PontoParametroDTO pontoParametro)
 {
     try
     {
         using (ISession session = NHibernateHelper.getSessionFactory().OpenSession())
         {
             NHibernateDAL <PontoParametroDTO> DAL = new NHibernateDAL <PontoParametroDTO>(session);
             DAL.saveOrUpdate(pontoParametro);
             session.Flush();
         }
         return(pontoParametro);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
Exemple #2
0
 public IList <PontoParametroDTO> selectPontoParametro(PontoParametroDTO pontoParametro)
 {
     try
     {
         IList <PontoParametroDTO> resultado = null;
         using (ISession session = NHibernateHelper.getSessionFactory().OpenSession())
         {
             NHibernateDAL <PontoParametroDTO> DAL = new NHibernateDAL <PontoParametroDTO>(session);
             resultado = DAL.select(pontoParametro);
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
Exemple #3
0
 public int deletePontoParametro(PontoParametroDTO pontoParametro)
 {
     try
     {
         int resultado = -1;
         using (ISession session = NHibernateHelper.getSessionFactory().OpenSession())
         {
             NHibernateDAL <PontoParametroDTO> DAL = new NHibernateDAL <PontoParametroDTO>(session);
             DAL.delete(pontoParametro);
             session.Flush();
             resultado = 0;
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }