SVN-Revision: r595
This commit is contained in:
wyf
2025-05-16 07:41:22 +00:00
parent c13173a8b2
commit de8612b173
+40 -3
View File
@@ -2689,10 +2689,15 @@ namespace Lskj.PubBill
{ {
sourceTable.Columns.Add("BomMxMainProduct"); sourceTable.Columns.Add("BomMxMainProduct");
} }
if (!sourceTable.Columns.Contains("BomMxAddState"))
{
sourceTable.Columns.Add("BomMxAddState");
}
DataTable dataTable = new DataTable(); DataTable dataTable = new DataTable();
dataTable.Columns.Add(afterBomFieldName); dataTable.Columns.Add(afterBomFieldName);
dataTable.Columns.Add("BomFieldNameDir"); dataTable.Columns.Add("BomFieldNameDir");
dataTable.Columns.Add("BomMxMainProduct"); dataTable.Columns.Add("BomMxMainProduct");
dataTable.Columns.Add("BomMxAddState");
IEnumerable<DataRow> rowsIEnumerable = sourceTable.Rows.Cast<DataRow>().Where(n => n.RowState != DataRowState.Deleted); IEnumerable<DataRow> rowsIEnumerable = sourceTable.Rows.Cast<DataRow>().Where(n => n.RowState != DataRowState.Deleted);
string namepattern = @"([A-Za-z]+(-[A-Za-z0-9]+)*-\d+(-\d+)*)"; string namepattern = @"([A-Za-z]+(-[A-Za-z0-9]+)*-\d+(-\d+)*)";
foreach (string fileName in impRtnModel.FileNames) foreach (string fileName in impRtnModel.FileNames)
@@ -2702,8 +2707,8 @@ namespace Lskj.PubBill
DataRow selectRow = rowsIEnumerable.Where(n => (n[afterBomFieldName] + "").Trim().Equals(fileNameWithoutExtension, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); DataRow selectRow = rowsIEnumerable.Where(n => (n[afterBomFieldName] + "").Trim().Equals(fileNameWithoutExtension, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
if (selectRow != null) if (selectRow != null)
{ {
MessageUtil.Show($"{fileNameWithoutExtension}已存在,不允许重复创建"); //MessageUtil.Show($"{fileNameWithoutExtension}已存在,不允许重复创建");
return; continue;
} }
//DataRow productRow = BaseImpl.GetDataRowResult($"select top 1 billdocument_id from bom_BillTab where productid like '{code}%'"); //DataRow productRow = BaseImpl.GetDataRowResult($"select top 1 billdocument_id from bom_BillTab where productid like '{code}%'");
//if (productRow != null) //if (productRow != null)
@@ -2717,6 +2722,7 @@ namespace Lskj.PubBill
if (fileNameWithoutExtension.StartsWith("MX")) if (fileNameWithoutExtension.StartsWith("MX"))
{ {
addRow["BomMxMainProduct"] = mxProductId; addRow["BomMxMainProduct"] = mxProductId;
addRow["BomMxAddState"] = this.BillModel.SaveState ? "修改" : "新增";
} }
dataTable.Rows.Add(addRow); dataTable.Rows.Add(addRow);
} }
@@ -2725,6 +2731,7 @@ namespace Lskj.PubBill
DataRow sourceRow = this.AddRowToGridView(item, true); DataRow sourceRow = this.AddRowToGridView(item, true);
sourceRow["BomFieldNameDir"] = item["BomFieldNameDir"] + ""; sourceRow["BomFieldNameDir"] = item["BomFieldNameDir"] + "";
sourceRow["BomMxMainProduct"] = item["BomMxMainProduct"] + ""; sourceRow["BomMxMainProduct"] = item["BomMxMainProduct"] + "";
sourceRow["BomMxAddState"] = item["BomMxAddState"] + "";
} }
} }
} }
@@ -8109,4 +8116,34 @@ namespace Lskj.PubBill
/// </summary> /// </summary>
/// <param name="cond">The cond.</param> /// <param name="cond">The cond.</param>
/// <param name="dataRow">The data row.</param> /// <param name="dataRow">The data row.</param>
/// <returns><c>true</c> if X /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
private bool ValidateCond(string cond, DataRow dataRow)
{
bool result = false;
string condition = cond;
try
{
if (string.IsNullOrWhiteSpace(cond)) return true;//如果值是空格或者空行,默认正确
cond = ReplaceHelper.ReplaceRowParam(dataRow, cond);
if (cond.StartsWith("@") || cond.StartsWith("!"))
{
result = "1".Equals(BaseImpl.GetDefaultValue(cond));
}
else if (dataRow == null)
{
result = ReplaceHelper.EvalCond(cond);
}
else
{
result = ReplaceHelper.ReplaceRowParamCond(dataRow, cond);
}
return result;
}
catch (Exception ex)
{
}
return result;
}
}
}