|
|
@ -30,45 +30,53 @@ namespace SegmentationWeight |
|
|
// CheckAddCreateConfig();
|
|
|
// CheckAddCreateConfig();
|
|
|
mLocaList = XmlUtil.DeserializeFromFile<List<SegmentationWeightGoodSet>>(SegmentationWeightGoodsSetFileName); |
|
|
mLocaList = XmlUtil.DeserializeFromFile<List<SegmentationWeightGoodSet>>(SegmentationWeightGoodsSetFileName); |
|
|
|
|
|
|
|
|
var fromRpclist = ClientGoodsSetRpc.GetList(); |
|
|
|
|
|
foreach (ClientGoodsSetDto rpcSet in fromRpclist) |
|
|
|
|
|
|
|
|
if (LoginRpcUtil.TestConnection(1000)) |
|
|
{ |
|
|
{ |
|
|
var set = new SegmentationWeightGoodSet(); |
|
|
|
|
|
set.Name = rpcSet.Name; |
|
|
|
|
|
set.Goods_ID = rpcSet.Goods_ID; |
|
|
|
|
|
set.Goods_Name = rpcSet.Goods_Name; |
|
|
|
|
|
set.Goods_Code = rpcSet.Goods_Code; |
|
|
|
|
|
set.Goods_Spec = rpcSet.Goods_Spec; |
|
|
|
|
|
|
|
|
|
|
|
var fd = mLocaList.FirstOrDefault(x => x.Goods_ID == set.Goods_ID); |
|
|
|
|
|
if (fd != null) |
|
|
|
|
|
|
|
|
var fromRpclist = ClientGoodsSetRpc.GetList(); |
|
|
|
|
|
foreach (ClientGoodsSetDto rpcSet in fromRpclist) |
|
|
{ |
|
|
{ |
|
|
fd.Name = set.Name; |
|
|
|
|
|
fd.Goods_Name = set.Goods_Name; |
|
|
|
|
|
fd.Goods_Code = set.Goods_Code; |
|
|
|
|
|
fd.Goods_Spec = set.Goods_Spec; |
|
|
|
|
|
|
|
|
var set = new SegmentationWeightGoodSet(); |
|
|
|
|
|
set.Name = rpcSet.Name; |
|
|
|
|
|
set.Goods_ID = rpcSet.Goods_ID; |
|
|
|
|
|
set.Goods_Name = rpcSet.Goods_Name; |
|
|
|
|
|
set.Goods_Code = rpcSet.Goods_Code; |
|
|
|
|
|
set.Goods_Spec = rpcSet.Goods_Spec; |
|
|
|
|
|
set.StandardWeight = rpcSet.StandardWeight; |
|
|
|
|
|
set.StandardWeightUp = rpcSet.StandardWeightUp; |
|
|
|
|
|
set.StandardWeightLow = rpcSet.StandardWeightLow; |
|
|
|
|
|
var fd = mLocaList.FirstOrDefault(x => x.Goods_ID == set.Goods_ID); |
|
|
|
|
|
if (fd != null) |
|
|
|
|
|
{ |
|
|
|
|
|
fd.Name = set.Name; |
|
|
|
|
|
fd.Goods_Name = set.Goods_Name; |
|
|
|
|
|
fd.Goods_Code = set.Goods_Code; |
|
|
|
|
|
fd.Goods_Spec = set.Goods_Spec; |
|
|
|
|
|
fd.StandardWeight = rpcSet.StandardWeight; |
|
|
|
|
|
fd.StandardWeightUp = rpcSet.StandardWeightUp; |
|
|
|
|
|
fd.StandardWeightLow = rpcSet.StandardWeightLow; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
mLocaList.Add(set); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
|
|
|
var localist = mLocaList.ToList(); |
|
|
|
|
|
var removeList = new List<SegmentationWeightGoodSet>(); |
|
|
|
|
|
foreach (SegmentationWeightGoodSet segmentationWeightGoodSet in localist) |
|
|
{ |
|
|
{ |
|
|
mLocaList.Add(set); |
|
|
|
|
|
|
|
|
if (fromRpclist.All(x => x.Goods_ID != segmentationWeightGoodSet.Goods_ID)) |
|
|
|
|
|
{ |
|
|
|
|
|
removeList.Add(segmentationWeightGoodSet); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
var localist = mLocaList.ToList(); |
|
|
|
|
|
var removeList=new List<SegmentationWeightGoodSet>(); |
|
|
|
|
|
foreach (SegmentationWeightGoodSet segmentationWeightGoodSet in localist) |
|
|
|
|
|
{ |
|
|
|
|
|
if (fromRpclist.All(x => x.Goods_ID != segmentationWeightGoodSet.Goods_ID)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (SegmentationWeightGoodSet set in removeList) |
|
|
{ |
|
|
{ |
|
|
removeList.Add(segmentationWeightGoodSet); |
|
|
|
|
|
|
|
|
mLocaList.Remove(set); |
|
|
} |
|
|
} |
|
|
|
|
|
XmlUtil.SerializerObjToFile(mLocaList, SegmentationWeightGoodsSetFileName); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
foreach (SegmentationWeightGoodSet set in removeList) |
|
|
|
|
|
{ |
|
|
|
|
|
mLocaList.Remove(set); |
|
|
|
|
|
} |
|
|
|
|
|
XmlUtil.SerializerObjToFile(mLocaList, SegmentationWeightGoodsSetFileName); |
|
|
|
|
|
|
|
|
|
|
|
InitControl(); |
|
|
InitControl(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|