Add migrated to .NET 8.0 variant of Hcs.Client
This commit is contained in:
52
Hcs.ClientNet/Client/Api/OrgRegistryCommonApi.cs
Normal file
52
Hcs.ClientNet/Client/Api/OrgRegistryCommonApi.cs
Normal file
@ -0,0 +1,52 @@
|
||||
using Hcs.ClientNet.Api.Request.Exception;
|
||||
using Hcs.ClientNet.Api.Request.OrgRegistryCommon;
|
||||
using Hcs.Service.Async.OrgRegistryCommon;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Hcs.ClientNet.Api
|
||||
{
|
||||
// http://open-gkh.ru/OrganizationsRegistryCommonAsyncService/
|
||||
public class OrgRegistryCommonApi(ClientBase client) : ApiBase(client)
|
||||
{
|
||||
/// <summary>
|
||||
/// Экспорт сведений о поставщиках информации ИС
|
||||
/// </summary>
|
||||
/// <param name="isActual">Выгрузить только активных поставщиков данных</param>
|
||||
/// <param name="token">Токен отмены</param>
|
||||
/// <returns>Сведения о поставщиках данных</returns>
|
||||
public async Task<IEnumerable<exportDataProviderResultType>> ExportDataProviderAsync(bool isActual, CancellationToken token = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
var request = new ExportDataProviderRequest(client);
|
||||
return await request.ExecuteAsync(isActual, token);
|
||||
}
|
||||
catch (NoResultsRemoteException)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Экспорт сведений из реестра организаций
|
||||
/// </summary>
|
||||
/// <param name="ogrn">ОГРН</param>
|
||||
/// <param name="kpp">КПП</param>
|
||||
/// <param name="token">Токен отмены</param>
|
||||
/// <returns>Сведения из реестра организаций</returns>
|
||||
public async Task<IEnumerable<exportOrgRegistryResultType>> ExportOrgRegistryAsync(string ogrn, string kpp, CancellationToken token = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
var request = new ExportOrgRegistryRequest(client);
|
||||
return await request.ExecuteAsync(ogrn, kpp, token);
|
||||
}
|
||||
catch (NoResultsRemoteException)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user