Select Case e.Path
Case "AddNew.htm"
If e.PostValues.Count = 0 Then
Dim sb As New StringBuilder
sb.AppendLine("<form action='AddNew.htm' enctype='multipart/form-data' method='post' id='form1' name='form1'>")
sb.AppendLine("称呼: <input name='ch' id='ch'><br/><br/>")
sb.AppendLine("联系方式: <input name='kh' id='kh'><br/><br/>"
sb.AppendLine("报餐时间: <input type='date' name='rq' id='rq'><br/><br/>")
sb.AppendLine("<input Type='submit' name='Sumbit' id='Sumbit' value='确定'>")
sb.AppendLine("</form>")
e.WriteString(sb.ToString)
Else
Dim dr As DataRow = DataTables("报餐").AddNew()
Dim inms() As String = {"ch","kh","rq"} '输入框名称数组
Dim cnms() As String = {"称呼","联系方式","报餐时间"} '列名数组,注意列名和输入框必须一一对应,位置不能错乱
For i As Integer = 0 To inms.Length -1
dr(cnms(i)) = e.PostValues(Inms(i))
Next
dr.Save() '用SQLAddNew增加的行,必须保存一下,否则会被丢弃.
Dim sb As New StringBuilder
sb.AppendLine("报餐成功! <br/><br/>")
sb.AppendLine("<a href='AddNew.htm'>继续增加</a>")
e.WriteString(sb.ToString)
End If
代码貌似会与表事件e.datarow(录入时间)=date.today产生冲突,