求助:当月份等于1时候执行代码1 当等于2时候执行的代码2一直到12月,求简化这个代码。
Select Case e.DataCol.name
Case "月份"
If e.DataRow.Isnull("月份") = False Then
Dim val As Integer = e.DataRow("月份")
If val = 1 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_1_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 2 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_2_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 3 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_3_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 4 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_4_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 5 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_5_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 6 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_6_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 7 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_7_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 8 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_8_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 9 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_9_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 10 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_10_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 11 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_11_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
If val = 12 Then
Dim Sum As Double
Sum = Tables("销售收入预测表").Compute("Sum(月份_12_月销售额)")
e.DataRow("销售_含流转税销售收入") = sum
Else
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If