Conversie van de TransSmart solution van BizTalk 2013 naar 2016.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

TM.Shared.OrderStatus_to_TM.EDIBroker.TransSmart.Status.btm.cs 7.5KB

4 недель назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. namespace TM.EDIBroker.TransSmart.Transforms {
  2. [Microsoft.XLANGs.BaseTypes.SchemaReference(@"TM.Shared.Schemas.OrderStatus", typeof(global::TM.Shared.Schemas.OrderStatus))]
  3. [Microsoft.XLANGs.BaseTypes.SchemaReference(@"TM.EDIBroker.TransSmart.Schemas.Status", typeof(global::TM.EDIBroker.TransSmart.Schemas.Status))]
  4. public sealed class TM_Shared_OrderStatus_to_TM_EDIBroker_TransSmart_Status : global::Microsoft.XLANGs.BaseTypes.TransformBase {
  5. private const string _strMap = @"<xsl:stylesheet xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" version=""1.0""
  6. xmlns:ScriptNS0=""http://schemas.microsoft.com/BizTalk/2003/ScriptNS0""
  7. xmlns:ScriptNS1=""http://schemas.microsoft.com/BizTalk/2003/ScriptNS1""
  8. xmlns:DateTime=""TM.Shared.Components.DateTime""
  9. xmlns:SSO=""TM.Shared.Components.SSO""
  10. xmlns:String=""TM.Shared.Components.String""
  11. xmlns:s0=""http://TM.KLG.com/KLG/OrderStatus""
  12. xmlns:ns0=""http://TM.EDIBroker.TransSmart.Status""
  13. exclude-result-prefixes=""s0 ns0 ScriptNS0 ScriptNS1 DateTime SSO String"">
  14. <xsl:output omit-xml-declaration=""yes"" method=""xml"" version=""1.0"" indent=""yes"" />
  15. <!-- region global variable initialization -->
  16. <xsl:variable name=""connectionString"" select=""SSO:GetValue('TM.EDIBroker.TransSmart', 'ESBLookupConnectionString')""/>
  17. <!-- end region -->
  18. <!-- region templates -->
  19. <xsl:template match=""/"">
  20. <xsl:apply-templates select=""/s0:StatusReport"" />
  21. </xsl:template>
  22. <xsl:template match=""/s0:StatusReport"">
  23. <xsl:variable name=""currentDateTime"" select=""DateTime:GetCurrentDateTime()"" />
  24. <xsl:variable name=""currentDate"" select=""DateTime:GetCurrentDate()"" />
  25. <ns0:root>
  26. <xsl:for-each select=""Status"">
  27. <status carrier=""KLG"">
  28. <shipment>
  29. <statusTimeStamp>
  30. <xsl:value-of select=""DateTime:FormatDateTime(StatusTimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'yyyyMMddHHmm')""/>
  31. </statusTimeStamp>
  32. <reference>
  33. <xsl:value-of select=""ShipmentReference""/>
  34. </reference>
  35. <NoPieces>
  36. <xsl:text />
  37. </NoPieces>
  38. <weight>
  39. <xsl:text />
  40. </weight>
  41. <weightUom>
  42. <xsl:text />
  43. </weightUom>
  44. <incoterms>
  45. <xsl:text />
  46. </incoterms>
  47. <statusPrice>
  48. <xsl:text />
  49. </statusPrice>
  50. <currency>
  51. <xsl:text />
  52. </currency>
  53. <xsl:choose>
  54. <xsl:when test=""StatusCode = '012'"">
  55. <deliveryDate>
  56. <xsl:value-of select=""DateTime:FormatDateTime(StatusTimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'yyyyMMdd')""/>
  57. </deliveryDate>
  58. <deliveryTime>
  59. <xsl:value-of select=""DateTime:FormatDateTime(StatusTimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'HHmm')""/>
  60. </deliveryTime>
  61. </xsl:when>
  62. <xsl:otherwise>
  63. <deliveryDate>
  64. <xsl:text />
  65. </deliveryDate>
  66. <deliveryTime>
  67. <xsl:text />
  68. </deliveryTime>
  69. </xsl:otherwise>
  70. </xsl:choose>
  71. <acceptedBy>
  72. <xsl:text />
  73. </acceptedBy>
  74. <xsl:choose>
  75. <xsl:when test=""StatusCode = '020'"">
  76. <pickupDate>
  77. <xsl:value-of select=""DateTime:FormatDateTime(StatusTimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'yyyyMMdd')""/>
  78. </pickupDate>
  79. </xsl:when>
  80. <xsl:otherwise>
  81. <pickupDate>
  82. <xsl:text />
  83. </pickupDate>
  84. </xsl:otherwise>
  85. </xsl:choose>
  86. <xsl:choose>
  87. <xsl:when test=""StatusCode = '012'"">
  88. <shipmentStatus>DONE</shipmentStatus>
  89. </xsl:when>
  90. <xsl:otherwise>
  91. <shipmentStatus>TRNS</shipmentStatus>
  92. </xsl:otherwise>
  93. </xsl:choose>
  94. <carrierStatusCode>
  95. <xsl:value-of select=""StatusCode""/>
  96. </carrierStatusCode>
  97. <carrierStatusDescription>
  98. <xsl:value-of select=""StatusCodeLookup""/>
  99. </carrierStatusDescription>
  100. </shipment>
  101. </status>
  102. </xsl:for-each>
  103. </ns0:root>
  104. </xsl:template>
  105. <!-- end region -->
  106. <xsl:variable name=""dbClose"" select=""ScriptNS0:DBLookupShutdown()""/>
  107. </xsl:stylesheet>
  108. ";
  109. private const string _strArgList = @"<ExtensionObjects>
  110. <ExtensionObject Namespace=""http://schemas.microsoft.com/BizTalk/2003/ScriptNS0""
  111. AssemblyName=""Microsoft.BizTalk.BaseFunctoids, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35""
  112. ClassName=""Microsoft.BizTalk.BaseFunctoids.FunctoidScripts"" />
  113. <ExtensionObject Namespace=""http://schemas.microsoft.com/BizTalk/2003/ScriptNS1""
  114. AssemblyName=""Microsoft.BizTalk.CrossReferencing, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35""
  115. ClassName=""Microsoft.BizTalk.CrossReferencing.CrossReferencing"" />
  116. <ExtensionObject Namespace=""TM.Shared.Components.DateTime""
  117. AssemblyName=""TM.Shared.Components, Version=1.0.7.0, Culture=neutral, PublicKeyToken=9cbf569b151cb1d4""
  118. ClassName=""TM.Shared.Components.DateTimeFunctions"" />
  119. <ExtensionObject Namespace=""TM.Shared.Components.KeyList""
  120. AssemblyName=""TM.Shared.Components, Version=1.0.7.0, Culture=neutral, PublicKeyToken=9cbf569b151cb1d4""
  121. ClassName=""TM.Shared.Components.KeyListFunctions"" />
  122. <ExtensionObject Namespace=""TM.Shared.Components.SSO""
  123. AssemblyName=""TM.Shared.Components, Version=1.0.7.0, Culture=neutral, PublicKeyToken=9cbf569b151cb1d4""
  124. ClassName=""TM.Shared.Components.SSOFunctions"" />
  125. <ExtensionObject Namespace=""TM.Shared.Components.String""
  126. AssemblyName=""TM.Shared.Components, Version=1.0.7.0, Culture=neutral, PublicKeyToken=9cbf569b151cb1d4""
  127. ClassName=""TM.Shared.Components.StringFunctions"" />
  128. </ExtensionObjects>";
  129. private const string _strSrcSchemasList0 = @"TM.Shared.Schemas.OrderStatus";
  130. private const global::TM.Shared.Schemas.OrderStatus _srcSchemaTypeReference0 = null;
  131. private const string _strTrgSchemasList0 = @"TM.EDIBroker.TransSmart.Schemas.Status";
  132. private const global::TM.EDIBroker.TransSmart.Schemas.Status _trgSchemaTypeReference0 = null;
  133. public override string XmlContent {
  134. get {
  135. return _strMap;
  136. }
  137. }
  138. public override string XsltArgumentListContent {
  139. get {
  140. return _strArgList;
  141. }
  142. }
  143. public override string[] SourceSchemas {
  144. get {
  145. string[] _SrcSchemas = new string [1];
  146. _SrcSchemas[0] = @"TM.Shared.Schemas.OrderStatus";
  147. return _SrcSchemas;
  148. }
  149. }
  150. public override string[] TargetSchemas {
  151. get {
  152. string[] _TrgSchemas = new string [1];
  153. _TrgSchemas[0] = @"TM.EDIBroker.TransSmart.Schemas.Status";
  154. return _TrgSchemas;
  155. }
  156. }
  157. }
  158. }