提交说明10/9
This commit is contained in:
+5
-47
@@ -243,60 +243,18 @@ namespace GThinking.N_XLXSBJ
|
||||
if (!ds.Tables[0].Columns[5].ColumnName.Trim().Equals("调价代号"))
|
||||
throw new Exception("导入文件的内容格式不正确,Excel栏目依次为:型号、规格、标准、电压等级、" + cbxYZID.SelectedItem.Text.Trim() + "、调价代号!");
|
||||
}
|
||||
List<string> lstXLXHID = new List<string>();
|
||||
List<string> lstXLBZID = new List<string>();
|
||||
List<string> lstDYDJID = new List<string>();
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL SQL = new TSQL(dberp);
|
||||
SQL.Clear();
|
||||
SQL.Add(" select XLXHB_XLXHID from XLXHB where isnull(XLXHB_TYBZ,'N')<>'Y' order by XLXHB_XLXHID ");
|
||||
DataSet dsTmp = dberp.OpenDataSet(SQL);
|
||||
if (dsTmp.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
lstXLXHID.Clear();
|
||||
for (int i = 0; i < dsTmp.Tables[0].Rows.Count; i++)
|
||||
{
|
||||
if (!lstXLXHID.Contains(dsTmp.Tables[0].Rows[i][0].ToString().Trim().ToUpper()))
|
||||
lstXLXHID.Add(dsTmp.Tables[0].Rows[i][0].ToString().Trim().ToUpper());
|
||||
}
|
||||
}
|
||||
Dictionary<string, string> dicDRMXBZ = new Dictionary<string, string>();
|
||||
dicDRMXBZ.Clear();
|
||||
SQL.Clear();
|
||||
SQL.Add("select XLBZ_XLBZID,XLBZ_XLBZLXMC from XLBZ where 1 = 1 ");
|
||||
DataSet dsXLBZ = dberp.OpenDataSet(SQL);
|
||||
if (dsXLBZ.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dsXLBZ.Tables[0].Rows.Count; i++)
|
||||
{
|
||||
dicDRMXBZ.Add(dsXLBZ.Tables[0].Rows[i]["XLBZ_XLBZID"].ToString().Trim(), dsXLBZ.Tables[0].Rows[i]["XLBZ_XLBZLXMC"].ToString().Trim());
|
||||
if (!lstXLBZID.Contains(dsXLBZ.Tables[0].Rows[i]["XLBZ_XLBZID"].ToString().Trim()))
|
||||
lstXLBZID.Add(dsXLBZ.Tables[0].Rows[i]["XLBZ_XLBZID"].ToString().Trim());
|
||||
}
|
||||
}
|
||||
SQL.Clear();
|
||||
SQL.Add(" select XLDYDJB_DYDJID from XLDYDJB where isnull(XLDYDJB_TYBZ,' ')<>'Y' order by XLDYDJB_XH ");
|
||||
dsTmp = dberp.OpenDataSet(SQL);
|
||||
if (dsTmp.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
lstDYDJID.Clear();
|
||||
for (int i = 0; i < dsTmp.Tables[0].Rows.Count; i++)
|
||||
{
|
||||
if (!lstDYDJID.Contains(dsTmp.Tables[0].Rows[i][0].ToString().Trim().ToUpper()))
|
||||
lstDYDJID.Add(dsTmp.Tables[0].Rows[i][0].ToString().Trim().ToUpper());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string sDefaultXLBZID = XLBJDUtils.GetDefaultXLBZID();
|
||||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||||
{
|
||||
if (!lstXLXHID.Contains(ds.Tables[0].Rows[i][0].ToString().Trim().ToUpper()))
|
||||
if (string.IsNullOrEmpty(ds.Tables[0].Rows[i][0].ToString().Trim().ToUpper()))
|
||||
{
|
||||
throw new Exception("第" + (i + 2).ToString() + "行型号为空或不存在或已停用,不允许导入!");
|
||||
throw new Exception("第" + (i + 2).ToString() + "行型号为空,不允许导入!");
|
||||
}
|
||||
if (!lstDYDJID.Contains(ds.Tables[0].Rows[i][3].ToString().Trim().ToUpper()))
|
||||
if (string.IsNullOrEmpty(ds.Tables[0].Rows[i][3].ToString().Trim().ToUpper()))
|
||||
{
|
||||
throw new Exception("第" + (i + 2).ToString() + "行电压等级为空或不存在或已停用,不允许导入!");
|
||||
throw new Exception("第" + (i + 2).ToString() + "行电压等级为空,不允许导入!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user