private void btnAddBookingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddBookingActionPerformed
        Court court = ((CourtContainer)lstCourts.getSelectedValue()).getCourt();
        
        
        int courtId = court.getId();
        
        String[] fromTime = ((String)cmbFrom.getSelectedItem()).split(":");
        String[] toTime =((String)cmbTo.getSelectedItem()).split(":");
        String[] date = txtDate.getText().split("-");
        if(date.length!=3)
        {
            JOptionPane.showMessageDialog(this,"Date input most be formatted dd-mm-yyyy", "Date Input Error", JOptionPane.ERROR_MESSAGE);
        }
        String[] memberNos = txtMemberNo.getText().split(",");
        
        ArrayList<Integer> members = new ArrayList();
        for(String s:memberNos)
        {
            members.add(new Integer(s));
        }
        GregorianCalendar from = (GregorianCalendar)GregorianCalendar.getInstance();
        GregorianCalendar to = (GregorianCalendar)GregorianCalendar.getInstance();
        
        from.set(Integer.parseInt(date[2]), Integer.parseInt(date[1]), Integer.parseInt(date[0]), Integer.parseInt(fromTime[0]), Integer.parseInt(fromTime[1]));
        to.set(Integer.parseInt(date[2]), Integer.parseInt(date[1]), Integer.parseInt(date[0]), Integer.parseInt(toTime[0]), Integer.parseInt(toTime[1]));
        
        Booking bookingObj = Booking.createNew(courtId,from,to,members);
        try 
        {
            int key = bM.addBooking(bookingObj);
            Booking bookingObj2 = Booking.createSimple(key, courtId, from, to, members);
            model5.addElement(new BookingContainer(bookingObj2));
        } 
        catch (SQLServerException ex) 
        {
            Logger.getLogger(BookingGui.class.getName()).log(Level.SEVERE, null, ex);
        }
        catch (SQLException ex) 
        {
            Logger.getLogger(BookingGui.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }//GEN-LAST:event_btnAddBookingActionPerformed