Guest User

Untitled

a guest
Feb 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. Public Overrides Sub PrepareCalculatedFields(ByVal FormulaName As String)
  2. Select Case FormulaName
  3. Case "Batch_Detail_Vendor_Name"
  4. MyBase.AddTable("xiBatch_Detail")
  5. MyBase.AddField("Batch_Detail_Vendor_Name = xiBatch_Detail.Vendor_Name")
  6.  
  7. Case "TransErr_Transaction_Amt"
  8. MyBase.AddTable("xiBatch_Detail")
  9. MyBase.AddField("TransErr_Transaction_Amt = xiBatch_Detail.Transaction_Amt")
  10.  
  11. Case "Vendor_Number"
  12. MyBase.AddTable("xiVendor_Detail")
  13. MyBase.AddField("Vendor_Number = Vendor_Number + '-' + Mail_Code")
  14.  
  15. Case "Vendor_Detail_Vendor_Name"
  16. MyBase.AddTable("xiVendor_Detail")
  17. MyBase.AddField("Vendor_Detail_Vendor_Name = xiVendor_Detail.Vendor_Name")
  18.  
  19. Case "Address"
  20. MyBase.AddTable("xiVendor_Detail")
  21. MyBase.AddField("Address = CASE " & _
  22. "WHEN Address_Line_1 IS NULL THEN NULL " & _
  23. "WHEN Address_Line_1 = '' THEN NULL " & _
  24. "ELSE RTRIM(Address_Line_1 + ' ' + " & _
  25. "ISNULL(Address_Line_2, '') + ' ' + " & _
  26. "ISNULL(Address_Line_3, '')) + ', ' + " & _
  27. "ISNULL(City, '') + ', ' + " & _
  28. "ISNULL(State, '') + ' ' + " & _
  29. "ISNULL(Zip_Code, '') + " & _
  30. "CASE " & _
  31. "WHEN Zip_Code_Ext IS NULL THEN '' " & _
  32. "ELSE ' ' + Zip_Code_Ext " & _
  33. "END + ' ' + " & _
  34. "ISNULL(Country, '')" & _
  35. "END")
  36.  
  37. Case "Warrant_Vendor_Name"
  38. MyBase.AddTable("xiWarrant")
  39. MyBase.AddField("Warrant_Vendor_Name = xiWarrant.Vendor_Name")
  40.  
  41. Case "Counselor_Contact_Info"
  42. MyBase.AddTable("buStaff_Location_Assign")
  43. MyBase.AddField("Counselor_Contact_Info = RTRIM(xiBatch_Detail.Staff_Issued_Last_Name) + ', ' + RTRIM(xiBatch_Detail.Staff_Issued_First_Name) + RTRIM(' ' + xiBatch_Detail.Staff_Issued_Middle_Initial) + '<br/>' + RTRIM(buStaff_Location_Assign.Staff_Prime_Phone_Number)")
  44.  
  45. Case "Auth_No_Legacy_Code_Display"
  46. MyBase.AddTable("xiBatch_Detail")
  47. MyBase.AddField("Auth_No_Legacy_Code_Display = " & _
  48. "RTRIM(ISNULL(CAST(xiBatch_Detail.Auth_Header_ID as nvarchar(50)),'')) + ' ' + " & _
  49. "CASE " & _
  50. "WHEN xiBatch_Detail.Auth_Header_Legacy_Code IS NULL THEN '' " & _
  51. "WHEN xiBatch_Detail.Auth_Header_Legacy_Code = '' THEN '' " & _
  52. "ELSE ' (' + xiBatch_Detail.Auth_Header_Legacy_Code + ')' " & _
  53. "END")
  54.  
  55. Case "Batch_Num_Display"
  56. MyBase.AddTable("xiBatch_Header")
  57. MyBase.AddField("Batch_Num_Display = " & _
  58. "CASE " & _
  59. "WHEN xiBatch_Header.Batch_Num IS NOT NULL THEN " & _
  60. "CONVERT(VARCHAR,xiBatch_Header.Batch_Num) + ' ' " & _
  61. "ELSE '' " & _
  62. "END + " & _
  63. "CASE " & _
  64. "WHEN xiBatch_Detail.Internal_Batch_Num IS NOT NULL " & _
  65. "AND LTRIM(xiBatch_Detail.Internal_Batch_Num) <> '' THEN " & _
  66. "CASE " & _
  67. "WHEN xiBatch_Header.Batch_Num IS NOT NULL THEN " & _
  68. "'<BR>' " & _
  69. "ELSE '' " & _
  70. "END + '(' + xiBatch_Detail.Internal_Batch_Num + ')' " & _
  71. "ELSE '' " & _
  72. "END")
  73.  
  74. Case "Auth_Detail_Line_Num"
  75. MyBase.AddTable("xiBatch_Detail")
  76. MyBase.AddField("Auth_Detail_Line_Num = CAST(Auth_Detail_Line_Num AS VARCHAR(4))")
  77. End Select
  78. End Sub
Add Comment
Please, Sign In to add comment