If Tables("工程预算").Current Is Nothing Then
MessageBox.Show("尚未录入工程预算项目不能导入预算文件!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
Dim dr As Row = Tables("工程预算").current
If dr.DataRow.RowState = DataRowState.Added Then
dr.save
End If
Dim dlg As New OpenFileDialog
dlg.Filter = "预算文件|*.doc;*docx;*.xls;*.xlsx;*.LGC;*.gcs;*.GBQ4;*.GBG9;*.gzb4;*.dwg;*.zjxm;*.jpg;*.gtb4;*.GBQ5"
If dlg.ShowDialog =DialogResult.OK Then
Dim fl As String = dlg.FileName
Dim r As Row = Tables("工程预算.送审预算").AddNew()
r("文件名") = FileSys.GetName(fl) '写入文件名
Dim p As String = IIF(r.DataRow.RowState = DataRowState.Added, "A#", "U#")'定义发送消息的行状态
r.Save '必须先保存
r.DataRow.SQLInsertFile("文件",fl) '插入文件
r.DataRow.SQLSetValue("CRC值", CRCCheckFile(fl)) '保存crc检验值
Dim msg As String = p & "送审预算" & "#" & r("_Identify")'发送消息给好友
For Each bd As QQBuddy In QQClient.Buddies
If bd.Online Then
QQClient.Send(bd.name, msg)
End If
Next
End If
因工程造价软件不断升级,扩展名最后的数字GBQ4、GBQ5、GBQ6、GBQ7、不断变化,想用通配符一劳永逸解决。