以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  只对窗口副表table中数据进行重置,而不是对datatable进行重置  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=107827)

--  作者:有点甜
--  发布时间:2017/10/11 8:49:00
--  
Dim t As Table = Tables("表A")
For i As Integer = t.rows.count-1 To 0 Step -1
    t.rows(i).Reject
Next

--  作者:有点甜
--  发布时间:2017/10/11 11:49:00
--  
Dim t As Table = e.form.controls("Table1").Table
For i As Integer = t.rows.count-1 To 0 Step -1
    t.rows(i).Reject
Next

--  作者:有点甜
--  发布时间:2017/10/11 14:51:00
--  
Dim t As Table = e.form.controls("Table1").Table
For i As Integer = t.rows.count-1 To 0 Step -1
    t.DataTable.DataCols("第一列").RaiseDataColChanged(t.rows(i).DataRow)
Next

--  作者:有点甜
--  发布时间:2017/11/24 9:27:00
--  
Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
    Case "费用计算式","费率"
        If e.DataRow.IsNull("费用计算式") = False Then
            Dim str As String = e.DataRow("费用计算式")
            Dim pattern As String = "{.+?}"
            Dim rgx = new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
            For Each  match As System.Text.RegularExpressions.Match In rgx.Matches(str)
                dr = e.DataTable.Find("序号 = \'" & match.Value.trim("{","}") & "\' and 专业编号 = \'" & dr("专业编号") & "\'")
                If dr IsNot Nothing Then
                    If dr.IsNull("费用计算式") = False Then
                        e.DataTable.DataCols("费用计算式").RaiseDataColChanged(dr)
                    End If
                    str = str.replace(match.Value, dr("金额"))
                End If
            Next
            pattern = "\\[\\.+?\\]"
            rgx = new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
            For Each  match As System.Text.RegularExpressions.Match In rgx.Matches(str)
                str = str.replace(match.Value, e.DataRow(match.Value.trim("[","]")))
            Next
            If TryEval(str, e.DataRow) Then
                e.DataRow("金额") = Eval2(str,e.DataRow)
            Else
                msgbox("计算公式有错误,请核对!")
            End If
        End If
End Select