当前位置: 首页 > news >正文

税务局网站公司实名制怎么做个人推广平台

税务局网站公司实名制怎么做,个人推广平台,西宁整站优化,网站建站专家配置类相关的表,所以我使用sqlite,且QT自带该组件; 1.安装 sqlite-tools-win-x64-3460000、SQLiteExpert5.4.31.575 使用SQLiteExpert建好数据库.db文件,和对应的表后把db文件放在指定目录 ./db/program.db; 2.选择sql组件 3.新…

配置类相关的表,所以我使用sqlite,且QT自带该组件;

1.安装 sqlite-tools-win-x64-3460000、SQLiteExpert5.4.31.575
使用SQLiteExpert建好数据库.db文件,和对应的表后把db文件放在指定目录 ./db/program.db;

2.选择sql组件

在这里插入图片描述
3.新增数据库处理类,在使用数据库的地方调用类成员函数即可

DataModel::DataModel()
{db = QSqlDatabase::addDatabase("QSQLITE", "");db.setDatabaseName("./db/program.db");connectDataBase();
}DataModel::~DataModel()
{disconnectDataBase();
}// 打开数据库文件
bool DataModel::connectDataBase() {bool ret = db.open();if (!ret) {outPutMsg(QtDebugMsg, "DataModel::connectDataBase error = " + db.lastError().text());} return ret;
}
// 关闭数据库文件
void DataModel::disconnectDataBase() {db.close();
}
QStringList DataModel::queryProgramList() {QStringList programList;// 根据名字查询QString sql = QString("select sectionBarName,programNo from program where 1=1;");outPutMsg(QtDebugMsg, "DataModel::queryProgramList sql = " + sql);// 创建一个可以对db执行语句的对象QSqlQuery query(db);// 执行sql语句bool ret = query.exec(sql);if (!ret){outPutMsg(QtDebugMsg, "DataModel::queryProgramNo error = " + query.lastError().text());return programList;}// 行坐标向下移while (query.next()){//获取数据库query所指的那行的数据QString program;program += (query.value(0).toString() + ";"); // sectionBarNameprogram += QString::number(query.value(1).toInt()); // programNo// outPutMsg(QtDebugMsg, "DataModel::queryProgramInfoBySectionCode programInfo = " + program);programList.append(program);}return programList;
}
// 根据型材代号查询程序号码
QString DataModel::queryProgramNo(QString sectionBarNo) {// 根据名字查询QString sql = QString("select programNo from program where sectionBarName=\'%1\';").arg(sectionBarNo);//QString sql = QString("select programNo from program where 1=1");outPutMsg(QtDebugMsg, "DataModel::queryProgramNo sql = " + sql);// 创建一个可以对db执行语句的对象QSqlQuery query(db);// 执行sql语句bool ret = query.exec(sql);if (!ret){outPutMsg(QtDebugMsg, "DataModel::queryProgramNo error = " + query.lastError().text());return "";}QString programNo = "";// 行坐标向下移while (query.next()){//获取数据库query所指的那行的数据programNo = QString::number(query.value(0).toInt());outPutMsg(QtDebugMsg, "DataModel::queryProgramNo programNo = " + programNo);}return programNo;
}// 根据程序号码查询
QString DataModel::queryProgramByNo(QString programNo) {// 根据名字查询QString sql = QString("select sectionBarName from program where programNo=\'%1\';").arg(programNo);//QString sql = QString("select programNo from program where 1=1");outPutMsg(QtDebugMsg, "DataModel::queryProgramByNo sql = " + sql);// 创建一个可以对db执行语句的对象QSqlQuery query(db);// 执行sql语句bool ret = query.exec(sql);if (!ret){outPutMsg(QtDebugMsg, "DataModel::queryProgramByNo error = " + query.lastError().text());return "";}QString sectionBarNo = "";// 行坐标向下移while (query.next()){//获取数据库query所指的那行的数据sectionBarNo = QString::number(query.value(0).toInt());outPutMsg(QtDebugMsg, "DataModel::queryProgramByNo sectionBarNo = " + sectionBarNo);}return sectionBarNo;
}// 根据型材代号查询程序号码
QStringList DataModel::queryProgramInfoBySectionCode(QString sectionBarNo) {QStringList programInfoList;// 根据名字查询// 使用索引sectionBarNameQString sql = QString("select stepNo, cutNo,x, y, f, Rx, Ry from programInfo where programNo = (select programNo from program where sectionBarName=\'%1\');").arg(sectionBarNo);//QString sql = QString("select programNo from program where 1=1");outPutMsg(QtDebugMsg, "DataModel::queryProgramInfoBySectionCode sql = " + sql);// 创建一个可以对db执行语句的对象QSqlQuery query(db);// 执行sql语句bool ret = query.exec(sql);if (!ret){outPutMsg(QtDebugMsg, "DataModel::queryProgramInfoBySectionCode error = " + query.lastError().text());return programInfoList;}// 行坐标向下移while (query.next()){//获取数据库query所指的那行的数据QString programInfo;programInfo += (QString::number(query.value(0).toInt())+";"); // stepNoprogramInfo += (QString::number(query.value(1).toInt())+";"); // cutNoprogramInfo += (QString::number(query.value(2).toDouble(), 'f', 2) + ";"); // xprogramInfo += (QString::number(query.value(3).toDouble(), 'f', 2) + ";"); // yprogramInfo += (QString::number(query.value(4).toDouble(), 'f', 2) + ";"); // f 速度programInfo += (QString::number(query.value(5).toDouble(), 'f', 2) + ";"); // RxprogramInfo += (QString::number(query.value(6).toDouble(), 'f', 2)); // RyoutPutMsg(QtDebugMsg, "DataModel::queryProgramInfoBySectionCode programInfo = " + programInfo);programInfoList.append(programInfo);}return programInfoList;
}// 更新程序信息
bool DataModel::updateProInfosByProNo(QString proNo, QStringList proInfoList) {// 开启事务if (!db.transaction()) {outPutMsg(QtDebugMsg, "DataModel::updateProInfosByProNo db.error = " + db.lastError().text());return false;}QStringList programInfoList;// 根据名字查询// 使用索引sectionBarNameQString sqlDel = QString("delete from programInfo where programNo=\'%1\';").arg(proNo);outPutMsg(QtDebugMsg, "DataModel::updateProInfosByProNo sqlDel = " + sqlDel);// 创建一个可以对db执行语句的对象QSqlQuery query(db);// 执行sql语句bool ret = query.exec(sqlDel);if (!ret){outPutMsg(QtDebugMsg, "DataModel::updateProInfosByProNo error = " + query.lastError().text());return false;}try {for (int i = 0; i < proInfoList.size(); i++) {QStringList programInfo = proInfoList.at(i).split(";");QString sqlOne = "insert into programInfo values ( " + proNo + ",";for (int j = 0; j < programInfo.size(); j++) {if (j > 0) {sqlOne += ",";}sqlOne += programInfo.at(j) ;}sqlOne += ");";outPutMsg(QtDebugMsg, "DataModel::updateProInfosByProNo sqlOne = " + sqlOne);if (!query.exec(sqlOne)){outPutMsg(QtDebugMsg, "DataModel::updateProInfosByProNo error = " + query.lastError().text());return false;}}}catch (...) {outPutMsg(QtDebugMsg, "DataModel::updateProInfosByProNo error = " + query.lastError().text());return false;}// 开启事务if (!db.commit()) {outPutMsg(QtDebugMsg, "DataModel::updateProInfosByProNo db.error = " + db.lastError().text());return false;}return true;
}
// 保存程序信息
void ClearCorner::on_edit_saveBtn_clicked() {QStringList proInfoList;for (int i = 0; i < modelProgram.rowCount(); i++) {QString strTmp;for (int j = 0; j < modelProgram.columnCount(); j++) {QStandardItem* item = modelProgram.item(i, j);if (j > 0) {strTmp += ";";}strTmp += item->text();}outPutMsg(QtDebugMsg, "ClearCorner::on_edit_saveBtn_clicked strTmp = " + strTmp);proInfoList.append(strTmp);}DataModel dataModel;bool ret = dataModel.updateProInfosByProNo(ui.edit_lineEdit_programNo->text(), proInfoList);if (ret) {QMessageBox::information(nullptr, "提示", "更新程序成功!");}else {QMessageBox::warning(nullptr, "提示", "更新程序失败!");}
}
http://www.wooajung.com/news/27858.html

