SVN r473
SVN-Revision: r473
This commit is contained in:
@@ -2640,7 +2640,7 @@ namespace Lskj.PubBill
|
|||||||
dataTable.Columns.Add(afterBomFieldName);
|
dataTable.Columns.Add(afterBomFieldName);
|
||||||
dataTable.Columns.Add("BomFieldNameDir");
|
dataTable.Columns.Add("BomFieldNameDir");
|
||||||
IEnumerable<DataRow> rowsIEnumerable = sourceTable.Rows.Cast<DataRow>();
|
IEnumerable<DataRow> rowsIEnumerable = sourceTable.Rows.Cast<DataRow>();
|
||||||
string namepattern = @"^(.+?)\s+(.+)$";
|
string namepattern = @"([A-Za-z]+(-[A-Za-z0-9]+)*-\d+(-\d+)*)";
|
||||||
Dictionary<DataRow, string> filesDic = new Dictionary<DataRow, string>();
|
Dictionary<DataRow, string> filesDic = new Dictionary<DataRow, string>();
|
||||||
foreach (string fileName in impRtnModel.FileNames)
|
foreach (string fileName in impRtnModel.FileNames)
|
||||||
{
|
{
|
||||||
@@ -2651,11 +2651,21 @@ namespace Lskj.PubBill
|
|||||||
if (namematch.Success)
|
if (namematch.Success)
|
||||||
{
|
{
|
||||||
string code = namematch.Groups[1].Value;
|
string code = namematch.Groups[1].Value;
|
||||||
string name = namematch.Groups[2].Value;
|
if (!string.IsNullOrEmpty(code))
|
||||||
//找到code相同的行
|
|
||||||
DataRow selectRow = rowsIEnumerable.Where(n => (n[afterBomFieldName] + "").Trim().StartsWith(code, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
|
||||||
if (selectRow == null)
|
|
||||||
{
|
{
|
||||||
|
//找到code相同的行
|
||||||
|
DataRow selectRow = rowsIEnumerable.Where(n => (n[afterBomFieldName] + "").Trim().StartsWith(code, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
||||||
|
if (selectRow != null)
|
||||||
|
{
|
||||||
|
MessageUtil.Show($"{code}已存在,不允许重复创建");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DataRow productRow = BaseImpl.GetDataRowResult($"select top 1 billdocument_id from bom_BillTab where productid like '{code}%'");
|
||||||
|
if (productRow != null)
|
||||||
|
{
|
||||||
|
MessageUtil.Show($"{code}已存在,不允许重复创建");
|
||||||
|
return;
|
||||||
|
}
|
||||||
DataRow addRow = dataTable.NewRow();
|
DataRow addRow = dataTable.NewRow();
|
||||||
addRow[afterBomFieldName] = fileNameWithoutExtension;
|
addRow[afterBomFieldName] = fileNameWithoutExtension;
|
||||||
addRow["BomFieldNameDir"] = fileName;
|
addRow["BomFieldNameDir"] = fileName;
|
||||||
|
|||||||
Reference in New Issue
Block a user