• 大小: 59KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-22
  • 语言: C#
  • 标签: c#  飞机系统  

资源简介

包括了增三改操作,c#飞机订票的查询,增加,退订等相关的内容

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender EventArgs e)      //查询录入查询
        {
            listView1.Items.Clear();
            bool banduan = true;
            string chufa = textBox1.Text.Trim();
            string mudi = textBox2.Text.Trim();
            string qifei = maskedTextBox1.Text.Trim();
            string hangban = textBox3.Text.Trim();
            if (chufa.Length == 0 || mudi.Length == 0)
            {
                if (chufa.Length == 0) { label28.Visible = true; label28.Text = “不能为空!“; }
                if (mudi.Length == 0) { label29.Visible = true; label29.Text = “不能为空!“; }

            }
            else
            {
                string connstr = “Data Source=WWW-0F1C1E941A1;Initial Catalog=fly;Integrated Security=True“;
                SqlConnection conn = new SqlConnection(connstr);
                conn.Open();
                string sqlStr2 = “select * from Flight;“;
                SqlCommand cmd2 = new SqlCommand(sqlStr2 conn);
                SqlDataReader dr = cmd2.ExecuteReader();
                while (dr.Read())
                {
                    string c0 = dr[0].ToString(); string c1 = dr[1].ToString(); string c2 = dr[2].ToString(); string c3 = dr[3].ToString();
                    if (hangban == c0 && chufa == c1 && mudi == c2 && qifei == c3)
                    {
                        banduan = false;
                        ListViewItem obj;
                        obj = listView1.Items.Add(dr[0].ToString() 0);
                        obj.SubItems.Add(dr[1].ToString());
                        obj.SubItems.Add(dr[2].ToString());
                        obj.SubItems.Add(dr[3].ToString());
                        obj.SubItems.Add(dr[7].ToString());
                        obj.SubItems.Add(dr[5].ToString());
                        obj.SubItems.Add(dr[6].ToString());
                    }
                }
                dr.Close();
                SqlDataReader drdr = cmd2.ExecuteReader();
                if (banduan)
                {
                    while (drdr.Read())
                    {
                        string c1 = drdr[1].ToString(); string c2 = drdr[2].ToString();
                        if (chufa == c1 && mudi == c2) 
                        {
                            ListViewItem obj;
                            obj = listView1.Items.Add(drdr[0].ToString() 0);
                            obj.SubItems.Add(drdr[1].ToString());
                            obj.SubItems.Add(drdr[2].ToString());
                            obj.SubItems.Add(drdr[3].ToString());
 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      45056  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\bin\Debug\WindowsApplication4.exe

     文件      50688  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\bin\Debug\WindowsApplication4.pdb

     文件       5632  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4\bin\Debug\WindowsApplication4.vshost.exe

     文件      15673  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\Form1.cs

     文件      56185  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\Form1.Designer.cs

     文件       5814  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\Form1.resx

     文件        842  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\obj\Debug\WindowsApplication4.csproj.GenerateResource.Cache

     文件      45056  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\obj\Debug\WindowsApplication4.exe

     文件        180  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\obj\Debug\WindowsApplication4.Form1.resources

     文件      50688  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\obj\Debug\WindowsApplication4.pdb

     文件        180  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4\obj\Debug\WindowsApplication4.Properties.Resources.resources

     文件        352  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\obj\WindowsApplication4.csproj.FileList.txt

     文件        478  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4\Program.cs

     文件       1210  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4\Properties\AssemblyInfo.cs

     文件       2892  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4\Properties\Resources.Designer.cs

     文件       5612  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4\Properties\Resources.resx

     文件       1102  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4\Properties\Settings.Designer.cs

     文件        249  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4\Properties\Settings.settings

     文件       3245  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4\WindowsApplication4.csproj

     文件        946  2010-12-30 07:50  c#飞机订票系统sql\WindowsApplication4.sln

    ..A..H.     15872  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4.suo

     目录          0  2010-12-29 18:29  c#飞机订票系统sql\WindowsApplication4\obj\Debug\TempPE

     目录          0  2010-12-30 07:51  c#飞机订票系统sql\WindowsApplication4\bin\Debug

     目录          0  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4\obj\Debug

     目录          0  2010-12-29 18:29  c#飞机订票系统sql\WindowsApplication4\bin

     目录          0  2010-12-30 07:51  c#飞机订票系统sql\WindowsApplication4\obj

     目录          0  2010-12-30 07:51  c#飞机订票系统sql\WindowsApplication4\Properties

     目录          0  2010-12-30 11:11  c#飞机订票系统sql\WindowsApplication4

     目录          0  2010-12-30 07:51  c#飞机订票系统sql

----------- ---------  ---------- -----  ----

............此处省略2个文件信息

评论

共有 条评论