资源简介

后台数据库 设计公交安全管理系统,推荐使用SQL Server,其它DBMS亦可。 数据库的有关语义如下: 公交公司有若干个车队,每个车队下有若干条线路; 公交公司有若干辆汽车,每辆车属于一条线路; 每个车队有一名队长,他只有管理工作,不开车; 每条线路有若干名司机,其中有一名路队长,除开车外,还承担管理工作;每名司机只在一条线路上开车; 司机开车时会产生违章,包含:闯红灯、未礼让斑马线、压线、违章停车等; 队长、路队长负责将司机的违章信息输入到系统,包含:司机、车辆、车队、线路、站点、时间、违章等。 前台程序 开发一个公交安全管理系统来对数据库进行访问,可以使用C、Java等集成开发环境。 系统实现功能如下: 录入司机基本信息,如工号、姓名、性别等; 录入汽车基本信息,如车牌号、座数等; 录入司机的违章信息; 查询某个车队下的司机基本信息; 查询某名司机在某个时间段的违章详细信息; 查询某个车队在某个时间段的违章统计信息,如:2次闯红灯、4次未礼让斑马线等。 东西说的都很清楚,自己下载下来参考。

资源截图

代码片段和文件信息

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

namespace WindowsFormsApp2
{
    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
        }

        //验证登录
        private void button1_Click(object sender EventArgs e)
        {
            
            //采集数据
            string loginid = textloginid.Text.Trim();
            string loginpwd = textloginpwd.Text.Trim();
            string sf = comboBox1.SelectedItem.ToString();

            //验证登录
            string constr = “Data Source=LARRY6799;Initial Catalog=bus1;Integrated Security=True“;
            using (SqlConnection con = new SqlConnection(constr))
            {
                if (sf.Equals(“车队长“)|| sf.Equals(“路队长“))
                {
                    string sql;
                    if (sf.Equals(“车队长“)){
                         sql = string.Format(“select count(*) from cdz where cheduizhang = ‘{0}‘ and loginpwd = ‘{1}‘“ loginid loginpwd);
                    }
                    else{
                         sql = string.Format(“select count(*) from xlz where luduizhang = ‘{0}‘ and loginpwd = ‘{1}‘“ loginid loginpwd);
                    }
                    
                    using (SqlCommand cmd = new SqlCommand(sql con))
                    {
                        con.Open();
                        int count = (int)cmd.ExecuteScalar();
                        if (count > 0)
                        {
                            Form2 fmain = new Form2(this.textloginid.Text);
                            fmain.Show();
                            this.Dispose(false);
                        }
                        else
                        {
                            MessageBox.Show(“登录失败,请重新输入用户名和密码!“);
                        }
                    }
                }           

                else if (sf.Equals(“司机“))
                {
                    string sql = string.Format(“select count(*) from sj where siji = ‘{0}‘ and loginpwd = ‘{1}‘“ loginid loginpwd);
                    using (SqlCommand cmd = new SqlCommand(sql con))
                    {
                        con.Open();
                        int count = (int)cmd.ExecuteScalar();
                        if (count > 0)
                        {
                            Formsiji fsj = new Formsiji(this.textloginid.Text);
                            fsj.Show();
                            this.Dispose(false);
                        }
                        else
                        {
                            MessageBox.Show(“登录失败,请重新输入用户名和密码!“);
                        }

                    }
                }
                else
             

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-11-23 14:53  16030110032_张瑞\
     文件        1411  2018-11-23 14:52  16030110032_张瑞\view.txt
     目录           0  2018-11-23 14:05  16030110032_张瑞\前台程序C#\
     目录           0  2018-11-23 14:05  16030110032_张瑞\前台程序C#\WindowsFormsApp2\
     目录           0  2018-11-23 14:05  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\
     目录           0  2018-11-23 14:05  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\
     目录           0  2018-11-23 14:05  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\DesignTimeBuild\
     文件         200  2018-10-24 18:12  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\DesignTimeBuild\.dtbcache
     目录           0  2018-11-23 14:05  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\
     文件      173568  2018-11-14 21:08  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\.suo
     目录           0  2018-11-23 14:05  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\
     目录           0  2018-11-23 14:05  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\sqlite3\
     文件           0  2018-10-20 20:37  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\sqlite3\db.lock
     文件      786432  2018-11-04 22:20  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\sqlite3\storage.ide
     文件       32768  2018-11-14 20:47  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\sqlite3\storage.ide-shm
     文件     4136512  2018-11-05 23:53  16030110032_张瑞\前台程序C#\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\sqlite3\storage.ide-wal
     目录           0  2018-11-23 14:05  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\
     文件         189  2018-10-20 20:37  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\App.config
     文件        6403  2018-11-04 02:33  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form1.Designer.cs
     文件        3562  2018-11-04 10:04  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form1.cs
     文件        5817  2018-11-04 02:33  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form1.resx
     文件        8224  2018-10-24 16:55  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form2.Designer.cs
     文件        2240  2018-11-04 21:00  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form2.cs
     文件        5817  2018-10-24 16:55  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form2.resx
     文件        8632  2018-11-04 22:22  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form3.Designer.cs
     文件        4048  2018-11-04 22:23  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form3.cs
     文件        5817  2018-11-04 22:22  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form3.resx
     文件        7223  2018-11-04 14:09  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form4.Designer.cs
     文件        3297  2018-11-04 14:13  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form4.cs
     文件        5817  2018-11-04 14:09  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form4.resx
     文件        9130  2018-11-04 22:43  16030110032_张瑞\前台程序C#\WindowsFormsApp2\WindowsFormsApp2\Form5.Designer.cs
............此处省略344个文件信息

评论

共有 条评论