Exemple #1
0
        /// <summary>
        /// Получить данные для подключения по имени организации
        /// </summary>
        /// <param name="configuration">Конфигурация</param>
        /// <param name="organizationName">Имя организации</param>
        /// <returns>Данные для подключения</returns>
        public static ISecretNBCH GetSecretNBCH(IConfiguration configuration, string organizationName)
        {
            IConfigurationSection configurationSection  = configuration.GetSection(Startup.WebServiceNBCH);
            ISecretNBCH           webServiceNBCHSecrets = configurationSection.Get <List <SecretNBCH> >().FirstOrDefault(i => i.Organization1CName.Equals(organizationName));

            return(webServiceNBCHSecrets);
        }
Exemple #2
0
        /// <summary>
        /// Получить КИ из НБКИ.
        /// </summary>
        /// <param name="serviceNBCH">Сервис НБКИ</param>
        /// <param name="data">Данные для запроса КИ клиента</param>
        /// <param name="secretNBCH">Настройки для подключения</param>
        /// <param name="logger">Логгер</param>
        /// <typeparam name="TLoggerClass">Класс логгера</typeparam>
        /// <returns>Анкета НБКИ</returns>
        internal static async Task <Report> GetCreditHistoryAsync <TLoggerClass>(IServiceNBCHsoap serviceNBCH, IndexModel data,
                                                                                 ISecretNBCH secretNBCH, ILogger <TLoggerClass> logger) where TLoggerClass : class
        {
            ProductRequest productRequest = (ProductRequest)data;

            productRequest.Prequest.Req.RequestorReq = new RequestorReq()
            {
                MemberCode = secretNBCH.MemberCode,
                Password   = secretNBCH.Password,
                UserID     = secretNBCH.UserId
            };

            Report report = await serviceNBCH.GetReportAsync(
                SOAPNBCH.ProductServiceURL,
                productRequest,
                data.Account1CCode,
                data.Client1CCode,
                data.ClientTimeZone,
                CancellationToken.None);

            return(report);
        }