-- 作者:Liangcai
-- 发布时间:2019/4/2 11:50:00
-- 二进制图片保存问题
此主题相关图片如下:qq截图20190402114114.png
教工姓名 控件Enter代码 Dim str As String = "" Dim Arys As List(Of String()) = DataTables("教工基本信息").SQLGetValues("教工姓名|教工编号") For Each Ary As String() In Arys str &= IIF(Len(Ary(0)) = 2,mid(Ary(0),1,1) & " " & mid(Ary(0),2,1),Ary(0)) & "(" & Ary(1) & ")|" Next e.Sender.ComboList = str.trim("|")
教工编号DataFormat代码
Dim dr As DataRow = DataTables("教工基本信息").SQLFind("教工编号 = \'"& e.Text &"\'") If dr IsNot Nothing Then Tables("教工基本信息").RaiseCurrentChanged() e.Form.Controls("教工姓名").text = dr("教工姓名") e.Form.Controls("手机号码").text = dr("手机号码") e.Form.Controls("身份证号").text = dr("身份证号") e.Form.Controls("党派").text = dr("党派") e.Form.Controls("民族").text = dr("民族") e.Form.Controls("学历").text = dr("学历") e.Form.Controls("专业").text = dr("专业") e.Form.Controls("毕业日期").text = dr("毕业日期") e.Form.Controls("毕业院校").text = dr("毕业院校") e.Form.Controls("资格证号码").text = dr("资格证号码") e.Form.Controls("职称").text = dr("职称") e.Form.Controls("籍贯").text = dr("籍贯") e.Form.Controls("家庭住址").text = dr("家庭住址") e.Form.Controls("照片").Image = dr.SQlLoadImage("照片") \'从后台提取照片并显示 e.Form.Controls("身份证").Image = dr.SQlLoadImage("身份证") \'从后台提取照片并显示 e.Form.Controls("资格证").Image = dr.SQlLoadImage("资格证") \'从后台提取照片并显示 End If
上传照片Click代码
If Tables("教工基本信息").Current Is Nothing Then Return End If Dim dr As DataRow = Tables("教工基本信息").Current.DataRow Dim dlg As New OpenFileDialog dlg.Filter = "图形文件|*.bmp;*.jpg;*.gif;*.png;*pdf" If dlg.ShowDialog = DialogResult.OK Then Dim pic As WinForm.PictureBox = e.Form.Controls("照片") dr.SQLSetValue("照片",Nothing) \'从后台删除照片列内容 pic.Image = Nothing dr.SQLInsertFile("照片",dlg.FileName) \'插入文件 pic.Image = GetImage(dlg.FileName) End If
保存Click代码
Dim dr As DataRow= DataTables("教工基本信息").SQLFind("教工编号 = \'" & e.Form.Controls("教工编号").Text & "\'") If dr IsNot Nothing Then dr("手机号码") = e.Form.Controls("手机号码").text dr("教工姓名") = e.Form.Controls("教工姓名").text dr("身份证号") = e.Form.Controls("身份证号").text dr("党派") = e.Form.Controls("党派").text dr("民族") = e.Form.Controls("民族").text dr("学历") = e.Form.Controls("学历").text dr("专业") = e.Form.Controls("专业").text dr("毕业日期") = e.Form.Controls("毕业日期").text dr("毕业院校") = e.Form.Controls("毕业院校").text dr("资格证号码") = e.Form.Controls("资格证号码").text dr("职称") = e.Form.Controls("职称").text dr("籍贯") = e.Form.Controls("籍贯").text dr("家庭住址") = e.Form.Controls("家庭住址").text dr.Save() e.Form.Close() End If
照片只能保存在第一行,请求老师指教,谢谢!
|