:ls_phone, :ls_tel, :ls_address, :mle_profile.text ); if sqlca.sqlcode=0 then updateblob zxh_xsb set zxh照片=:ib_photo where zxh学号=:ll_id using sqlca; if sqlca.sqlnrows>0 then sle_no.text=\ sle_name.text=\ sle_birthday.text=\ mle_profile.text=\ sle_address.text=\ sle_tel.text=\ sle_phone.text='' p_1.picturename=' ' sle_no.setfocus () messagebox('提示信息','数据和照片添加成功!') else messagebox('提示信息','数据添加成功,照片提交失败!') end if commit; sle_no.text=\ sle_name.text=\ sle_birthday.text=\ mle_profile.text=\ sle_address.text=\ sle_tel.text=\ sle_phone.text=\ p_1.picturename=' ' sle_no.setfocus () else messagebox('提示信息',sqlca.sqlerrtext) end if 3)“退出”的click事件
close(parent)
12.学生基本信息管理界面
26 盐城工学院经济与管理学院
1) 窗口open事件
dw_1.settransobject(sqlca) 2)“检索”按钮的click事件 blob lb_photo long a
p_1.picturename=\
xuehaoid=trim(sle_1.text) a=dw_1.retrieve(xuehaoid) if a<=0 then messagebox('提示信息','未查到该学号同学的相关信息!') cb_2.enabled=false return end if
cb_2.enabled=true
selectblob zxh照片 into :lb_photo from zxh_xsb where zxh学号=:xuehaoid;
if sqlca.sqlnrows>0 and not(isnull(lb_photo)) then p_1.setpicture(lb_photo) else messagebox('提示信息','照片读取失败') end if 3)“修改”按钮的click事件 xuehaoid=trim(sle_1.text) open(w_zxh18_xiugai) 4)“清除”按钮的click事件 sle_1.text='' dw_1.reset()
p_1.picturename=\5)“导出”按钮的click事件 dw_1.saveas('',excel!,true) 6)“打印”按钮的click事件
27
盐城工学院经济与管理学院
dw_1.print() 7)“关闭”按钮的click事件 close(parent)
13.学生基本信息修改界面
1) 窗口的open事件
string stno,stname,stsex,stnation,stparty,stbirthday,stphone,sttel,staddress,stprofile
SELECT zxh_xsb.zxh学号, zxh_xsb.zxh姓名, zxh_xsb.zxh性别, zxh_xsb.zxh民族, zxh_xsb.zxh政治面貌, zxh_xsb.zxh出生时间, zxh_xsb.zxh联系方式, zxh_xsb.zxh家庭电话, zxh_xsb.zxh通讯地址, zxh_xsb.zxh个人简历 INTO :stno, :stname, :stsex, :stnation, :stparty, :stbirthday, :stphone, :sttel, :staddress, :stprofile FROM zxh_xsb
28
盐城工学院经济与管理学院
where zxh_xsb.zxh学号=:xuehaoid; if sqlca.sqlcode=0 then sle_no.text=stno sle_name.text=stname sle_birthday.text=(stbirthday) sle_tel.text=sttel sle_phone.text=stphone sle_address.text=staddress mle_profile.text=stprofile ddlb_sex.text=stsex ddlb_nation.text=stnation ddlb_party.text=stparty
selectblob zxh照片 into :ib_photo from zxh_xsb where zxh学号=:xuehaoid;
if sqlca.sqlnrows>0 and not(isnull(ib_photo)) then p_1.setpicture(ib_photo) else messagebox('提示信息','照片读取失败') end if end if 2)“选择照片”按钮的click事件 string ls_pathname,ls_filename integer li_value,li_filenum,loops,i
long ll_filelength,bytes_read,new_read,new_pos blob b,tot_b
li_value=getfileopenname('选择照片',+ls_pathname,ls_filename,\if li_value=1 then setpointer(hourglass!) ll_filelength=filelength(ls_filename) li_filenum=fileopen(ls_filename,+streammode!,read!,lockread!) if ll_filelength>66560 then messagebox('提示信息','照片最大不能超过65k!请重新选择照片') return end if if ll_filelength> 32765 then // if mod(ll_filelength,32765)=0 then // loops=ll_filelength/32765 // else // loops=(ll_filelength/32765)+1 // end if
loops=(ll_filelength - 1)/32765+1 else loops=1 end if new_pos=1
29
盐城工学院经济与管理学院
for i= 1 to loops bytes_read=fileread(li_filenum,b) tot_b=tot_b+b next fileclose(li_filenum) ib_photo=tot_b p_1.setpicture(ib_photo) elseif li_value= - 1 then messagebox('选择照片','打开文件错误!') end if 3)“保存”按钮的click事件 string ll_id, ll_i date ld_birthday
string ls_name,ls_nation,ls_sex,ls_home,ls_tel,ls_party,ls_phone,ls_address
if sle_name.text=\ messagebox(\缺少数据\请输入学生姓名\ sle_name.setfocus () return
elseif sle_address.text=\ messagebox(\缺少数据\请输入家庭住址信息!\ sle_name.setfocus () return end if
if sle_birthday.text<>\ if isDate (sle_birthday.text) then ld_birthday=date (sle_birthday.text) else messagebox(\输入数据错误\请使用“年-月-日”的日期格式\ sle_birthday.setfocus () return end if else messagebox('提示信息','请输入出生时间!') end if
ll_id=sle_no.text
if ddlb_sex.text='' then messagebox(\提示信息\请选择性别信息!\ ddlb_sex.setfocus () return else ls_sex=ddlb_sex.text end if
30
盐城工学院经济与管理学院