From 3e200b3382e76e36b3d9f677e7d30a70708a4df0 Mon Sep 17 00:00:00 2001 From: tdx Date: Sat, 5 Apr 2025 13:34:44 +0000 Subject: [PATCH] SVN r446 SVN-Revision: r446 --- 插件库/Lskj.PubBomImport/FrmBillInfo.cs | 31 ++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/插件库/Lskj.PubBomImport/FrmBillInfo.cs b/插件库/Lskj.PubBomImport/FrmBillInfo.cs index d72e71d..b06b68f 100644 --- a/插件库/Lskj.PubBomImport/FrmBillInfo.cs +++ b/插件库/Lskj.PubBomImport/FrmBillInfo.cs @@ -483,4 +483,33 @@ namespace Lskj.PubBomImport { string productId = sourceRow["ProductId"] + ""; DataRow newSourceRow = newSource.Rows.Cast().Where(n => (n["ProductId"] + "").Equals(productId)).FirstOrDefault(); - \ No newline at end of file + if (newSourceRow != null) + { + sourceRow["tamount"] = newSourceRow["tamount"]; + sourceRow["amount"] = newSourceRow["amount"]; + newSource.Rows.Remove(newSourceRow); + } + else + { + deleteRows.Add(sourceRow); + } + } + foreach (DataRow deleteRow in deleteRows) + { + source.Rows.Remove(deleteRow); + } + foreach (DataRow newSourceRow in newSource.Rows) + { + DataRow newRow = source.NewRow(); + newRow.ItemArray = newSourceRow.ItemArray; + source.Rows.Add(newRow); + } + } + else + { + //新增 + this.gcMain.GridControl.DataSource = newSource; + } + } + } +}