コード例 #1
0
        public void Execute()
        {
            //try
            //{

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

            int ida = ResFlightDao.GetIDLocation(names_city[0]);
            int idb = ResFlightDao.GetIDLocation(names_city[1]);

            if (ida == -1 || idb == -1)
            {
                throw new ValidationErrorException("Una de las ciudades no existe");
            }

            id_locations.Add(ida);
            id_locations.Add(idb);

            /* }
             * catch (ValidationErrorException ex)
             * {
             * throw new Exception(ex.Message);
             * }
             * catch(Exception ex)
             * {
             *  throw new Exception(ex.Message);
             * }*/
        }
コード例 #2
0
        //Trae id de una loc
        public void GetIDLocationTest()
        {
            int a = dao.GetIDLocation("Caracas");

            Assert.Less(0, a);
        }