相关文章:

  • 生鲜网站建设规划书范文创网站永久免费建站
  • 怎样做网站轮播如何让百度收录自己的网站信息
  • 网站如何做邮箱订阅杭州seo推广公司
  • 网站做多大的宽高广州网络营销公司
  • 深圳网站建设推广网站推广的一般流程是
  • 网站云优化网址怎么申请注册
  • 义乌网站建设工作室seo排名首页
  • 花卉网站建设策划抖音推广引流平台
  • 网站建设网银开通百度推广客户端手机版下载
  • 赤峰北京网站建设免费网络推广软件有哪些
  • 做网站的人 优帮云百度客服中心人工电话
  • 做网站后端要什么技术微信管理助手
  • 南宁网站建设mxfsem做百度推广需要什么条件
  • 有什么知名网站是用织梦做的星链seo管理
  • 公安部网站备案系统建站优化
  • 摄影网站建立seo的推广技巧
  • 门户网站建设模式包括网站群和百度电话怎么转人工
  • 自己可以学着做网站吗桂林网页
  • 网站的赚钱方式搜狗推广登陆
  • 小公司网站开发营销策略理论
  • 微信服务商平台官网惠州百度seo排名
  • 网站建设职业发展前景市场调研一般怎么做
  • 网站页面设计代码服务网站推广方案
  • 做企业网站的优势公关团队
  • 网站相对路径 .域名服务器ip查询网站
  • 哪个网站diy做宝宝衣服百度账号安全中心
  • 外贸平台网站有哪些微信群推广网站
  • 网站建设 模板中心seo网站推广主要目的不包括
  • 网站建设的素材百度关键词推广怎么做
  • 网站开发建设百度seo关键词排名查询