以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  求助:  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=72539)

--  作者:yancheng
--  发布时间:2015/7/31 17:56:00
--  求助:
Dim drs As List (of DataRow) = DataTables("机具进货").Select("机具编号 = \'" & e.DataRow("机具编号") & "\' ")
If drs.Count > 0 Then
    Dim result As DialogResult = MessageBox.Show("此机具已被机具进货录入,是否删除对应机具进货明细后再删除本条机具?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
    If result = dialogresult.no Then
        e.Cancel = True
    Else
        e.Cancel = True
        Forms("机具订单").show
        Dim filter As String = ""
        For Each dr As DataRow In drs

图片点击可在新窗口打开查看此主题相关图片如下:2.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:3.png
图片点击可在新窗口打开查看
            filter &= " 进货批次= \'" & dr("进货批次") & "\'"
图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看
        Next
        Tables("机具订单").Filter = filter
        Tables("机具订单").Sort = "进货日期 desc"
    End If
ElseIf drs.Count = 0 Then
    If MessageBox.Show("是否删除本条机具?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.yes Then
    Else
        e.Cancel = True
    End If
End If

--  作者:yancheng
--  发布时间:2015/7/31 17:56:00
--  
Dim drs As List (of DataRow) = DataTables("机具进货").Select("机具编号 = \'" & e.DataRow("机具编号") & "\' ")
If drs.Count > 0 Then
    Dim result As DialogResult = MessageBox.Show("此机具已被机具进货录入,是否删除对应机具进货明细后再删除本条机具?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
    If result = dialogresult.no Then
        e.Cancel = True
    Else
        e.Cancel = True
        Forms("机具订单").show
        Dim filter As String = ""
        For Each dr As DataRow In drs
            filter &= " 进货批次= \'" & dr("进货批次") & "\'"
        Next
        Tables("机具订单").Filter = filter
图片点击可在新窗口打开查看此主题相关图片如下:4.png
图片点击可在新窗口打开查看
        Tables("机具订单").Sort = "进货日期 desc"
    End If
ElseIf drs.Count = 0 Then
    If MessageBox.Show("是否删除本条机具?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.yes Then
    Else
        e.Cancel = True
    End If
End If

--  作者:大红袍
--  发布时间:2015/7/31 17:58:00
--  

Dim filter As String = ""
For Each dr As DataRow In drs
    filter &= " or 进货批次 = \'" & dr("进货批次") & "\'"
Next
if filter > "" then
    Tables("采购订单").Filter = filter.SubString(3)
Else
    Tables("采购订单").Filter = ""
End If

 

------------或者

 

Dim filter As String = "1=2"
For Each dr As DataRow In drs
    filter &= " or 进货批次 = \'" & dr("进货批次") & "\'"
Next
Tables("采购订单").Filter = filter