Dim ary() As String = {"检查","切边","自动切边","磁检","套弹簧","封油脂","组装","防锈包装","称油脂","返工"} Select Case e.DataCol.Name Case "型号" If e.NewValue = Nothing Then e.DataRow("作业标准") = Nothing e.DataRow("能力") = Nothing Else e.DataTable.DataCols("检查").RaiseDataColChanged(e.DataRow) End If Case Else If array.IndexOf(ary, e.DataCol.Name) > -1 Then Dim filter As String = "1=1" For Each a As String In ary If e.DataRow.IsNull(a) OrElse e.DataRow(a) = False Then filter &= " and " & a & " Is null" Else filter &= " and " & a & " = '*'" End If Next Dim fdr As DataRow = DataTables("工序标准").Find(filter) If fdr IsNot Nothing Then e.DataRow("作业标准") = fdr("标准工序") If DataTables("标准能力").DataCols.Contains(fdr("标准工序")) Then filter = "型号 = '" & e.DataRow("型号") & "'" fdr = DataTables("标准能力").Find(filter) If fdr IsNot Nothing Then e.DataRow("能力") = val(fdr(e.DataRow("作业标准"))) Else e.DataRow("能力") = Nothing End If Else e.DataRow("能力") = Nothing End If Else e.DataRow("作业标准") = Nothing e.DataRow("能力") = Nothing End If End If End Select
|