If e.DataCol.Name = "一级明细" OrElse e.DataCol.Name = "二级明细" Then Dim dr As DataRow = e.DataRow Dim filter As String = "1=1" If dr.IsNull("一级明细") = False Then filter &= " and [目录类别] = '" & dr("一级明细") & "'" Else filter &= " and [目录类别] is null" End If If dr.IsNull("二级明细") = False Then filter &= " and [目录名称] = '" & dr("二级明细") & "'" Else filter &= " and [目录名称] is null" End If Dim sr As DataRow sr = DataTables("目录树").SQLFind(filter) '在后台查找符合条件的行 If sr IsNot Nothing Then '如果找到了符合条件的行 dr("规格") = sr("规格型号") dr("单位") = sr("单位") Else dr("规格") = Nothing dr("单位") = Nothing End If End If
|