Package org.strecks.holidaybooking.domain

Examples of org.strecks.holidaybooking.domain.HolidayBooking


      HolidayBookingForm holidayBookingForm = (HolidayBookingForm) form;

      HolidayBookingService holidayBookingService = (HolidayBookingService) getWebApplicationContext().getBean(
          "holidayBookingService");

      HolidayBooking holidayBooking = new HolidayBooking();
      holidayBookingForm.writeTo(holidayBooking);

      holidayBookingService.addHolidayBooking(holidayBooking);

      request.setAttribute("displayMessage", "Successfully added entry: " + holidayBooking.getTitle());
    }
    else
    {
      request.setAttribute("displayMessage", "Cancelled operation");
    }
View Full Code Here


  {
    HolidayBookingService holidayBookingService = (HolidayBookingService) getWebApplicationContext().getBean(
        "holidayBookingService");

    long id = Long.parseLong(request.getParameter("holidayBookingId"));
    HolidayBooking holidayBookings = holidayBookingService.getHolidayBooking(id);
    request.setAttribute("holidayBooking", holidayBookings);

    return mapping.findForward("success");
  }
View Full Code Here

    holidayForm.setEditMode(true);

    if (!isInputError)
    {
      long id = Long.parseLong(request.getParameter("holidayBookingId"));
      HolidayBooking holidayBooking = holidayBookingService.getHolidayBooking(id);
      holidayForm.readFrom(holidayBooking);
      holidayForm.setEditMode(true);
    }
   
    return mapping.findForward("success");
View Full Code Here

    if (request.getAttribute(Globals.CANCEL_KEY) == null)
    {
      HolidayBookingService holidayBookingService = (HolidayBookingService) getWebApplicationContext().getBean(
          "holidayBookingService");

      HolidayBooking holidayBooking = new HolidayBooking();
      holidayBookingForm.writeTo(holidayBooking);

      holidayBookingService.updateHolidayBooking(holidayBooking);

      request.setAttribute("displayMessage", "Successfully updated entry: " + holidayBooking.getTitle());
    }
    else
    {
      request.setAttribute("displayMessage", "Cancelled operation");
    }
View Full Code Here

    holidayBookings.clear();
   
    counter = 1;

    HolidayBooking booking = new HolidayBooking();
    booking.setTitle("Go to Alaska");
    Calendar cal = Calendar.getInstance();
    cal.set(2006, 5, 20);
    booking.setStartDate(cal.getTime());
    booking.setDays(5);
    addHolidayBooking(booking);

    booking = new HolidayBooking();
    booking.setTitle("Weekend break to Venice");
    cal = Calendar.getInstance();
    cal.set(2006, 2, 7);
    booking.setStartDate(cal.getTime());
    booking.setDays(5);
    addHolidayBooking(booking);

    booking = new HolidayBooking();
    booking.setTitle("Camping in Cornwall");
    cal = Calendar.getInstance();
    cal.set(2006, 8, 11);
    booking.setStartDate(cal.getTime());
    booking.setDays(7);
    addHolidayBooking(booking);

    booking = new HolidayBooking();
    booking.setTitle("Sailing to Holland");cal = Calendar.getInstance();
    cal.set(2006, 9, 21);
    booking.setStartDate(cal.getTime());
    booking.setDays(7);
    addHolidayBooking(booking);
  }
View Full Code Here

  private WebHelper webHelper;

  public void preBind()
  {
    form.setBooking(new HolidayBooking());
  }
View Full Code Here

    return "success";
  }

  public String execute()
  {
    HolidayBooking holidayBooking = form.getBooking();
    holidayBookingService.addHolidayBooking(holidayBooking);

    webHelper.setRequestAttribute("displayMessage", "Successfully added entry: " + holidayBooking.getTitle());
    webHelper.removeSessionAttribute("holidayBookingForm");

    return "success";
  }
View Full Code Here

  private long holidayBookingId;

  public String execute()
  {
    HolidayBooking holidayBookings = holidayBookingService.getHolidayBooking(holidayBookingId);
    webHelper.setRequestAttribute("holidayBooking", holidayBookings);
    return "success";
  }
View Full Code Here

  public String execute()
  {
    if (!isInputError())
    {
      if (holidayBookingId == null) throw new StaleSessionException();
      HolidayBooking holidayBooking = holidayBookingService.getHolidayBooking(holidayBookingId);
      form.setBooking(holidayBooking);

      //add support for selecting a leave type
      form.setLeaveTypes(holidayBookingService.getLeaveTypes());
     
View Full Code Here

    return "success";
  }

  public String execute()
  {
    HolidayBooking holidayBooking = form.getBooking();
    holidayBookingService.updateHolidayBooking(holidayBooking);

    webHelper.setRequestAttribute("displayMessage", "Successfully updated entry: " + holidayBooking.getTitle());
    webHelper.removeSessionAttribute("holidayBookingForm");

    return "success";
  }
View Full Code Here

TOP

Related Classes of org.strecks.holidaybooking.domain.HolidayBooking

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.