Examples of ofy()


Examples of classes.DAO.ofy()

        /* if user press the Update Reservation Button */
        if (updateReservation != null) {
            /* all fields must be filled && and reservation id must match with the one from DB*/
            if (reservationId.isEmpty() || aDate.isEmpty() || rDate.isEmpty()
                    || dao.ofy().find(HotelReservation.class, reservationId) == null) {
                request.setAttribute("errorMessage", "<font size=\"2\" "
                        + "face=\"arial\" color=\"red\">"
                        + "Invalid Reservation id! <br/>"
                        + "</font>");
                RequestDispatcher rd = request.getRequestDispatcher("reservations.jsp");
View Full Code Here

Examples of classes.DAO.ofy()

            } else {
                /*
                 * PUT method
                 */
                /* extract from the DB the reservation that the user want to update*/
                HotelReservation HR = dao.ofy().find(HotelReservation.class, reservationId);

                /*create the query link*/
                String link = "http://mdwhotel.appspot.com/api/v1/reservation/?res_id=";
                link += reservationId + "&start=" + aDate + "&end=" + rDate + "&email=" + HR.getEmail();

View Full Code Here

Examples of classes.DAO.ofy()

                 * and I'm not deleting the reservation that he made before
                 */
                if (!resp.contains("Sorry - the room is not free in these days")) {

                    /*delete the last reservation because they will send to me anotherone*/
                    dao.ofy().delete(HR);
                    /* parse the XML file that I receive from them*/
                    StringToXML(resp);
                    /* set the new information of the reservation*/
                    HR.setStart(Rstart);
                    HR.setEnd(Rend);
View Full Code Here

Examples of classes.DAO.ofy()

                response.sendRedirect("reservations.jsp");
            }
            /* if delete reservation button is pressed*/
            /* verify if the id is correct */
        } else if (reservationId.isEmpty()
                || dao.ofy().find(HotelReservation.class, reservationId) == null) {
            request.setAttribute("errorMessage", "<font size=\"2\" "
                    + "face=\"arial\" color=\"red\">"
                    + "Invalid Reservation id! <br/>"
                    + "</font>");
            RequestDispatcher rd = request.getRequestDispatcher("reservations.jsp");
View Full Code Here

Examples of classes.DAO.ofy()

        } else {
            /*
             * DELETE method
             */
            /* extract the desired reservation from DB*/
            HotelReservation HR = dao.ofy().find(HotelReservation.class, reservationId);

            /* create the query link */
            String link = "http://mdwhotel.appspot.com/api/v1/reservation/?res_id=";
            link += reservationId + "&email=" + HR.getEmail();

View Full Code Here

Examples of classes.DAO.ofy()

            webResource.accept("application/xml");
            /*invoke method */
            String resp = webResource.delete(String.class);

            /*delete the reservation from the DB*/
            dao.ofy().delete(HotelReservation.class, reservationId);
            /* successful */
            request.setAttribute("errorMessage", "<font size=\"2\" "
                    + "face=\"arial\" color=\"green\">"
                    + "Reservation successfully deleted!<br/>"
                    + "</font>");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.