19
資資資資資資資 - 資資資資資資 資資資 SQL 494512102- 資資資 494512059- 資資資 494512217- 資資資 2008/1/7 1 Presented By SQL Team.

高鐵訂票系統報告

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: 高鐵訂票系統報告

資料庫期末專題 - 高鐵訂票系統

第八組 SQL494512102- 張逸豪494512059- 孫于婷494512217- 吳則漢

2008/1/7 1 Presented By SQL Team.

Page 2: 高鐵訂票系統報告

架設環境 WindowsXP IIS SQLserver2005 Visual Studio 2005 ASP.NET JAVA JDBC

2008/1/7 2 Presented By SQL Team.

Page 3: 高鐵訂票系統報告

Schema

2008/1/7 3 Presented By SQL Team.

Page 4: 高鐵訂票系統報告

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.

Page 5: 高鐵訂票系統報告

系統流程圖

2008/1/7 5 Presented By SQL Team.

Page 6: 高鐵訂票系統報告

功能列表

前端程式訂票退票查看乘車率看時刻表查詢買票記錄查看退票紀錄

後端程式訂票刪票

訂票資料輸出查詢買票記錄文字檔資料匯入查看當天班次乘車人數

取消的座位均可再定2008/1/7 6 Presented By SQL Team.

Page 7: 高鐵訂票系統報告

前端程式

2008/1/7 7 Presented By SQL Team.

Page 8: 高鐵訂票系統報告

搭乘班次

2008/1/7 8 Presented By SQL Team.

Page 9: 高鐵訂票系統報告

插入新資料

2008/1/7 9 Presented By SQL Team.

Page 10: 高鐵訂票系統報告

刪除全部

2008/1/7 10 Presented By SQL Team.

Page 11: 高鐵訂票系統報告

刪除部分

2008/1/7 11 Presented By SQL Team.

Page 12: 高鐵訂票系統報告

後端程式

2008/1/7 12 Presented By SQL Team.

Page 13: 高鐵訂票系統報告

找空位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.

Page 14: 高鐵訂票系統報告

取得座位 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.

Page 15: 高鐵訂票系統報告

查詢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.

Page 16: 高鐵訂票系統報告

取消訂票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.

Page 17: 高鐵訂票系統報告

Happy DEMO Time just for

us

2008/1/7 17 Presented By SQL Team.

Page 18: 高鐵訂票系統報告

未來展望 網頁美化 加入更多人性化的功能 管理者介面加入 Thread 管理

2008 SQL Team

2008/1/7 18 Presented By SQL Team.

Page 19: 高鐵訂票系統報告

踹踹看 http://kareneen.myftp.org/

index.aspx

2008/1/7 19 Presented By SQL Team.