Package dao

Examples of dao.DAOFactory


    final static Logger log = Logger.getLogger(ShowFlightInformation.class);
    public String getName() {
        return "ShowFlightsFrom";
    }
    public ActionResult perform(HttpServletRequest request) {
        DAOFactory factory = DAOFactory.getDAOFactory(1);
        String FlightsFrom = null;
        FlightsFrom = request.getParameter("flightFromTo");
        List<Flight> flights = factory.getFlightDAO().searchForFlightsFromAirport(FlightsFrom);
        for (Flight flight: flights) {
            flight.setDepartureAirport(factory.getAirportDAO().loadCountryName(flight.getDepartureAirport()));
            flight.setDestinationAirport(factory.getAirportDAO().loadCountryName(flight.getDestinationAirport()));
        }
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/ShowFlightsInformation.jsp");
        if (flights!=null) {
            actionResult.setUrlAddress("/flt/ShowFlightsInformation.jsp");
View Full Code Here


    final static Logger log = Logger.getLogger(ShowFlightInformation.class);
    public String getName() {
        return "ShowFlightsFrom";
    }
    public ActionResult perform(HttpServletRequest request) {
        DAOFactory factory = DAOFactory.getDAOFactory(1);
        String FlightsTo = null;
        FlightsTo = request.getParameter("flightFromTo");
        List<Flight> flights = factory.getFlightDAO().searchForFlightsToAirport(FlightsTo);
        for (Flight flight: flights) {
            flight.setDepartureAirport(factory.getAirportDAO().loadCountryName(flight.getDepartureAirport()));
            flight.setDestinationAirport(factory.getAirportDAO().loadCountryName(flight.getDestinationAirport()));
        }
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/ShowFlightsInformation.jsp");
        if (flights!=null) {
            actionResult.setUrlAddress("/flt/ShowFlightsInformation.jsp");
View Full Code Here

        return "Index";
    }

    @Override
    public ActionResult perform(HttpServletRequest request) {
        DAOFactory factory = DAOFactory.getDAOFactory(1);
        //List<Airport> airportList = factory.getAirportDAO().allAirportList();
        //List<Country> countryList = factory.getCountryDAO().allCountryList();
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("index.jsp");
//        if (airportList!=null && countryList!=null) {
View Full Code Here

    public String getName() {
        return "ShowFlightInformation";
    }
    public ActionResult perform(HttpServletRequest request) {
        DAOFactory factory = DAOFactory.getDAOFactory(1);
        Long trui=null;
        try {
            trui = Long.parseLong(request.getParameter("flightNumber"));
        } catch (NumberFormatException e) {
            log.info("I catch an exception "+e);
        }
        Flight flight = factory.getFlightDAO().showInformation(trui);
        flight.setDepartureAirport(factory.getAirportDAO().loadCountryName(flight.getDepartureAirport()));
        flight.setDestinationAirport(factory.getAirportDAO().loadCountryName(flight.getDestinationAirport()));
        ActionResult actionResult = new ActionResult();
        actionResult.setUrlAddress("flt/ShowFlightInformation.jsp");
        if (flight!=null) {
            actionResult.setUrlAddress("/flt/ShowFlightInformation.jsp");
        } else {
View Full Code Here

TOP

Related Classes of dao.DAOFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.