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; + } + } + } +}