老师,我这里有个判断,我用下面的逻辑是可以的。
Select e.DataCol.Name
Case "是否末级科目","一级科目"
If e.DataRow("是否末级科目")= "末级" And e.DataRow.IsNull("一级科目")=False Then
e.DataRow("末级科目名称") = e.DataRow("一级科目")
Else If e.DataRow("是否末级科目")= "末级" And e.DataRow.IsNull("二级科目")=False Then
e.DataRow("末级科目名称") = e.DataRow("二级科目")
Else If e.DataRow("是否末级科目")= "末级" And e.DataRow.IsNull("三级科目")=False Then
e.DataRow("末级科目名称") = e.DataRow("三级科目")
Else If e.DataRow("是否末级科目")= "末级" And e.DataRow.IsNull("四级科目")=False Then
e.DataRow("末级科目名称") = e.DataRow("四级科目")
Else If e.DataRow("是否末级科目")= "末级" And e.DataRow.IsNull("五级科目")=False Then
e.DataRow("末级科目名称") = e.DataRow("五级科目")
End If
End Select
但是如果表变成这样,这个判断就有问题了,应该怎么写的?
就是要把末级对应的科目 准确的 填充到 “末级科目名称” 列