Dim tb As WinForm.TabControl = e.Form.Controls("TabControl1")
Dim pg As WinForm.TabPage = tb.SelectedPage
Dim 表 As String = ""
If tb.SelectedPage.Text = "报名登记汇总" Then
表 = "鉴定管理表"
Forms("鉴定管理").Controls("PictureBox1").BindingField = "鉴定管理表.照片"
ElseIf tb.SelectedPage.Text = "证书编号汇总" Then
表 = "证书编号表"
Forms("鉴定管理").Controls("PictureBox1").BindingField = "证书编号表.照片"
End If
If MessageBox.Show("即将导入员工照片,请确认数据格式是否正确!!" & vbcrlf & "系统默认会在程序的Attachments文件夹内搜索文件!!","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Warning) = dialogresult.ok Then
If CurrentTable.Rows.Count > 0 Then
Dim dlg As New FolderBrowserDialog
If dlg.ShowDialog = DialogResult.Ok Then
Dim lj As String = dlg.SelectedPath & "\"
Dim count As Integer = 0
For Each dr As Row In Tables(表).Rows
Dim str1 As String =dr("身份证号码") & "-" & dr("姓名") & ".jpg"
If FileSys.FileExists(lj & str1) = True Then
dr("照片") = dr("身份证号码") & "-" & dr("姓名") & ".jpg"
count += 1
Else
dr("照片") = Nothing
End If
Next
msgbox("共导入:" & count & "人")
End If
Else
MessageBox.Show("当前表没有数据,无法执行该操作!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error)
End If
End If