yambroskin

Untitled

Aug 2nd, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using EleWise.ELMA.Logging;
  4. using Impeltech.Bank.Models;
  5. using Impeltech.Kontur.Helpers;
  6.  
  7. ..............
  8. public void UpdateGovPurchases(ISubjectMSP subject)
  9. {
  10. try
  11. {
  12. var govPurchasesOfParticipantRequest = new GovPurchasesOfParticipantMethod(subject.INN, subject.OGRNIP);
  13. var response = govPurchasesOfParticipantRequest.GetResponse();
  14. if (response == null || !response.Any()) return;
  15. var govPurchasesOfParticipant = response.FirstOrDefault();
  16. if (govPurchasesOfParticipant != null)
  17. subject.GovPurchasesOfParticipantRequest = govPurchasesOfParticipant.ToElmaEntity();
  18. if (subject.GovPurchasesOfParticipantRequest != null)
  19. {
  20. subject.PurchasesOfParticipant.AddAll(subject.GovPurchasesOfParticipantRequest.PurchasesOfParticipant);
  21. }
  22. }
  23. catch (Exception ex)
  24. {
  25. var message = $"Запрос в контур Фокус 'GovPurchasesOfParticipantRequest' по {subject}";
  26. Logger.Log.Log(LogLevel.Error, ex, message);
  27. //throw new Exception(message, ex);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment