Dim s As String = e.Form.Controls("Label13").Text
Dim t1 As Table = e.Form.Controls("Table8").Table
Select s
Case "本周计划"
s = "上周计划"
t1.Filter = "年份 = '" & vars("year") & "'And sys_weekofyear = " & DatePart("ww",Date.Today.AddDays(- 7))
Case "上周计划"
s = "第" & Format(DatePart("ww",Date.Today.AddDays(- 14)),"00") & "周计划"
t1.Filter = "年份 = '" & vars("year") & "'And sys_weekofyear = " & DatePart("ww",Date.Today.AddDays(- 14))
Case "下周计划"
s = "本周计划"
t1.Filter = "年份 = '" & vars("year") & "'And sys_weekofyear = " & DatePart("ww",Date.Today)
Case Else
Dim i As String = s.SubString(s.IndexOf("第") + 1,s.IndexOf("周") - s.IndexOf("第") - 1)
If Val(i) = DatePart("ww",Date.Today) + 1 Then
s = "本周计划"
t1.Filter = "年份 = '" & vars("year") & "'And sys_weekofyear = " & DatePart("ww",Date.Today)
ElseIf Val(i) = DatePart("ww",Date.Today) + 2 Then
s = "下周计划"
t1.Filter = "年份 = '" & vars("year") & "'And sys_weekofyear = " & DatePart("ww",Date.Today.AddDays(7))
Else
Dim temp As Integer = val(i-1)
If temp = 0 Then
vars("year") -= 1
temp = t1.DataTable.compute("max(sys_weekofyear)", "年份 = '" & vars("year") & "'")
End If
s = s.Replace(i,Format(temp,"00"))
t1.Filter = "年份 = '" & vars("year") & "'And sys_weekofyear = " & temp
End If
End Select
e.Form.Controls("Label13").Text = s