diff --git a/FactorySystemBll/MaterialBll.cs b/FactorySystemBll/MaterialBll.cs index 6cd9ce1..90bfb38 100644 --- a/FactorySystemBll/MaterialBll.cs +++ b/FactorySystemBll/MaterialBll.cs @@ -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 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");