一下代码在执行的时候
Dim id As Integer = DataTables("工资数据输入表").Compute("Max(_Identify)")
Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
dlg.Filter= "Excel文件|*.xls;*.xlsx" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim mg As New Merger
mg.SourcePath = dlg.FileName
mg.Format = "excel"
Dim book As new XLS.Book(dlg.fileName)
mg.SourceTableName = book.Sheets(0).name & "$"
mg.DataTableName = "工资数据输入表"
mg.Merge()
Dim Sheet As XLS.Sheet = Book.Sheets(0)
For n As Integer = 2 To Sheet.Rows.Count -1 '注意下面的循环变量从2开始,而不是从0开始,因为Excel表的第1-2行是标题和列名
If sheet(n,1).text = "" Then '如果EXCEL的身份证出现空行那么删除空行
DataTables("工资数据输入表").DeleteFor("姓名 Is Null")
End If
Next
Dim ffdt As Date = e.Form.Controls("控件_工资发放月份").Value
Dim y As Integer = e.Form.Controls("控件_所得税申报年份").Value
Dim m As Integer = e.Form.Controls("控件_所得税申报月份").Value
CurrentTable.DataTable.ReplaceFor("发放月份",ffdt,"_Identify > " & id)
CurrentTable.DataTable.ReplaceFor("纳税所属_年",y,"_Identify > " & id)
CurrentTable.DataTable.ReplaceFor("纳税所属_月",m,"_Identify > " & id)
End If
Dim dt As Date = e.Form.Controls("控件_工资发放月份").Value
Dim y1 As String = dt.Year
Dim m1 As String = dt.Month
Dim ndt As String = y1 & "年" & m1 & "月份"
Dim count As Integer : Dim sum As Double
For Each dr As DataRow In CurrentTable.DataTable.DataRows
If dr.RowState = DataRowState.Added Then
count = count +1
sum = sum + dr("税前工资")
End If
Next
Dim frm As WinForm.Form
frm = Forms(e.Form.Name)
frm.Close()
MessageBox.Show("本次导入<"& ndt & ">工资数据<" & count & ">条," & vbcrlf & "税前工资合计金额<" & Format(sum,"#,###.00") & ">元!","提示")
此主题相关图片如下:系统页面离奇变化.png
出现这个界面后,没办法再操作了,只能关掉重新打开,不知为什么!
[此贴子已经被作者于2019/3/30 16:50:52编辑过]