提交当前本机整理版本
This commit is contained in:
@@ -606,4 +606,32 @@ namespace Lskj.PubBomImport
|
||||
if (mainRow != null)
|
||||
{
|
||||
//更新
|
||||
DataTable source = this.gcMain.GridC
|
||||
DataTable source = this.gcMain.GridControl.DataSourceTable();
|
||||
List<DataRow> deleteRows = new List<DataRow>();
|
||||
foreach (DataRow sourceRow in source.Rows)
|
||||
{
|
||||
string bak = sourceRow["bak"] + "";
|
||||
if (!string.IsNullOrEmpty(bak) && bak.Trim().StartsWith("ZZQD"))
|
||||
{
|
||||
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