e.Form.Controls("SINumber").text=format(Date.Now, "yyyyMMddHHmmss")
If e.Form.Controls("workdate").text = "" Then
MessageBox.Show("作业日期不能为空!","提示")
Return
End If
If e.Form.Controls("filename").text = "" Then
MessageBox.Show("导入文件不能为空!","提示")
Return
End If
Dim Book As New XLS.Book(e.Form.Controls("filename").Value)
Dim Sheet As XLS.Sheet=Book.Sheets(0)
Tables("inputWorkRecord").StopRedraw()
'Dim nms() As String={"groupName","personName","post","method","workGroupName","projectName","billingMethod","workName","workingHours","yield","season"}
For n As Integer =1 To Sheet.Rows.Count-1
Dim r As Row = Tables("inputWorkRecord").AddNew()
If Sheet(n,1).Value.trim() <>"" And Sheet(n,1).Value IsNot Nothing Then
r("SINumber") =e.Form.Controls("SINumber").text
r("workdate") =e.Form.Controls("workdate").text
r("groupName") =Sheet(n,1).Value.trim()
r("personName") =Sheet(n,2).Value.trim()
r("post") =Sheet(n,3).Value.trim()
r("method") =Sheet(n,4).Value.trim()
r("workGroupName") =Sheet(n,5).Value.trim()
r("projectName") =Sheet(n,6).Value.trim()
r("billingMethod") =Sheet(n,7).Value.trim()
r("workName") =Sheet(n,8).Value.trim()
r("workingHours") =Sheet(n,9).Value.trim()
r("yield") =Sheet(n,10).Value.trim()
r("season") =Sheet(n,11).Value.trim()
End If
Next
Tables("inputWorkRecord").ResumeRedraw()
DataTables("inputWorkRecord").Save
e.Form.Controls("filename").text=""