ServiceRequest.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using System;
  2. namespace Wayne.FDCPOSLibrary
  3. {
  4. public abstract class BasePOSRequest
  5. {
  6. }
  7. [System.SerializableAttribute()]
  8. public partial class ServiceRequest: BasePOSRequest
  9. {
  10. [System.Xml.Serialization.XmlIgnore()]
  11. private object userToken;
  12. public static int requestIDConter = 0;
  13. public static object requestIDConterLock = new object();
  14. private string requestTypeField;
  15. private string applicationSenderField = "";
  16. private string workstationIDField = "";
  17. private string requestIDField;
  18. [System.Xml.Serialization.XmlAttributeAttribute()]
  19. public string RequestType
  20. {
  21. get
  22. {
  23. return this.requestTypeField;
  24. }
  25. set
  26. {
  27. this.requestTypeField = value;
  28. }
  29. }
  30. [System.Xml.Serialization.XmlAttributeAttribute()]
  31. public string ApplicationSender
  32. {
  33. get
  34. {
  35. return this.applicationSenderField;
  36. }
  37. set
  38. {
  39. this.applicationSenderField = value;
  40. }
  41. }
  42. [System.Xml.Serialization.XmlAttributeAttribute()]
  43. public string WorkstationID
  44. {
  45. get
  46. {
  47. return this.workstationIDField;
  48. }
  49. set
  50. {
  51. this.workstationIDField = value;
  52. }
  53. }
  54. [System.Xml.Serialization.XmlAttributeAttribute()]
  55. public string RequestID
  56. {
  57. get
  58. {
  59. return this.requestIDField;
  60. }
  61. set
  62. {
  63. this.requestIDField = value;
  64. }
  65. }
  66. [System.Xml.Serialization.XmlIgnore()]
  67. public int RequestIDNumber
  68. {
  69. get
  70. {
  71. try
  72. {
  73. return Convert.ToInt32(this.requestIDField);
  74. }
  75. catch(Exception)
  76. {
  77. return 0;
  78. }
  79. }
  80. }
  81. public ServiceRequest()
  82. {
  83. lock (requestIDConterLock)
  84. {
  85. if (requestIDConter < System.Math.Pow(2, 32) - 1)
  86. requestIDConter++;
  87. else
  88. requestIDConter = 1;
  89. RequestID = requestIDConter.ToString();
  90. }
  91. }
  92. }
  93. }