一、
if (ediVbapAndEdiMaras.Count != changedData.Count)
{
for (int i = 0; i < changedData.Count; i++)
{
posnr = changedData[i].POSNR;
for (int j = 0; j < ediVbapAndEdiMaras.Count; j++)
{
posnrs = ediVbapAndEdiMaras[j].POSNR;
if (posnrs == posnr)
{
ediVbapAndEdiMara.RemoveAll(item => { return item.POSNR == posnrs; });
}
}
}
ediVbapAndEdiMara.ForEach(y =>
{
var BB = ediVbapAndEdiMaras.FirstOrDefault(b => b.POSNR == y.POSNR);
if (BB != null)
{
BB.Attribute = "新增";
}
});
二、
List<EdiVbapAndEdiMara> ediVbapAnds = ediVbapAnd.Where(x => ediVbapAndEdis.All(x2 => x.SOBQT != x2.SOBQT || x.WAERK != x2.WAERK)).ToList();
List<EdiVbapAndEdiMara> ediVbapAnds = changedData.Where(x => !ediVbapAndEdis.Any(x2 => x.MATNR == x2.MATNR)).ToList();