接收数据的代码里只能返回OK表示成功了,因为js里只判断了OK
function afterSubmit(result){
hide("tst1");
if (result=='OK') {
show("tst2");
location="upload.htm";
}
else{
show("tst3",2000);
}
}
…………
Else
Dim nms() As String = {"日期","业态","房号","客户姓名","收款银行","收款金额","项目名称","分期","收款摘要","收款阶段","楼栋号"}'不能为空的列名数组
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then '生成错误提示页
e.WriteString(“出错了”)
Return '必须返回
End If
Next
nms = New String(){"日期","业态","房号","客户姓名","收款银行","收款金额","项目名称","分期","收款摘要","收款阶段","楼栋号"}'重新定义了nms数组,增加了两列.
Dim dr As DataRow = DataTables("销售收款").AddNew()
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr(nm) = e.PostValues(nm)
End If
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
Next
'保存并生成增加成功提示页面
dr.save()
e.WriteString("OK")
End If
End Select