VersionedListedCard.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Dfs.WayneChina.SpsDbManager.ResultSet;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Dfs.WayneChina.IPosPlus
  5. {
  6. public class VersionedListedCard
  7. {
  8. public VersionedListedCard(byte version, string validStartDate, string expiryDate, int cardCount, List<ListedCard> listedCards)
  9. {
  10. Version = version;
  11. ValidStartDate = validStartDate;
  12. ExpiryDate = expiryDate;
  13. CardCount = cardCount;
  14. ListedCards = listedCards;
  15. AllCards = FormatCardList(listedCards);
  16. }
  17. private string FormatCardList(List<ListedCard> listedCards)
  18. {
  19. if (listedCards == null)
  20. return string.Empty;
  21. StringBuilder sb = new StringBuilder();
  22. foreach (var card in listedCards)
  23. {
  24. sb.Append(card.CardNo.PadLeft(20, '0'));
  25. }
  26. return sb.ToString();
  27. }
  28. public byte Version { get; set; }
  29. public string ValidStartDate { get; set; }
  30. public string ExpiryDate { get; set; }
  31. public int CardCount { get; set; }
  32. public List<ListedCard> ListedCards { get; set; }
  33. public string AllCards { get; }
  34. }
  35. }