| | |
| | | } |
| | | |
| | | //插入拓展 |
| | | public async Task<long> InsertEx(AddAssetsPumpPartMainInput part, List<AddAssetsPumpPropContentInput> propcontents, AddAssetsPumpMainAndPartMapDto partmap) |
| | | public async Task<long> InsertEx(AddAssetsPumpPartMainInput part, List<AddAssetsPumpPropContentInput> propcontents, AddAssetsPumpMainAndPartMapInput partmap) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var partmodel = part.Adapt<AddAssetsPumpPartMainInput, Model.AssetsPumpPartMain>(); |
| | | partmodel.SortCode = _service.GetMaxSortCode() + 1; |
| | | var propcontentlistmodel = propcontents.Select(x => x.Adapt<AddAssetsPumpPropContentInput, Model.AssetsPumpPropContent>()).ToList(); |
| | | var partmapmodel = partmap.Adapt<AddAssetsPumpMainAndPartMapDto, Model.AssetsPumpMainAndPartMap>(); |
| | | var partmapmodel = partmap.Adapt<AddAssetsPumpMainAndPartMapInput, Model.AssetsPumpMainAndPartMap>(); |
| | | var id = _service.InsertEX(partmodel, propcontentlistmodel, partmapmodel); |
| | | return id; |
| | | }); |
| | |
| | | |
| | | public async Task<bool> DeleteEx(long ID) |
| | | { |
| | | /* return await Task.Factory.StartNew(() => |
| | | { |
| | | var bol = _service.DeleteExByID(ID); |
| | | if (!bol) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D999, "删除失败"); |
| | | } |
| | | return true; |
| | | });*/ |
| | | return false; |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var bol = _service.DeleteExByID(ID); |
| | | if (!bol) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D999, "删除失败"); |
| | | } |
| | | return true; |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |