Foxtable(狐表)用户栏目专家坐堂 → 列出科目详细名称


  共有2075人关注过本帖树形打印复制链接

主题:列出科目详细名称

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106132 积分:539771 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/12/1 11:41:00 [显示全部帖子]

Dim dr1 As DataRow = e.DataRow
Dim str1 As String
Dim st As String
Select Case e.DataCol.Name
case "科目编码","科目名称"
    if  e.DataRow("科目编码").length >= 4
        Dim strr As String = e.DataRow("科目编码").substring(0,4)
        Dim fdr As DataRow = DataTables("科目表").find("科目编码='" & strr & "'")
if fdr isnot nothing then
        st = fdr("科目名称")
end if
        ' MessageBox.Show("4")
elseif e.DataRow("科目编码").length >= 8
        Dim  strr As String = e.DataRow("科目编码").substring(0,8)
        Dim fdr As DataRow = DataTables("科目表").find("科目编码='" & strr & "'")
if fdr isnot nothing then
        st = fdr("科目名称")
        str1 &=  "-"& st
end if
else.............

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106132 积分:539771 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/12/1 12:08:00 [显示全部帖子]

Select Case e.DataCol.Name
    Case "科目编码","科目名称"
        If e.DataRow.IsNull("科目编码") = False
            
            Dim st As String = e.DataRow("科目编码")
            Dim str1 As String = e.DataRow("科目名称")
            Do While st.Length > 4
                st = st.substring(0,st.Length - 4)
                Dim fdr As DataRow = e.DataTable.find("科目编码='" & st & "'")
                If fdr IsNot Nothing Then
                    str1 = fdr("科目名称") & "-" & str1
                End If
            Loop
            e.DataRow("科目详细名称")= str1
        End If
End Select

 回到顶部