Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. public void PostLatLong(string fileType, string fileNumber, List<LatLongDEntry> latLongList, DateTime? transactionDate = null, string commentText1 = null, string commentText2 = null, string username = null, string password = null)
  2. {
  3. string transactionCode = "LATLONGS";
  4. List<List<LatLongEntry>> splitList = new List<List<LatLongEntry>>();
  5.  
  6. try
  7. {
  8. while (latLongList.Any())
  9. {
  10. splitList.Add(latLongList.Take(5).ToList());
  11. latLongList = latLongList.Skip(5).ToList();
  12. }
  13.  
  14. foreach (List<LatLongEntry> list in splitList)
  15. {
  16. SetupCaseFileUpdateTransaction(transactionCode, fileType, fileNumber, commentText1, commentText2, transactionDate, username, password);
  17. SetCode(1, list[0].Latitude);
  18. SetCode(2, list[0].Longitude);
  19. if (list.Count > 1)
  20. {
  21. SetCode(4, list[1].Latitude);
  22. SetCode(5, list[1].Longitude);
  23. }
  24. if (list.Count > 2)
  25. {
  26. SetCode(6, list[2].Latitude);
  27. SetCode(7, list[2].Longitude);
  28. }
  29. if (list.Count > 3)
  30. {
  31. SetMisc(1, list[3].Latitude);
  32. SetMisc(2, list[3].Longitude);
  33. }
  34. if (list.Count > 4)
  35. {
  36. SetMisc(3, list[4].Latitude);
  37. SetMisc(4, list[4].Longitude);
  38. }
  39. CallWebService();
  40. }
  41. }
  42. catch (Exception e)
  43. {
  44. LogTransactionException(transactionCode, e);
  45. throw;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement