rewrite osago manager
This commit is contained in:
parent
547b5cd59e
commit
437e6e86a2
@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ELT.Client.Models.Insurance;
|
||||
using ELT.Client.Models.Insurance.Request;
|
||||
using ELTOsago;
|
||||
@ -29,17 +31,12 @@ namespace ELT.Client.Managers.Insurance
|
||||
Password = AuthInfo.Password
|
||||
};
|
||||
|
||||
foreach (var companyId in calculateOsagoRequest.CompanyIds)
|
||||
try
|
||||
{
|
||||
var res = _eltOsagoSoap.OSAGOFullCalculation(osagoParams);
|
||||
if (string.IsNullOrEmpty(res.Error))
|
||||
result.Add(companyId, res);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
var tasks = calculateOsagoRequest.CompanyIds.Distinct().Select(companyId => new Task(() =>
|
||||
{
|
||||
var res = _eltOsagoSoap.OSAGOFullCalculation(osagoParams);
|
||||
if (string.IsNullOrEmpty(res.Error))
|
||||
result.Add(companyId, res);
|
||||
}));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user