【发布时间】:2015-02-20 07:50:09
【问题描述】:
有人可以帮我使用这个函数吗?这个函数的目的应该是从数据库中获取值并更改名称,如
存款,提款,手动余额更正,现金更正,HighRoller存款更正,HighRoller提款更正,玩家到玩家发送,玩家到玩家接收,现金兑现存款,现金兑现提款,小费存款,小费提款。数据库中的原始表是
Id Name IsCredit
1 Deposit 0
2. Withdrawal 0
3. Manual Balance Correction 0
4. Cash Correction 0
5. HighRoller Correction 0 or 1
6. Player To Player 0 or 1
7. Cash In Cash Out 0 or 1
15. Tip 0 or 1
Function GetTransactionTypeName(ByVal key As Integer, ByVal isCredit As Boolean) As String
Dim keys As Integer() = {1,2,3,4,5,6,7,15}
Dim names As String() = {"Deposit", "Withdrawal", "Manual Balance Correction", "Cash Correction", "High Roller {0} Correction", _
"Player To Player {0}", "Cash In Cash Out {0}", "Tip {0}"}
Dim indx As Integer
For indx = 0 To Ubound(keys)
If keys(indx) = key Then
Exit For
End If
Next
If indx >= Ubound(names) Then
Return key
End If
If key=7 Or key=5 Or Key=6 or Key=15 Then
If isCredit Then
If key=7 Or key=5 Or key=15
Return [String].Format(names(indx) ," Deposit")
End If
If key=6
Return [String].Format(names(indx) ," Recieve")
End If
Else
If key=7 Or key=5 or key=15
Return [String].Format(names(indx) ," Withdrawal")
End If
If key=6
Return [String].Format(names(indx) ," Send")
End If
End If
End If
Return names(indx)
End Function
【问题讨论】:
-
请在您的问题中添加更多详细信息:代码到底应该做什么?它目前在做什么?您认为代码的哪一部分可能是问题所在?请修正代码的格式。
标签: sql-server vba reporting-services