77范文网 - 专业文章范例文档资料分享平台

网上机票预订系统课程设计(3)

来源:网络收集 时间:2018-11-30 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

? 管理员界面的航线信息界面对航线信息的添加、修改、删除和查询,包括

航线编号、出发城市、到达城市、航班日期、出发时间、到达时间、客机编号、经济舱价格、公务舱价格、头等舱价格和备注信息等。

? 客户查询及预订界面

四、详细设计

4.1 窗体代码设计

(1) 订票代码

private void Pice() {

if (txtId.Text.Trim() == \) {

MessageBox.Show(\请填写航班号\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); txtId.Focus(); }

else if (txtPice.Text.Trim() == \) {

MessageBox.Show(\请填写您要预订的票数\, MessageBoxButtons.OK, MessageBoxIcon.Information); txtPice.Focus(); }

else if (cboType.Text.Trim() == \) {

MessageBox.Show(\请选择类型\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); cboType.Focus(); }

else if (txtFromTime.Text.Trim() == \) {

MessageBox.Show(\请填写日期\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); txtFromTime.Focus(); } else {

Priced(); } }

private void Priced() {

string message = \; int Num = 0;

int bookSeatNum = 0;

\提示\, int Pice = Convert.ToInt32(txtPice.Text); try {

string Dayth = txtFromTime.Text; string Type = cboType.Text;

string sql = string.Format(\OrderInfo where FlightNo='{0}' and LeaveDate='{1}' and SeatType = '{2}' \, txtId.Text, Dayth, Type);

SqlCommand command = new SqlCommand(sql, DBHepler.connection);

DBHepler.connection.Open();

if (!(command.ExecuteScalar() is DBNull)) {

bookSeatNum =

Convert.ToInt32(command.ExecuteScalar());

MessageBox.Show(bookSeatNum.ToString()); } }

catch (Exception ex) {

MessageBox.Show(ex.Message); }

finally {

DBHepler.connection.Close(); }

switch (cboType.Text) {

case \头等舱\:

Num = 8 - bookSeatNum;

//MessageBox.Show(Num.ToString()); break;

case \经济舱\:

Num = 160 - bookSeatNum;

//MessageBox.Show(Num.ToString()); break; }

if (Pice >= Num) {

message = string.Format(\剩余客票只有{0}请选择其他航班!\, Num);

MessageBox.Show(message, \温馨提示\,

MessageBoxButtons.OK, MessageBoxIcon.Information); } else {

Rearch(); } }

(2)实时更新预定信息

private void Rearch() {

int rs = 0;

DBHepler.connection.Open();

string sql = string.Format(\OrderInfo(FlightNo,LeaveDate,SeatType,Number) values

('{0}','{1}','{2}','{3}')\, txtId.Text, txtFromTime.Text, cboType.Text, txtPice.Text);

SqlCommand command = new SqlCommand(sql,DBHepler.connection);

rs = command.ExecuteNonQuery(); DBHepler.connection.Close(); if (rs == 1) {

MessageBox.Show(\预定成功\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); DBHepler.connection.Open();

string SQL = string.Format(\where OrderInfo.FlightNo='\+txtId.Text.ToString()+\LeaveDate='\+txtFromTime.Text.ToString()+\SeatType='\+cboType.Text.ToString()+\Number='\+txtPice.Text+\);

SqlCommand comm = new SqlCommand(SQL, DBHepler.connection);

SqlDataReader dataRead = comm.ExecuteReader(); if (dataRead.Read()) {

string s = \;

s = Convert.ToInt32(dataRead[\]).ToString(); MessageBox.Show(\符合你的打印ID号有:\ +Environment.NewLine+ s, \打印ID号\); }

dataRead.Close();

DBHepler.connection.Close();

} else {

MessageBox.Show(\预定失败\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); } } (3)删除航班

private void btndelete_Click(object sender, EventArgs e) {

if (ticketInfoDataGridView.CurrentCell.RowIndex < -1) {

return; } else {

ticketInfoDataGridView.Rows.RemoveAt(ticketInfoDataGridView.CurrentCell.RowIndex);

ticketInfoTableAdapter.Update(ticketDataSet); MessageBox.Show(\删除成功!\操作提示\ } }

4.2 数据库设计 4.2.1 系统登陆设计

4.2.2 航班信息设计

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库网上机票预订系统课程设计(3)在线全文阅读。

网上机票预订系统课程设计(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/324252.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: