| | |
| | | case "1": |
| | | return DeleteItemType(entity.Id); |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没有{customer.Type}这个类型的参数"); |
| | | throw new ArgumentNullException($"type没有{customer.Type}这个类型的参数"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | var insert = base.Insert(entity); |
| | | if (insert) |
| | | { |
| | | return true; |
| | | |
| | | } |
| | | throw new NotImplementedException("插入失败"); |
| | | } |
| | | |
| | | private bool DeleteItemType(decimal id) |
| | | { |
| | | var deleteById = Db.Deleteable<MesItemType>() |
| | | .Where(it => it.Id == id).ExecuteCommand(); |
| | | var deleteById = Db.Deleteable<MesItemType>().Where(it => it.Id == id).ExecuteCommand(); |
| | | if (deleteById > 0) |
| | | { |
| | | return true; |
| | | |
| | | } |
| | | throw new NotImplementedException("删除失败"); |
| | | } |
| | | |
| | |
| | | Tcode = department.FNumber, |
| | | Tname = department.FName, |
| | | Description = department.FDescription, |
| | | //FSubsidiary = department.FSubsidiary, |
| | | //Fumbrella = department.Fumbrella, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | |
| | | entity.Type = s.Type; |
| | | list.Add(entity); |
| | | }); |
| | | |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | var groupBy = list.GroupBy(s => s.Type).ToDictionary(g => g.Key, g => g.ToList()); |
| | | var result = new List<bool>(); |
| | | |
| | | foreach (var itemTypeGroup in groupBy) |
| | | try |
| | | { |
| | |
| | | result.Add(DeleteItemTypeBatch(itemTypeGroup.Value)); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没有{itemTypeGroup.Key}这个类型的参数"); |
| | | throw new ArgumentNullException($"type没有{itemTypeGroup.Key}这个类型的参数"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | |
| | | if (result.All(b => b)) |
| | | { |
| | | return true; |
| | | |
| | | } |
| | | throw new NotImplementedException("接口执行失败"); |
| | | } |
| | | |
| | |
| | | { |
| | | var insertRange = base.InsertRange(itemTypeList); |
| | | if (insertRange) |
| | | { |
| | | return true; |
| | | |
| | | } |
| | | throw new NotImplementedException("插入失败"); |
| | | } |
| | | |
| | |
| | | { |
| | | var ids = itemTypeList.Select(it => it.Id).ToArray(); |
| | | |
| | | var deleteByIds = Db.Deleteable<MesItemType>() |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | var deleteByIds = Db.Deleteable<MesItemType>().Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (deleteByIds > 0) |
| | | { |
| | | return true; |
| | | |
| | | } |
| | | throw new NotImplementedException("删除失败"); |
| | | } |
| | | } |