ServiceRequest.cs 2.4 KB

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