public IList<CelulaIMO> GetCeluleIMO(bool toate) { BusinessCelula bus = null; IList<CelulaIMO> ret = null; ITransaction tx = null; try { tx = nHibernateUtil.BeginTransaction(); bus = new BusinessCelula(); ret = bus.GetCeluleIMO(toate); tx.Commit(); } catch (Exception ex) { LogMessage.Error(ex); if (!nHibernateUtil.GetSession.Transaction.WasCommitted && !nHibernateUtil.GetSession.Transaction.WasRolledBack) { nHibernateUtil.GetSession.Transaction.Rollback(); } throw ex; } finally { nHibernateUtil.CloseSession(); bus = null; } return ret; }
public Celula SaveCelula(Celula c) { BusinessCelula bus = null; ITransaction tx = null; try { tx = nHibernateUtil.BeginTransaction(); bus = new BusinessCelula(); c = bus.SaveCelula(c); tx.Commit(); } catch (Exception ex) { LogMessage.Error(ex); if (!nHibernateUtil.GetSession.Transaction.WasCommitted && !nHibernateUtil.GetSession.Transaction.WasRolledBack) { nHibernateUtil.GetSession.Transaction.Rollback(); } throw ex; } finally { nHibernateUtil.CloseSession(); bus = null; } return c; }