《软件分析与设计》 课程设计

航线信息模块:

1选择航线过程:

a分别在下拉选框中选择出发地和目的地;

例如图中所示 出发城市为北京;目的城市为上海 b分别选择出发日期和到达日期;

c点击查询 将数据库中符合条件的信息输出;

d对输出的航线进行核实,满意该航线点击确定,进入下一步乘客信息的录入;

选择出发地和目的地

选择出发日期和到达日期

重新选择

点击查询,信息输出

对输出的航线进行核实

选择该航线 进入乘客信息

代码如下:

using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;

using System.Windows.Forms; using System.Data.SqlClient;

namespace plant {

public partial class Form1 : Form {

public Form1() {

InitializeComponent(); }

private void button1_Click(object sender, EventArgs e) {

string conStr = \Source=GAO-PC\\\\SQL2005;Initial Catalog=plant;User ID=sa;Password=aa\;

SqlConnection conn = new SqlConnection(conStr); conn.Open();

string sql = \ * from 航?线? where 出?发ぁ?城?市篋='\ + gotext.Text + \ + \到?达?城?市篋='\ + reachtext.SelectedItem + \; SqlDataAdapter cmd = new SqlDataAdapter(sql, conn); DataSet ds = new System.Data.DataSet();

cmd.Fill(ds, \);

dataGridView1.DataSource = ds;

dataGridView1.DataMember = ds.Tables[\].ToString(); conn.Close(); }

private void button2_Click(object sender, EventArgs e)

{

Form2 frm = new Form2(); frm.Show(); } } }

2

a在跳转到的【请选择添加乘客方式】的页面选择乘客添加方式

可以选择

【常用乘客购票】方式 【新乘客注册】方式; 选择乘客添加方式 常用乘客购票 新乘客注册

代码如下:

using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;

using System.Windows.Forms; using System.Data.SqlClient;

namespace plant {

public partial class Form2 : Form {

public Form2() {

InitializeComponent(); }

private void button1_Click(object sender, EventArgs e) {

Form3 frm = new Form3(); frm.Show(); }

private void button2_Click(object sender, EventArgs e) {

Form4 frm = new Form4(); frm.Show(); } } }

【常用乘客购票】方式 选择该方式跳转到如下界面:

a输入身份证号在数据库进行查询;将数据库信息输出打印在下面的表格中;

联系客服:779662525#qq.com(#替换为@)