按照客户要求将excel导出文件保存为一个条码一条记录,名称为SN_结果_时间.xslx

This commit is contained in:
LL
2025-11-14 17:27:29 +08:00
commit 883060d140
79 changed files with 166110 additions and 0 deletions

80
SLZ_4/ConfigStorage.cs Normal file
View File

@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SLZ_4
{
public partial class ConfigStorage : Form
{
STORAGE_PARAM storageParam;
public ConfigStorage()
{
InitializeComponent();
}
public void SetConfig(ref STORAGE_PARAM pStorage)
{
storageParam = pStorage;
textPath.Text = pStorage.sPath;
checkTxt.Checked = pStorage.bTxt;
checkCSV.Checked = pStorage.bCSV;
checkSQL.Checked = pStorage.bSQL;
checkExcel.Checked = pStorage.bExcel;
}
private void buttonPath_Click(object sender, EventArgs e)
{
FolderBrowserDialog folder = new FolderBrowserDialog();
folder.ShowDialog();
textPath.Text = folder.SelectedPath;
}
private void buttonSetSQL_Click(object sender, EventArgs e)
{
//ConfigSQL configSql = new ConfigSQL();
//configSql.SetConfig(ref FormMain.formMain.configParam.databaseParam);
//configSql.ShowDialog();
}
private void buttonSet_Click(object sender, EventArgs e)
{
storageParam.bTxt = checkTxt.Checked;
storageParam.bCSV = checkCSV.Checked;
storageParam.bSQL = checkSQL.Checked;
storageParam.bExcel = checkExcel.Checked;
storageParam.sPath = textPath.Text;
if (textPath.Text.Length <= 0 && (checkTxt.Checked || checkCSV.Checked || checkExcel.Checked))
{
MessageBox.Show("请选择存储路径!");
return;
}
FormMain.form.updateStorage(storageParam);
Config.saveStorage(storageParam);
MessageBox.Show("保存成功!");
}
private void checkSQL_CheckedChanged(object sender, EventArgs e)
{
//检查是否已经配置了数据库信息
//if (checkSQL.Checked)
//{
// if (FormMain.formMain.configParam.databaseParam.sServer.Length <= 0
// || FormMain.formMain.configParam.databaseParam.sDBName.Length <= 0
// || FormMain.formMain.configParam.databaseParam.sDBUser.Length <= 0
// || FormMain.formMain.configParam.databaseParam.sDBPassword.Length <= 0)
// {
// MessageBox.Show("请先配置数据库信息!");
// checkSQL.Checked = false;
// }
//}
}
}
}