我要统计员工出勤和工作内容,下表所提的周运维和月运维等是员工直接提交的表格,在表格统计行,如果提交工作内容为周运维,则周运维列自动等于;感觉这代码可以实现功能,但是太繁琐;有改进的可能吗?小白一枚,请谅解!
Select Case e.DataCol.Name
Case "站点任务"
Dim dr As DataRow = e.DataRow
If e.DataRow ("站点任务") = "周运维" Then
dr ("周运维") = 1
Else
dr ("周运维") = Nothing
End If
If e.DataRow("站点任务") = "月运维" Then
dr ("月运维") = 1
Else
dr ("月运维") = Nothing
End If
If e.DataRow ("站点任务") = "季度运维" Then
dr ("季度运维") = 1
Else
dr ("季度运维") = Nothing
End If
If e.DataRow ("站点任务") = "设备故障维修" Then
dr ("设备故障维修") = 1
Else
dr ("设备故障维修") = Nothing
End If
If e.DataRow ("站点任务") = "质控考核" Then
dr ("质控考核") = 1
Else
dr ("质控考核") = Nothing
End If
If e.DataRow ("站点任务") = "站点安装" Then
dr ("站点安装") = 1
Else
dr ("站点安装") = Nothing
End If
If e.DataRow ("站点任务") = "站点调试" Then
dr ("站点调试") = 1
Else
dr ("站点调试") = Nothing
End If
If e.DataRow ("站点任务") = "年度巡检" Then
dr ("年度巡检") = 1
Else
dr ("年度巡检") = Nothing
End If
If e.DataRow ("站点任务") = "配合环保例行检查" Then
dr ("配合环保例行检查") = 1
Else
dr ("配合环保例行检查") = Nothing
End If
If e.DataRow ("站点任务") = "其他" Then
dr ("其他") = 1
Else
dr ("其他") = Nothing
End If
End Select