Select Case e.DataCol.Name
Case "评定等级"
If e.DataRow.Isnull("单位") OrElse e.DataRow.Isnull("姓名") Then
Messagebox.show("单位或姓名列没输入!","提示")
Return
End If
With Forms("劳动报酬")
If .Opened Then
Dim dt As DataTable = DataTables("劳动报酬")
Dim zc,a,b,c,d As Integer
zc = dt.compute("Count([单位])","姓名 Is Not Null")
.Controls("TextBox1").value = zc
Dim Ls As Integer() ={a,b,c,d}
Dim Ls1 As Integer() ={2,3,4,5}
Dim Ls2 As String() ={"A","B","C","D"}
For i As Integer = 0 To Ls.Length - 1
Ls(i) = dt.compute("Count([单位])","评定等级 = '" & Ls2(i) & "'")
.Controls("TextBox" & Ls1(i)).value = Ls(i)
.Controls("TextBox" & Ls1(i)+4).value = Math.Round(Ls(i)/zc*100,2) & "%"
Next
End If
End With
End Select