1、退票时必须输入订票时随机生成的订单号,与航班号。退票成功后,航班自动将余票量加一操作。(6)本系统还添加了管理员界面。当管理员进入后,可对用户的信息进行查看,但不能修改,也可将用户加入黑名单,如果用户有订单,则不允许管理员做加入黑名单操作。当然加入黑名单时,管理员需要说明理由,作为存档。管理员,也可根据实际情况对航班进行管理操作。增删改查。他也可以对公告进行修改操作。(7)系统也实现了,对于不同的角色进入,会产生不同的界面效果。保证了数据的安全性,和保密性。数据库设计 (1)管理员表 (2) 航班表 (3)黑名单表 (4)订单信息表(5)用户信息表四 运行截图五 源代码using System
2、;using System.Collections.Generic;using System.Linq;using System.Windows.Forms;namespace 航空订票管理系统 static class Program / / 应用程序的主入口点。/summary STAThread static void Main() string dataDir = AppDomain.CurrentDomain.BaseDirectory; if (dataDir.EndsWith(binDebug) | dataDir.EndsWith(binRelease) dataDir = S
3、ystem.IO.Directory.GetParent(dataDir).Parent.Parent.FullName; AppDomain.CurrentDomain.SetData(DataDirectory, dataDir); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1();using System.ComponentModel;using System.Data;using System.Drawin
4、g;using System.Text;using System.Data.SqlClient; public partial class Form1 : Form zhuce zc = new zhuce(); Userlaunch lch=new Userlaunch(); public string status1 get; set; int label1x; public Form1() InitializeComponent(); private void Form1_Load(object sender, EventArgs e) label1x = label1.Right; t
5、imer1.Enabled = true; timer2.Enabled = true; timer3.Enabled = true; timer2.Start(); novisible2(); novisible1(); textBox1.Focus(); timer1.Start(); /隐藏管理员可做的操作 public void novisible1() 客户信息ToolStripMenuItem.Visible = false; 航班信息ToolStripMenuItem.Visible = false; 修改公告ToolStripMenuItem.Visible = false;
6、/隐藏用户可做的操作 public void novisible2() 用户补全资料ToolStripMenuItem.Visible = false; /个人中心 用户充值ToolStripMenuItem.Visible = false; /办理业务 /隐藏登陆前界面 public void novisible3() 用户登录ToolStripMenuItem.Visible = false; 浏览信息ToolStripMenuItem.Visible = false; 管理员登陆ToolStripMenuItem.Visible = false; /控制公告字段 private void
7、 timer1_Tick(object sender, EventArgs e) label1.Location = new Point(label1.Location.X-1,label1.Location.Y); if (label1.Right = 0) label1.Left = label1x; /当点到按钮时,进行图片变换 private void button1_MouseEnter(object sender, EventArgs e) Button bttn; timer2.Enabled = false; bttn = (Button)sender; if (bttn =
8、button1) picture1(); else if (bttn = button2) picture2(); else if (bttn = button3) picture3(); else if (bttn = button4) picture4(); else if (bttn = button5) picture5(); private void radioButton1_CheckedChanged(object sender, EventArgs e) textBox5.Enabled = false; textBox1.Enabled = true; textBox2.En
9、abled = true; textBox5.Text = ; private void radioButton2_CheckedChanged(object sender, EventArgs e) textBox5.Enabled = true; textBox1.Text = textBox2.Text = textBox1.Enabled = false; textBox2.Enabled = false; private void radioButton4_CheckedChanged(object sender, EventArgs e) textBox6.Enabled = fa
10、lse; textBox3.Enabled = true; textBox4.Enabled = true; textBox6.Text = textBox4.Focus(); private void radioButton3_CheckedChanged(object sender, EventArgs e) textBox6.Enabled = true; textBox4.Text = textBox3.Text = textBox3.Enabled = false; textBox4.Enabled = false; textBox6.Focus(); /安全退出 private v
11、oid 用户退出ToolStripMenuItem_Click(object sender, EventArgs e) if (toolStripStatusLabel4.Text = 未登录 MessageBox.Show(当前你未登录,请登录或注册); else MessageBox.Show(toolStripStatusLabel4.Text+您已下线,谢谢使用! toolStripStatusLabel4.Text = status1 = 用户登录ToolStripMenuItem.Visible = true; 浏览信息ToolStripMenuItem.Visible = tru
12、e; 管理员登陆ToolStripMenuItem.Visible = true; /注册界面 private void 浏览信息ToolStripMenuItem_Click(object sender, EventArgs e) zc.ShowDialog(); /图片变换 private void timer2_Tick(object sender, EventArgs e) Random rd = new Random(); int r = rd.Next(1,6); switch (r) case 1: picture1(); break; case 2: picture2(); c
13、ase 3: picture3(); case 4: picture4(); case 5: picture5(); /图片显示方法 private void picture1() pictureBox1.Show(); pictureBox2.Hide(); pictureBox3.Hide(); pictureBox4.Hide(); pictureBox5.Hide(); private void picture2() pictureBox2.Show(); pictureBox1.Hide(); private void picture3() pictureBox3.Show(); p
14、rivate void picture4() pictureBox4.Show(); private void picture5() pictureBox5.Show(); /当不用手动控制图片时,执行 private void button1_MouseLeave(object sender, EventArgs e) /用户登陆 private void 用户登录ToolStripMenuItem_Click(object sender, EventArgs e) Userlaunch uch = new Userlaunch(); if (uch.ShowDialog() = Dialo
15、gResult.OK) status1 = uch.UserName;尊敬的用户+status1+你好! 用户补全资料ToolStripMenuItem.Visible = true; 用户充值ToolStripMenuItem.Visible = true; novisible3(); uch.Dispose(); /管理员登陆 private void 管理员登陆ToolStripMenuItem_Click(object sender, EventArgs e) Admain adn = new Admain(); if (adn.ShowDialog() = DialogResult.
16、OK) toolStripStatusLabel4.Text = adn.AdmainName; 客户信息ToolStripMenuItem.Visible = true; 航班信息ToolStripMenuItem.Visible = true; 修改公告ToolStripMenuItem.Visible = true; /机票预订 private void button6_Click(object sender, EventArgs e)请先登录 textBox1.Text = textBox2.Text = textBox5.Text = else if (toolStripStatus
17、Label4.Text.Substring(0, 3) = 亲爱的对不起,管理员,您不能订票的! if (textBox1.Text != & textBox2.Text ! | textBox5.Text ! int n = 1; jipiaoyuding jyd = new jipiaoyuding(textBox1.Text, textBox2.Text, textBox5.Text, n, status1); jyd.ShowDialog();对不起,你输入的信息不符合查询条件,请重新输入 /系统时间 private void timer3_Tick(object sender, Ev
18、entArgs e) this.toolStripStatusLabel3.Text = 当前系统时间: + DateTime.Now.ToString(yyyy-MM-dd hh:mm:ss /查询航班动态 private void button7_Click(object sender, EventArgs e) if (textBox4.Text ! textBox3.Text ! | textBox6.Text ! int n = 2; jipiaoyuding jyd = new jipiaoyuding(textBox4.Text, textBox3.Text, textBox6.
19、Text,n,status1); textBox4.Text = textBox3.Text = textBox6.Text = else private void 订票信息ToolStripMenuItem_Click(object sender, EventArgs e) 订票信息 dp = new 订票信息(); dp.ShowDialog(); private void 用户资料ToolStripMenuItem_Click(object sender, EventArgs e) 用户资料 yz = new 用户资料(); yz.ShowDialog(); private void 订
20、票ToolStripMenuItem_Click(object sender, EventArgs e) jipiaoyuding jyd = new jipiaoyuding(, , 1, status1); private void 查询订单ToolStripMenuItem_Click(object sender, EventArgs e) 个人订单 gd = new 个人订单(status1); gd.ShowDialog(); private void 黑名单资料ToolStripMenuItem_Click(object sender, EventArgs e) 黑名单表 hm =
21、 new 黑名单表(); hm.ShowDialog(); private void 航班信息ToolStripMenuItem_Click(object sender, EventArgs e) 航班信息 hbx = new 航班信息(); hbx.ShowDialog(); private void 修改公告ToolStripMenuItem_Click(object sender, EventArgs e) 修改公告 xg=new 修改公告 (); if (xg.ShowDialog() = DialogResult.OK) label1.Text = xg.gonggao; priva
22、te void 查看自己资料ToolStripMenuItem_Click(object sender, EventArgs e) 个人资料 gz = new 个人资料(status1,1); gz.ShowDialog(); private void 修改个人资料ToolStripMenuItem_Click(object sender, EventArgs e) 个人资料 gz1 = new 个人资料(status1,2); gz1.ShowDialog(); private void 我想退票ToolStripMenuItem_Click(object sender, EventArgs
23、 e) 退票系统 tp = new 退票系统(status1); if (tp.ShowDialog() = DialogResult.OK)退票成功 private void button8_Click(object sender, EventArgs e) if (toolStripStatusLabel4.Text=你还未登陆,请先登录! textBox7.Text = textBox8.Text = textBox9.Text = else if (toolStripStatusLabel4.Text.Substring(0,3)=管理员,您是无权退票的啊! tp.tuibiao(textBox7.Text, textBox8.Text, textBox9.Text); if (tp.Dial
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1