⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bookingsystem.java

📁 java开发
💻 JAVA
字号:
package newBookingSystem;

import java.util.Date;
import java.util.*;
import java.util.Observable;
import java.util.Vector;
import java.lang.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class BookingSystem extends Observable {
    private Date date;

    final static int NotSelected = 0;
    final static int Selected = 1;
    private static BookingSystem uniquelnstance;
    private Vector tableInformation;

    Restaurant restaurant;
    Booking booking;

    public BookingSystem() {
		restaurant = new Restaurant();
    }

    public static BookingSystem getlnstance() {
        if (uniquelnstance == null) {
            uniquelnstance = new BookingSystem();
        }
        return uniquelnstance;
    }

   /* public void addBooking(Booking b) {
        current.addElement(b);
    }
   */

    public void cancel(Date d, int tno) {
        java.sql.Date date = new java.sql.Date(d.getTime());
        restaurant.cancelReservation(date,tno);
        this.setChanged();
        this.notifyObservers();

    }


    public void Display(Date d) {
        restaurant.Display(d);
        this.setChanged();
        this.notifyObservers();
    }



    public Date getDate() {
        //return
        return date;

    }

    public void makeReservation(Date d, int tno, String name, String phone) {
		restaurant.makeReservation(d, tno, name, phone);
		this.setChanged();
        this.notifyObservers();
    }

    public void makeWalkln(int c, Date d, int tno) {
        restaurant.makeWalkIn(c, d, tno);
        this.setChanged();
        this.notifyObservers();
    }

    public void recordArrival(Date d,int tno) {
        restaurant.recordArrival(d,tno);
        this.setChanged();
        this.notifyObservers();
    }

    public void setDate(Date d) {
        date = d;
    }

    public void Transfer(Date d, int OriginTable, int destTable) {
		//OriginTable:原餐桌,destTable:目的餐桌
        restaurant.transfer(d, OriginTable, destTable);
        this.setChanged();
        this.notifyObservers();
    }

    public Vector getTableState()
    {
		tableInformation = restaurant.getState();
		return tableInformation;
	}


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -