Foxtable(狐表)用户栏目专家坐堂 → 如何实现 类别的包含关系 如果包含 就不显示被包含的内容


  共有2945人关注过本帖平板打印复制链接

主题:如何实现 类别的包含关系 如果包含 就不显示被包含的内容

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


加好友 发短信
等级:七尾狐 帖子:1571 积分:11238 威望:0 精华:0 注册:2021/1/17 17:06:00
如何实现 类别的包含关系 如果包含 就不显示被包含的内容  发帖心情 Post By:2022/3/14 5:37:00 [只看该作者]


    
    
    Dim bb01 As DataRow = DataTables("说明与报告").sqlfind("身份证号='"& e.DataRow("身份证号") &"'and 类别='党纪处分'")
    Dim bb21 As Integer =DataTables("说明与报告").sqlCompute("count(身份证号)","身份证号='"& e.DataRow("身份证号") &"'and 类别='党纪处分'")
    Dim bb11 As String
    If bb01 IsNot Nothing Then
        bb11="受到党纪处分" & bb21 & "次?"
    Else
        bb11="未受党纪处分?"
    End If
   
    Dim bb02 As DataRow = DataTables("说明与报告").sqlfind("身份证号='"& e.DataRow("身份证号") &"'and 类别='政纪处分'")
    Dim bb22 As Integer =DataTables("说明与报告").sqlCompute("count(身份证号)","身份证号='"& e.DataRow("身份证号") &"'and 类别='政纪处分'")
    Dim bb12 As String
    If bb02 IsNot Nothing Then
        bb12="受到政纪处分" & bb22 & "次?"
    Else
        bb12="未受政纪处分?"
    End If
   
   
    Dim bb03 As DataRow = DataTables("说明与报告").sqlfind("身份证号='"& e.DataRow("身份证号") &"'and 类别='政务处分'")
    Dim bb33 As Integer =DataTables("说明与报告").sqlCompute("count(身份证号)","身份证号='"& e.DataRow("身份证号") &"'and 类别='政务处分'")
    Dim bb13 As String
    If bb03 IsNot Nothing Then
        bb13="受到政务处分" & bb33 & "次?"
    Else
        bb13="未受政务处分?"
    End If
   
    Dim bb04 As DataRow = DataTables("说明与报告").sqlfind("身份证号='"& e.DataRow("身份证号") &"'and 类别='党纪政纪处分'")
    Dim bb44 As Integer =DataTables("说明与报告").sqlCompute("count(身份证号)","身份证号='"& e.DataRow("身份证号") &"'and 类别='党纪政纪处分'")
    Dim bb14 As String
    If bb04 IsNot Nothing Then
        bb14="受到党纪政纪处分" & bb44 & "次?"
    Else
        bb14="未受党纪政纪处分?"
    End If
   
   
    Dim bb05 As DataRow = DataTables("说明与报告").sqlfind("身份证号='"& e.DataRow("身份证号") &"'and 类别='党纪政纪政务处分'")
    Dim bb55 As Integer =DataTables("说明与报告").sqlCompute("count(身份证号)","身份证号='"& e.DataRow("身份证号") &"'and 类别='党纪政纪政务处分'")
    Dim bb15 As String
    If bb05 IsNot Nothing Then
        bb15="受到党纪政纪政务处分" & bb55 & "次?"
    Else
        bb15="未受党纪政纪政务处分?"
    End If
   
   
   
    e.DataRow("回复内容")= bb11 & bb12 & bb13 & bb14 & bb15
   

 

如何实现   通过上述代码  对应的去查找表中符合条件的数据  并sqlCompute大于0 

 

当以下都没有的时候   就提示 未受党纪政纪政务处分

当以下有其中一个的时候  就提示对应的处分 类别

党纪政纪政务处分

党纪政纪处分

党纪政务处分

政纪政务处分

党纪处分

政务处分

政纪处分

 

下述代码只能实现当前类别找不到的时候,都只显示”未受党纪政纪政务处分“,如果类别=政务处分, 就应该显示受政务处分  未受党纪处分 未受政纪处分

        Dim Products As List(Of String)
        Products = DataTables("代码表").GetValues("内容","代码='处分种类'")
        For Each Product As String In Products          
            Dim bb01 As DataRow = DataTables("说明与报告").sqlfind("身份证号='"& e.DataRow("身份证号") &"'and 类别='"& Product &"'")
            Dim bb21 As Integer =DataTables("说明与报告").sqlCompute("count(身份证号)","身份证号='"& e.DataRow("身份证号") &"'and 类别='"& Product &"'")
            Dim bb11 As String
            If bb01 IsNot Nothing Then
                bb11=bb01("时间") &"受" & Product & bb21 & "次、"
            Else
                bb11="未受党纪政纪政务处分、"
            End If

            bb11 &= bb11
        Next

 

[此贴子已经被作者于2022/3/14 6:40:30编辑过]

 回到顶部