IbsIdResult.cs 955 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Ips.Library.Entity
  5. {
  6. public class IbsIdResult
  7. {
  8. public int No { get; set; }
  9. public int IbsId { get; set; }
  10. public IbsIdResult() { }
  11. public IbsIdResult(int no, int ibsid)
  12. {
  13. this.No = no;
  14. this.IbsId = ibsid;
  15. }
  16. public IbsIdResult(string result)
  17. {
  18. FromString(result);
  19. }
  20. public void FromString(string result)
  21. {
  22. if (string.IsNullOrWhiteSpace(result)) return;
  23. var items = result.Split(":".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
  24. if (items.Length > 1)
  25. {
  26. this.No = int.Parse(items[0]);
  27. this.IbsId = int.Parse(items[1]);
  28. }
  29. }
  30. public override string ToString()
  31. {
  32. return $"{No}:{IbsId}";
  33. }
  34. }
  35. }