Dim c1 As String = Forms("测试窗口").Controls("TextBox29" ).Value
Dim df1 As String = Forms("测试窗口").Controls("TextBox19" ).Value
Dim D1 As String = Forms("测试窗口").Controls("TextBox9" ).Value
Dim t1 As String = Forms("测试窗口").Controls("TextBox8" ).Value
Dim bh As String = Forms("测试窗口").Controls("TextBox39").Value
Dim wz As Integer = Tables("项目测试数据看板").FindRow("项目编号 = '" & bh & "'")
Dim ary1() As String = {"C", "D1","T","F","D2","L","BDV"}
Dim str As String = ""
For i As Integer = 0 To ary1.length-1
If ary1(i) = "C" And Tables("项目测试数据看板").Current("C")=False Then
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "u pdate {测试数据库} set [C] ='"& c1 &"',[DF]='"& df1 &"' where 项目编号 = '" & bh & "' and 样本编号 =1"
cmd1.ExecuteNonQuery
cmd1.CommandText = "u pdate {项目测试数据看板} set [C] =1 where 项目编号 = '" & bh & "' "
cmd1.ExecuteNonQuery
Else If ary1(i) = "D1" And Tables("项目测试数据看板").Current("D1")=0 Then
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "u pdate {测试数据库} set [D1] ='"& D1 &"' where 项目编号 = '" & bh & "' and 样本编号 =1"
cmd1.ExecuteNonQuery
cmd1.CommandText = "u pdate {项目测试数据看板} set [D1] =1 where 项目编号 = '" & bh & "' "
cmd1.ExecuteNonQuery
Else If ary1(i) = "T" And Tables("项目测试数据看板").Current("T")=0 Then
Dim cmd1 As New SQLCommand
cmd1.C
cmd1.CommandText = "u pdate {测试数据库} set [T] ='"& t1 &"' where 项目编号 = '" & bh & "' and 样本编号 =1"
cmd1.ExecuteNonQuery
cmd1.CommandText = "u pdate {项目测试数据看板} set [T] =1 where 项目编号 = '" & bh & "' "
cmd1.ExecuteNonQuery
Else
MessageBox.Show("已结案,不能再次操作!")
Return
End If
Next
老师,如上,如果其中比如D1我单独反结案又变回了0,此时再点击,跳出的是"已结案,不能再次操作!",如何能做到点击后单独把D1变为1
想法是点击后如果是0的就全部变为1,是1的就跳已结案
[此贴子已经被作者于2018/5/21 16:50:31编辑过]