页面不执行第二步 红色部分及以下不执行 麻烦老师们看看是哪里有问题
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim PageNumber As Integer = e.Ge tValues("page")
Dim PrimaryKey As Integer = e.Get Values("key")
Dim PageURL = "getxuexiList.htm? page=" & Pag eNumber & "&key=" & PrimaryKey
Dim dr As DataRow = DataTables("学习内容列表").SQL Find("[_Identify]=" & PrimaryKey)
Dim st As New Date(1970,1,1,8,0,0)
Dim d As Date = cdate("2020-02-01")
Dim t As Long = (Date.Now - st).TotalSeconds()
Dim bianhao As String= Date.Today & "(" & t & ")"
If e.PostValues.Count = 0 Then '生成编辑页面
If dr IsNot Nothing Then
wb.AddPageTitle("","ph1","在线学习系统","瓮安县检察院【党建综合系统】")
wb.AddForm("","form1","getxuexilist.htm?key=" & PrimaryKey & "&page=" & PageNumber)
With wb.AddInputGroup("form1","ipg1","课程信息【" & e.Cookies("姓名") & "】开始学习时间:" & Date.Now())
.AddInput("学习编号","学习编号","text").Value = dt22("学习编号")
.AddInput("学习要求","学习要求","Text").Value="做好自学笔记,以备检查!"
With wb.AddInputGroup("form1","ipg2","学习内容")
With .AddTextArea("bz",15)
.Readonly=True
.Value= dt22("内容")
End With
End With
'.AddInput("单位名称","单位名称","text").Value = dr("单位名称")
.AddHiddenValue("开始时间",Date.Now())
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit")
End With
wb.AppendHTML("<scr ipt src='./lib/ajaxform.js'></script>",True)
wb.AppendHTML("<scri pt>document.getEleme ntById('btn1').disabled=true;document.getElemen tById('btn1').style.backgroundColor = '#b2b2b2';var cnt = 60;setTimeout(countDown,1000);</script>")
e.WriteString(wb.Build) '生成网页
End If
MessageBox.Show(1)
Else
MessageBox.Show(2)
Dim tp As TimeSpan
Dim kaishi As Date=e.PostValues("开始时间")
Dim jieshu As Date=Date.now
tp = jieshu-kaishi
MessageBox.Show(tp.TotalMinutes) '真正的时段型数据要转换为秒数,才能存入时段列
Dim cmd1 As New SQLCo mmand
cmd1.Connec tio nName = "智慧党建"
cmd1.Comman dText = "Inse rt In to 在线学习记录 (内容,学习时间,开始时间,学习人员,学习编号,学习时长) Values(?,?,?,?,?,?)"
cmd1.Parameters.Add("@内容", dr("内容"))
cmd1.Parameters.Add("@学习时间", Date.Now())
cmd1.Parameters.Add("@开始时间", kaishi)
cmd1.Parameters.Add("@学习人员", e.Cookies("姓名"))
cmd1.Parameters.Add("@学习编号", bianhao)
cmd1.Parameters.Add("@学习时长", tp.TotalMinutes)
cmd1.ExecuteNonQuery
Dim cmd2 As New SQLCom mand
cmd2.Connect ion Name = "智慧党建"
cmd2.Comm andText = "UPDA TE {学习内容列表} SET 学习标志 = 'true' WHERE 学习人员 = '" & e.Coo kies("姓名") & "'"
cmd2.ExecuteNonQuery()
With wb.AddButtonGroup("form1","btg1",True) '生成成功提示页
.Add("btn1","继续学习","button","getxuexiList.htm?page=" & PageNumber )
End With
e.WriteString(wb.Build)
End If
[此贴子已经被作者于2020/6/4 11:56:33编辑过]