Dim e As RequestEventArgs = args(0)
Dim wb As New weui
If e.PostValues.Count>0 Then
If e.PostValues("销售发货单号")<>""
Dim dr As DataRow=DataTables("销售发货单").sqlfind("销售发货单号='" & e.PostValues("销售发货单号") & "'")
If dr IsNot Nothing Then
For Each key As String In e.Files.Keys
MessageBox.show("1")
Dim i As Integer=0
For Each fln As String In e.Files(key)
MessageBox.show("1")
Dim lj As String= ProjectPath & "temp\" & e.PostValues("销售发货单号")
If FileSys.DirectoryExists(lj)=False Then
FileSys.CreateDirectory(lj)
End If
lj=lj & "\" & e.PostValues("销售发货单号") & "@" & i & "@" & fln
e.SaveFile(key,fln,lj) '保存接收到的文件
i=i+1
Next
Next
With wb.AddMsgPage("","msgpage","保存成功", e.PostValues("销售发货单号") & "送货回单已上传!") '生成成功提示页
.AddButton("btn1","返回","upload.htm?dh=" & e.PostValues("销售发货单号") )
End With
Else
With wb.AddMsgPage("","msgpage","保存失败", "不存在这样的送货单!") '生成成功提示页
.icon= "Warn"
.AddButton("btn1","返回","upload.htm?dh=" & e.PostValues("销售发货单号") )
End With
End If
Else
With wb.AddMsgPage("","msgpage","保存失败", "发货单号不能为空!") '生成成功提示页
.icon= "Warn"
.AddButton("btn1","返回","upload.htm")
End With
End If
Else
wb.AddForm("","form1","upload.htm")
With wb.AddInputGroup("form1","ipg1","回单图片上传")
With .AddInput("销售发货单号","销售发货单号","text")
If e.getValues.ContainsKey("dh") Then
.Value = e.GetValues("dh")
End If
End With
With .AddUploader("up128","照片")
.AllowDelete = True '允许删除
.Accept = "image/*"
.Incremental = True '允许重复选择文件或连续拍照
.ScaleWidth = vars("图片宽度")
''.ScaleHeight=vars("图片高度")
End With
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "上传", "submit")
End With
End If
e.WriteString(wb.Build) '生成网页
e.Handled=True