Пример #1
0
        //Elimina reserva
        public void DeleteReservationFlightTest()
        {
            int a = dao.AddReservationFlight(entity);

            dao.DeleteReservationFlight(a);

            // Assert.IsInstanceOf<List<Entity>>(result);
        }
        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);
             * }*/
        }