资源简介

QT实现车辆管理系统,数据库使用SQLServer,该车辆管理系统包含管理员登录界面和普通用户登录界面, 可以捷星添加、删除、修改、查询。具有好看的界面。 查询采用傻瓜式查询,像查单词一样输入一个数就可以进行自动查询。

资源截图

代码片段和文件信息

#include “add_driver.h“
#include “ui_add_driver.h“
#include“select_truck.h“
#include//表格信息显示
#include
#include 
#include 
Add_Driver::Add_Driver(QWidget *parent) :
    QDialog(parent)
    ui(new Ui::Add_Driver)
{
    ui->setupUi(this);
    connect(this->ui->btn_okSIGNAL(clicked(bool))thisSLOT(Add_Driver_Message()));
    connect(this->ui->btn_noSIGNAL(clicked(bool))thisSLOT(close()));
}
Add_Driver::~Add_Driver()
{
    delete ui;
}


//向数据库中插入司机信息
void Add_Driver::Add_Driver_Message()
{
    int ret =QMessageBox::information(this“添加信息““确认是否添加司机“QMessageBox::Ok|QMessageBox::Cancel );
    if(ret==QMessageBox::Ok)
    {
    QString name=this->ui->line_Name->text();
    QString gender=this->ui->btn_Group_Gender->checkedButton()->text();
    double km=this->ui->line_Km->text().toDouble();
    double fee_Km=this->ui->line_Fee_Km->text().toDouble();
    double salary=km*fee_Km+5000;
    Receive_Message(idnotype);
    QString insert_Driver_Message=QString(“insert into Driver (d_Idd_Nod_Typed_Named_Genderd_Kmd_Fee_Kmd_Salary) “
                                          “values(‘%1‘‘%2‘‘%3‘‘%4‘‘%5‘%6%7%8)“).arg(id).arg(no).arg(type).arg(name)
            .arg(gender).arg(km).arg(fee_Km).arg(salary);
    QSqlQuery query;
    if(query.exec(insert_Driver_Message))
    {
        QMessageBox::information(this“提示““添加成功“QMessageBox::Ok);
        this->close();
    }
    else
    {
        QMessageBox::critical(this“提示““添加失败“QMessageBox::Ok|QMessageBox::Cancel );
    }
   // qDebug()<    }
    else {
        return;
    }
}

//接受信息
void Add_Driver::Receive_Message(QString idQString noQString type)
{
    this->id=id;
    this->no=no;
    this->type=type;
  //  qDebug()<}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-07-08 11:14  New_Vehicle_Management\
     文件        2049  2019-07-06 13:18  New_Vehicle_Management\New_Vehicle_Management.pro
     文件       24800  2019-07-08 11:14  New_Vehicle_Management\New_Vehicle_Management.pro.user
     目录           0  2019-07-03 17:52  New_Vehicle_Management\Picture\
     文件      357899  2019-05-30 09:38  New_Vehicle_Management\Picture\1.jpg
     文件      346675  2018-11-04 21:14  New_Vehicle_Management\Picture\2.jpg
     文件      418201  2019-05-30 09:38  New_Vehicle_Management\Picture\3.jpg
     文件      156965  2019-03-09 09:49  New_Vehicle_Management\Picture\4.jpg
     文件       76747  2019-07-06 08:04  New_Vehicle_Management\add_Vehicle.ui
     文件        2011  2019-07-06 12:53  New_Vehicle_Management\add_driver.cpp
     文件         471  2019-07-06 10:21  New_Vehicle_Management\add_driver.h
     文件       22783  2019-07-06 09:55  New_Vehicle_Management\add_driver.ui
     文件       19011  2019-07-08 11:06  New_Vehicle_Management\add_truck.cpp
     文件        3040  2019-07-04 15:36  New_Vehicle_Management\add_truck.h
     文件       52952  2019-07-04 14:33  New_Vehicle_Management\add_truck.ui.autosave
     文件        1431  2019-07-03 18:51  New_Vehicle_Management\apply_account.cpp
     文件         396  2019-07-03 18:39  New_Vehicle_Management\apply_account.h
     文件       19772  2019-07-06 11:39  New_Vehicle_Management\apply_account.ui
     文件        2466  2019-07-08 11:07  New_Vehicle_Management\login_management.cpp
     文件         605  2019-07-06 13:37  New_Vehicle_Management\login_management.h
     文件       10976  2019-07-03 18:41  New_Vehicle_Management\login_management.ui
     文件         255  2019-07-06 13:40  New_Vehicle_Management\main.cpp
     文件        1809  2019-07-06 12:44  New_Vehicle_Management\mainwindow.cpp
     文件         716  2019-07-06 12:44  New_Vehicle_Management\mainwindow.h
     文件       34131  2019-07-06 12:25  New_Vehicle_Management\mainwindow.ui
     文件         431  2019-07-06 13:25  New_Vehicle_Management\mainwindow_2.cpp
     文件         628  2019-07-06 13:40  New_Vehicle_Management\mainwindow_2.h
     文件       16761  2019-07-06 13:25  New_Vehicle_Management\mainwindow_2.ui
     文件         205  2019-07-03 17:55  New_Vehicle_Management\resources.qrc
     文件       16560  2019-07-05 23:23  New_Vehicle_Management\select_bus.cpp
     文件        1514  2019-07-05 23:23  New_Vehicle_Management\select_bus.h
............此处省略14个文件信息

评论

共有 条评论