Пример #1
0
        public int guardarTanque(TanqueVO t)
        {
            int rows = 0;
            ITransaction tx = null;

            try
            {
                ISession session = ConnectionHelper.getCurrentSession(Utilidades.Utilidades.configExpo);
                tx = session.BeginTransaction();

                if (t.IdTanque == 0)
                {
                    session.Save(t);
                }
                else
                {
                    session.Update(t);
                }

                tx.Commit();
                rows++;

                ConnectionHelper.CloseSession();

                return rows;

            }
            catch (Exception ex)
            {
                throw new EstacionDBException("Error al guardar en la tabla tanques", ex);
            }
        }
 public int guardarTanque(TanqueVO t)
 {
     try
     {
         return getTanquesDAO().guardarTanque(t);
     }
     catch (EstacionDBException ex)
     {
         throw new PersistenciaException("Error al guardar el tanque" , ex);
     }
 }