Dim nms() As String = {"巡检人","异常情况","处理情况","巡检时间"}
Dim dr As DataRow = DataTables("机房交班巡检表").AddNew()
dr.Save '保存后的_identify才是准确的
For Each nm As String In nms
dr(nm) = e.PostValues(nm)
Next
'msgbox(dr("_identify"))
For Each key As String In e.Files.Keys
If key = "up1" Then
Dim str_allphotoname As New List(of String)
For Each fln As String In e.Files(key)
'e.SaveFile(key, fln, ProjectPath & "Attachments\" & fln) 'fln是用户上传的文件名称,不含路径. 第三个参数是要保存到本地的文件名称,含路径
Dim str_photoname As String="B3_" & dr("_identify") & "_" & Format(Date.now, "yyMMddhhmmss") & ".jpg"
e.SaveFile(key,fln,"c:\test\" & str_photoname) '文件名保存要以 保存路径&文件名的方式保存
str_allphotoname.add(str_photoname)
'dr("中心机房照片")=str_photoname '只有一张照片的时候,可以这样,有多张照片的时候,应该还是用lines
Next
' dr.Lines("中心机房照片") = e.Files(key) 'lines 以字符集合的形式返回或设置单元格内容. 可能是用来对付用户在uploader中上传多张照片的情况(如果只有一张的话,王昆觉得应该不用lines)
dr.Lines("中心机房照片")=str_allphotoname '只有一张照片的时候,可以这样,有多张照片的时候,应该还是用lines
End If
If key = "up2" 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 = "up3" 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 = "up4" 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")