| | |
| | | if (UpdateOrganizetatus(db, entity.FNumber, "B")) |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | if (InsertItem(db, entity)) |
| | | return 1; |
| | | break; |
| | | case "3": |
| | | if (DeleteItem(db, entity.FNumber)) |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | case "4": |
| | | if (InsertOrUpdate(db, entity)) |
| | | return 1; |
| | |
| | | if (!UpdateOrganizetatusBatch(db, itemGroup.Value, "B")) |
| | | throw new NotImplementedException("禁用失败"); |
| | | break; |
| | | case "2": |
| | | if (!InsertItemBatch(db, itemGroup.Value)) |
| | | throw new NotImplementedException("插入失败"); |
| | | break; |
| | | case "3": |
| | | if (!DeleteItemBatch(db, itemGroup.Value)) |
| | | throw new NotImplementedException("删除失败"); |
| | | break; |
| | | case "2": |
| | | case "4": |
| | | if (!InsertOrUpdateBatch(db, itemGroup.Value)) |
| | | throw new NotImplementedException("同步失败"); |
| | |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db, |
| | | List<SysOrganization> itemList) |
| | | { |
| | | foreach (var entity in itemList) |
| | | if (!InsertOrUpdate(db, entity)) |
| | | return false; |
| | | |
| | | return true; |
| | | return itemList.All(entity => InsertOrUpdate(db, entity)); |
| | | } |
| | | } |