Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using EleWise.ELMA.Logging;
- using Impeltech.Bank.Models;
- using Impeltech.Kontur.Helpers;
- ..............
- public void UpdateGovPurchases(ISubjectMSP subject)
- {
- try
- {
- var govPurchasesOfParticipantRequest = new GovPurchasesOfParticipantMethod(subject.INN, subject.OGRNIP);
- var response = govPurchasesOfParticipantRequest.GetResponse();
- if (response == null || !response.Any()) return;
- var govPurchasesOfParticipant = response.FirstOrDefault();
- if (govPurchasesOfParticipant != null)
- subject.GovPurchasesOfParticipantRequest = govPurchasesOfParticipant.ToElmaEntity();
- if (subject.GovPurchasesOfParticipantRequest != null)
- {
- subject.PurchasesOfParticipant.AddAll(subject.GovPurchasesOfParticipantRequest.PurchasesOfParticipant);
- }
- }
- catch (Exception ex)
- {
- var message = $"Запрос в контур Фокус 'GovPurchasesOfParticipantRequest' по {subject}";
- Logger.Log.Log(LogLevel.Error, ex, message);
- //throw new Exception(message, ex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment