@Override
protected ModelAndView processFinish(HttpServletRequest arg0,
HttpServletResponse arg1, Object command, BindException arg3)
throws Exception {
this.setProperties(command);
BookingDTO booking = (BookingDTO) command;
Booking tempBooking = (Booking) bookingManager.get(booking.getId());
bookingManager.remove(tempBooking);
GregorianCalendar begindateCalendar = booking.getBeginDate();
GregorianCalendar finishdateCalendar = booking.getFinishDate();
if(!bookingManager.isVacant(booking.getRoom(), begindateCalendar, finishdateCalendar)){
tempBooking.setId(0);
bookingManager.add(tempBooking);
return new ModelAndView(getFailurePage(), "roomNumber", booking.getRoom().getNumber());
}else{
booking.setId(0);
Booking newBooking = createBookingFromBookingDTO(booking);
bookingManager.add(newBooking);
}
return new ModelAndView(getSuccessView());