Dim e As RequestEventArgs = args(0)
Select Case e.Path
Case "cs.htm"
Dim wb As New weui
If e.PostValues.Count = 0 Then
wb.AddForm("", "form1", "cs.htm")
With wb.AddInputGroup("form1", "ipg1", "增加员工")
.AddInput("姓名", "姓名", "Text") '前一个"姓名"是ID,后一个"姓名"是标题
.AddUploader("up1", "照片", True) 'True表示允许上传多个文件
.AddUploader("up2", "照片", True) 'True表示允许上传多个文件
End With
With wb.AddButtonGroup("form1", "btg1", True)
.Add("btn1", "确定", "submit")
End With
e.WriteString(wb.Build)
Else
Dim nms() As String = {"姓名"}
Dim dr As DataRow = DataTables("考生信息列表").AddNew()
For Each nm As String In nms
dr(nm) = e.PostValues(nm)
Next
For Each key As String In e.Files.Keys
If key = "up1" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, ProjectPath & "Attachments\" & fln)
Next
dr.Lines("成绩_图片") = e.Files(key)
End If
If key = "up2" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, ProjectPath & "web\up\cj\" & ksid & "\" & fln)
Next
dr.Lines("录取_图片") = e.Files(key)
End If
Next
'保存并生成增加成功提示页面
dr.save()
With wb.AddMsgPage("", "msgpage", "增加成功", "好好学习,天天向上") '生成成功提示页
.AddButton("btn1", "继续增加", "addnew.htm")
End With
e.WriteString(wb.Build)
End If
End Select