예제 #1
0
        //Valida la existencia de una reservación
        public void FindReservationTest()
        {
            int a = dao.AddReservationFlight(entity);

            bool b = dao.FindReservation(a);

            Assert.AreEqual(true, b);
        }
        public void Execute()
        {
            // try
            //{

            //Obtiene el DAO correspondiente por medio de las factories
            DAOFactory           factory      = DAOFactory.GetFactory(DAOFactory.Type.Postgres);
            ReservationFlightDAO ResFlightDao = factory.GetReservationFlightDAO();

            //Valida que exista la reserva
            bool f = ResFlightDao.FindReservation(Id);

            if (!f)
            {
                throw new ValidationErrorException("La reserva a borrar no existe");
            }

            ResFlightDao.DeleteReservationFlight(this.Id);

            /*  }
             * catch (ValidationErrorException ex)
             * {
             *    throw new Exception(ex.Message);
             * }
             * catch(Exception ex)
             * {
             *   throw new Exception(ex.Message);
             * }*/
        }