|
|
@ -78,19 +78,19 @@ namespace BBWY.Server.Business.Sync |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//var storeHouseIds = storeHouseList.Select(s => s.Id).ToArray();
|
|
|
|
//var dbStoreIds = fsql.Select<Storehouse>(storeHouseIds).ToList(s => s.Id);
|
|
|
|
//var exceptIds = storeHouseIds.Except(dbStoreIds);
|
|
|
|
//if (exceptIds.Count() > 0)
|
|
|
|
//{
|
|
|
|
// var insertList = storeHouseList.Where(s => exceptIds.Contains(s.Id)).ToList();
|
|
|
|
// fsql.Insert(insertList).ExecuteAffrows();
|
|
|
|
//}
|
|
|
|
fsql.Transaction(() => |
|
|
|
var storeHouseIds = storeHouseList.Select(s => s.Id).ToArray(); |
|
|
|
var dbStoreIds = fsql.Select<Storehouse>(storeHouseIds).ToList(s => s.Id); |
|
|
|
var exceptIds = storeHouseIds.Except(dbStoreIds); |
|
|
|
if (exceptIds.Count() > 0) |
|
|
|
{ |
|
|
|
fsql.Delete<Storehouse>().Where(s => 1 == 1).ExecuteAffrows(); |
|
|
|
fsql.Insert(storeHouseList).ExecuteAffrows(); |
|
|
|
}); |
|
|
|
var insertList = storeHouseList.Where(s => exceptIds.Contains(s.Id)).ToList(); |
|
|
|
fsql.Insert(insertList).ExecuteAffrows(); |
|
|
|
} |
|
|
|
//fsql.Transaction(() =>
|
|
|
|
//{
|
|
|
|
// fsql.Delete<Storehouse>().Where(s => 1 == 1).ExecuteAffrows();
|
|
|
|
// fsql.Insert(storeHouseList).ExecuteAffrows();
|
|
|
|
//});
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|