Case "wf_bz_kbcqb"
Dim dr As DataRow = DataTables("pkl2").Find("part_no = '" & e.DataRow("part_no") & "' And sheet_sta = '未审核'")
If dr IsNot Nothing Then
dr("kbcc_k")= e.DataRow("wf_bz_kbcqb")
End If
Case "wf_bz_kbcc"
Dim dr As DataRow = DataTables("pkl2").Find("part_no = '" & e.DataRow("part_no") & "' And sheet_sta = '未审核'")
If dr IsNot Nothing Then
dr("kbcc_g")= e.DataRow("wf_bz_kbcc")
End If
Case "产品编码"
Dim dr As DataRow
dr = DataTables("osal_ord2").Find("part_no = '" & e.DataRow("part_no") & "'")
If dr IsNot Nothing Then
e.DataRow("订单ID")=dr("id")
End If
Case "act_sw"
If e.DataRow.IsNull("act_sw") Or e.DataRow("act_sw") = False Then
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "UPDATE {obas_part} SET [act_sw] = 1 Where [part_no] = '" & e.DataRow("part_no") & "'"
cmd1.ExecuteNonQuery()
Dim cmd2 As New SQLCommand
cmd2.C
cmd2.CommandText = "UPDATE {cpcbsj} SET [sheet_sta] = '未审核' Where [part_no] = '" & e.DataRow("part_no") & "'"
cmd2.ExecuteNonQuery()
ElseIf e.DataRow("act_sw") = True Then
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "UPDATE {obas_part} SET [act_sw] = 0 Where [part_no] = '" & e.DataRow("part_no") & "'"
cmd1.ExecuteNonQuery()
Dim cmd2 As New SQLCommand
cmd2.C
cmd2.CommandText = "UPDATE {cpcbsj} SET [sheet_sta] = '已失效' Where [part_no] = '" & e.DataRow("part_no") & "'"
cmd2.ExecuteNonQuery()
End If
Case "leadtime"
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "UPDATE {obas_part1} SET [pur_leadtime] = " & e.DataRow("leadtime") & " Where [part_no] = '" & e.DataRow("part_no") & "'"
cmd1.ExecuteNonQuery()
Case "invodw"
Dim dr As DataRow
dr = DataTables("Invoice2").Find("part_no = '" & e.DataRow("part_no") & "'")
If dr IsNot Nothing Then
dr("invodw") = e.DataRow("invodw")
Else
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "UPDATE {Invoice2} SET [invodw] = '" & e.DataRow("invodw") & "' Where [part_no] = '" & e.DataRow("part_no") & "'and [sheet_sta] = '未审核'"
cmd1.ExecuteNonQuery()
End If
Case "pakdw"
Dim dr As DataRow
dr = DataTables("pkl2").Find("part_no = '" & e.DataRow("part_no") & "'")
If dr IsNot Nothing Then
dr("pakdw") = e.DataRow("pakdw")
Else
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "UPDATE {pkl2} SET [pakdw] = '" & e.DataRow("pakdw") & "' Where [part_no] = '" & e.DataRow("part_no") & "'and [sheet_sta] = '未审核'"
cmd1.ExecuteNonQuery()
End If
Case "ktxh"
Dim dr As DataRow
dr = DataTables("pkl2").Find("part_no = '" & e.DataRow("part_no") & "'")
If dr IsNot Nothing Then
dr("ktxh") = e.DataRow("ktxh")
Else
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "UPDATE {pkl2} SET [ktxh] = '" & e.DataRow("ktxh") & "' Where [part_no] = '" & e.DataRow("part_no") & "'and [sheet_sta] = '未审核'"
cmd1.ExecuteNonQuery()
End If
Case "nfdh"
Dim dr As DataRow
dr = DataTables("pkl2").Find("part_no = '" & e.DataRow("part_no") & "'")
If dr IsNot Nothing Then
dr("nfdh") = e.DataRow("nfdh")
Else
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "UPDATE {pkl2} SET [nfdh] = '" & e.DataRow("nfdh") & "' Where [part_no] = '" & e.DataRow("part_no") & "'and [sheet_sta] = '未审核'"
cmd1.ExecuteNonQuery()
End If
Case Else
e.DataRow("update_date")=Date.Now
e.DataRow("update_user")=Vars("_UserName")
End Select