Upload
frank-chang
View
4.383
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
資料庫期末專題 - 高鐵訂票系統
第八組 SQL494512102- 張逸豪494512059- 孫于婷494512217- 吳則漢
2008/1/7 1 Presented By SQL Team.
架設環境 WindowsXP IIS SQLserver2005 Visual Studio 2005 ASP.NET JAVA JDBC
2008/1/7 2 Presented By SQL Team.
Schema
2008/1/7 3 Presented By SQL Team.
E-R modle
customer train
seat_info
state_table
cus_name
`
`̀ cus_SSIDcus_email
cus_time
reservation_No
tickets
train_No
dep_timetrain_dest
train_dep
carriage_No
train_No
seat_No
reservation_No
city_No
city_name
booking
cus_date
seat_date
seat_dep seat_dest
mapping
cancel_seat
carriage_No
train_No
seat_No
seat_date
seat_dep seat_dest
cus_name
mapping
2008/1/7 4 Presented By SQL Team.
系統流程圖
2008/1/7 5 Presented By SQL Team.
功能列表
前端程式訂票退票查看乘車率看時刻表查詢買票記錄查看退票紀錄
後端程式訂票刪票
訂票資料輸出查詢買票記錄文字檔資料匯入查看當天班次乘車人數
取消的座位均可再定2008/1/7 6 Presented By SQL Team.
前端程式
2008/1/7 7 Presented By SQL Team.
搭乘班次
2008/1/7 8 Presented By SQL Team.
插入新資料
2008/1/7 9 Presented By SQL Team.
刪除全部
2008/1/7 10 Presented By SQL Team.
刪除部分
2008/1/7 11 Presented By SQL Team.
後端程式
2008/1/7 12 Presented By SQL Team.
找空位trainSet = train.executeQuery(“SELECT * FROM train WHERE train_No = ”+ Integer.parseInt(tr_no1.getText()) + “ AND [” + d + “] = ” + t1+ “ AND [” + s + “] = ” + t2 + “ ”);
新增資料executeUpdate("INSERT INTO seat_info (reservation_No,train_No,carriage_No,seat_No,seat_date,seat_dep,seat_dest) VALUES (“+ number+ ",”+ Integer.parseInt(tr_no1.getText()) + ",”+ carriage+ ",”+ sno+ ",‘”+ date1.getText() + "'," + d + "," + s + ")");
2008/1/7 13 Presented By SQL Team.
取得座位 st1 = s1.executeQuery(“SELECT top 1
carriage_No,seat_No FROM seat_info WHERE train_No = ” + train+ “ AND seat_date = ‘” + date + “’ AND seat_dep < ”+des+“ AND seat_dest > ”+dep+“ ORDER BY carriage_No desc,seat_No desc”);// 南下
st2 = s2.executeQuery("SELECT top 1 carriage_No,seat_No FROM cancel_seat WHERE train_No = " + train+ " AND seat_date = '" + date + "'AND seat_dep < "+des+" AND seat_dest > "+dep+" ORDER BY carriage_No asc,seat_No asc");// 南下
2008/1/7 14 Presented By SQL Team.
查詢rt = destmt2.executeQuery("SELECT *
FROM seat_info WHERE reservation_No in (SELECT reservation_No FROM customer WHERE reservation_No = "+Integer.parseInt(reno1.getText()) + " AND cus_SSID = '"+ ssid1.getText() + "') ORDER BY carriage_No asc,seat_No asc");
2008/1/7 15 Presented By SQL Team.
取消訂票rs1 = destmt1.executeQuery("SELECT top 1 * from
seat_info seat_info where reservation_No = "+ Integer.parseInt(reno1.getText()) + " ORDER BY carriage_No desc,seat_No desc");
insert.executeUpdate("INSERT INTO cancel_seat (cus_name,train_No,carriage_No,seat_No,seat_date,seat_dep,seat_dest) VALUES ("+rs1.getString(1)+",” + rs1.getInt(2) + ",”+ rs1.getInt(3) + ",”+ rs1.getInt(4) + ",‘”+ rs1.getString(5) + "'," + rs1.getInt(6) + " ," + rs1.getInt(7) + ")");
刪掉原本座位省略
2008/1/7 16 Presented By SQL Team.
Happy DEMO Time just for
us
2008/1/7 17 Presented By SQL Team.
未來展望 網頁美化 加入更多人性化的功能 管理者介面加入 Thread 管理
2008 SQL Team
2008/1/7 18 Presented By SQL Team.
踹踹看 http://kareneen.myftp.org/
index.aspx
2008/1/7 19 Presented By SQL Team.