📄 booking.java
字号:
package com.nearhills;
import java.sql.*;
public class Booking {
int memberId;
int tripId;
public Booking() {
this( 0, 0 );
}
public Booking( int memberId, int tripId ) {
setMemberId( memberId );
setTripId( tripId );
}
void setMemberId( int memberId ) {
this.memberId = memberId;
}
int getMemberId( ) {
return memberId;
}
void setTripId( int tripId ) {
this.tripId = tripId;
}
int getTripId( ) {
return tripId;
}
void drop( )
throws DBopException, SQLException, BookingException
{
SkiTrip trip = SkiTrip.getTrip( getTripId() );
trip.dropBooking();
SkiClubDB.dropBooking( this );
SkiClubDB.updateTrip( trip );
}
void add( )
throws DBopException, SQLException, BookingException
{
SkiTrip trip = SkiTrip.getTrip( getTripId() );
trip.addBooking();
SkiClubDB.addBooking( this );
SkiClubDB.updateTrip( trip );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -