提交所有文件

This commit is contained in:
2026-09-19 14:12:58 +08:00
parent 20e88479b1
commit 7b922290bb
62 changed files with 11832 additions and 131 deletions
+19 -15
View File
@@ -125,7 +125,6 @@ namespace GThinking.N_XLXSBJ
{
string sXLXHID = ds.Tables[0].Rows[i][0].ToString().Trim();
string sDYDJID = ds.Tables[0].Rows[i][1].ToString().Trim();
string sZXJM = ds.Tables[0].Rows[i][2].ToString().Trim();
#region 校验数据
@@ -137,22 +136,31 @@ namespace GThinking.N_XLXSBJ
if (sDYDJID.Equals(""))
sDYDJID = " ";
if (sZXJM.Equals(""))
sZXJM = " ";
#endregion
string sSQL = string.Format("delete from XLXSBJCPYS where XLXSBJCPYS_XLJBXHID='{0}' and XLXSBJCPYS_DYDJID='{1}' and ,XLXSBJCPYS_XLYSID='{2}' ", sXLXHID, sDYDJID,sZXJM);
string sSQL = string.Format("delete from XLXSBJCPYS where XLXSBJCPYS_XLJBXHID='{0}' and XLXSBJCPYS_DYDJID='{1}' ", sXLXHID, sDYDJID);
SQL.Clear();
SQL.Add(sSQL);
dberp.ExecSQL(SQL);
int XH = 1;
SQL.Clear();
SQL.Add("select count(1) as SL from XLXSBJCPYS where XLXSBJCPYS_XLJBXHID=:pXLXHID");
SQL.ParamByName("pXLXHID").Value = sXLXHID;
DataSet dscon = dberp.OpenDataSet(SQL);
if (dscon.Tables[0].Rows.Count > 0)
{
XH = CMISproConvert.StrToInt(dscon.Tables[0].Rows[0][0].ToString().Trim())+1;
}
#region 按矩阵列生成属性记录
string sXLTXID = string.Empty;
int XH = 1;
for (int j = 3; j < ds.Tables[0].Columns.Count; j++)
for (int j = 2; j < ds.Tables[0].Columns.Count; j++)
{
object objValue = ds.Tables[0].Rows[i][j];
if (objValue == null || objValue == DBNull.Value)
@@ -169,11 +177,10 @@ namespace GThinking.N_XLXSBJ
SQL.Clear();
SQL.Add(@" insert into XLXSBJCPYS(XLXSBJCPYS_CPYT, XLXSBJCPYS_XLJBXHID,XLXSBJCPYS_XLYSID, XLXSBJCPYS_DYDJID,XLXSBJCPYS_XXJGID,XLXSBJCPYS_WHR,XLXSBJCPYS_WHRID,XLXSBJCPYS_WHSJ)
values(:XLXSBJCPYS_CPYT,:XLXSBJCPYS_XLJBXHID,:XLXSBJCPYS_XLYSID,:XLXSBJCPYS_DYDJID,:XLXSBJCPYS_XXJGID,:XLXSBJCPYS_WHR,:XLXSBJCPYS_WHRID,:XLXSBJCPYS_WHSJ)");
SQL.Add(@" insert into XLXSBJCPYS(XLXSBJCPYS_CPYT, XLXSBJCPYS_XLJBXHID, XLXSBJCPYS_DYDJID,XLXSBJCPYS_XXJGID,XLXSBJCPYS_WHR,XLXSBJCPYS_WHRID,XLXSBJCPYS_WHSJ)
values(:XLXSBJCPYS_CPYT,:XLXSBJCPYS_XLJBXHID,:XLXSBJCPYS_DYDJID,:XLXSBJCPYS_XXJGID,:XLXSBJCPYS_WHR,:XLXSBJCPYS_WHRID,:XLXSBJCPYS_WHSJ)");
SQL.ParamByName("XLXSBJCPYS_XLJBXHID").Value = sXLXHID;
SQL.ParamByName("XLXSBJCPYS_DYDJID").Value = sDYDJID;
SQL.ParamByName("XLXSBJCPYS_XLYSID").Value = sZXJM;
SQL.ParamByName("XLXSBJCPYS_XXJGID").Value = sXLXHFJSX;
SQL.ParamByName("XLXSBJCPYS_CPYT").Value = XH++;
SQL.ParamByName("XLXSBJCPYS_WHR").Value = tSession.UserName;
@@ -202,9 +209,9 @@ namespace GThinking.N_XLXSBJ
private void ExcelColumnValid(DataSet ds)
{
if (ds.Tables[0].Columns.Count < 4)
if (ds.Tables[0].Columns.Count < 3)
{
throw new Exception("Excel 列数不正确,至少需要包含“型号”、“电压等级”、“主芯截面”列和一列属性列!");
throw new Exception("Excel 列数不正确,至少需要包含“型号”、“电压等级”列和一列属性列!");
}
if (!ds.Tables[0].Columns[0].ColumnName.Trim().Equals("型号"))
@@ -217,10 +224,7 @@ namespace GThinking.N_XLXSBJ
throw new Exception(string.Format("第 2 列标题错误,当前为({0}),应为(电压等级)", ds.Tables[0].Columns[0].ColumnName.Trim()));
}
if (!ds.Tables[0].Columns[2].ColumnName.Trim().Equals("主芯截面"))
{
throw new Exception(string.Format("第 3 列标题错误,当前为({0}),应为(主芯截面)", ds.Tables[0].Columns[0].ColumnName.Trim()));
}
}
private void ReadWJ(string sPath, ref DataSet aDataExcel)