修改物料分类=》信息补全批量导入

master
Yang 2 years ago
parent 10b60325e1
commit eec6715d29

@ -462,6 +462,7 @@ namespace FactorySystemBll
update.Remove("FTypeName2");
update.Add("FEditUser", userId);
update.Add("FEditDate", DateTime.Now);
updateList.Add(update);
infoList[i] = childMater;
}
@ -475,11 +476,24 @@ namespace FactorySystemBll
if (updateList.Count > 0)
{
db.BeginTran();
result += db.Updateable(updateList).AS("TFS_Material").WhereColumns("FID").IgnoreColumns(true).ExecuteCommand();
foreach (var item in updateList)
{
result += db.Updateable(item).AS("TFS_Material").WhereColumns("FID").IgnoreColumns(true).ExecuteCommand();
}
List<TFS_MaterialInfo> temps = infoList.Where(s => s != null && s.FID > 0).ToList();
if (temps.Count > 0) db.Updateable(temps).WhereColumns("FID").IgnoreColumns(true).ExecuteCommand();
foreach (var item in temps)
{
db.Updateable(item).WhereColumns("FID").IgnoreColumns(true).ExecuteCommand();
}
temps = infoList.Where(s => s != null && s.FID <= 0).ToList();
if (temps.Count > 0) db.Insertable(temps).IgnoreColumns(true).ExecuteCommand();
foreach (var item in temps)
{
db.Insertable(item).IgnoreColumns(true).ExecuteCommand();
}
db.CommitTran();
}
ExceptionHelper.AddSystemJournal(null, mainList, new { updateList, infoList }, userId, "InsertBatchInfoMaterialData");

Loading…
Cancel
Save