SVN r446
SVN-Revision: r446
This commit is contained in:
@@ -483,4 +483,33 @@ namespace Lskj.PubBomImport
|
|||||||
{
|
{
|
||||||
string productId = sourceRow["ProductId"] + "";
|
string productId = sourceRow["ProductId"] + "";
|
||||||
DataRow newSourceRow = newSource.Rows.Cast<DataRow>().Where(n => (n["ProductId"] + "").Equals(productId)).FirstOrDefault();
|
DataRow newSourceRow = newSource.Rows.Cast<DataRow>().Where(n => (n["ProductId"] + "").Equals(productId)).FirstOrDefault();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user