123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896 |
- $PBExportHeader$w_fj_bill_mng.srw
- forward
- global type w_fj_bill_mng from window
- end type
- type cb_7 from uo_imflatbutton within w_fj_bill_mng
- end type
- type cbx_showpic from checkbox within w_fj_bill_mng
- end type
- type cb_5 from uo_imflatbutton within w_fj_bill_mng
- end type
- type dw_fileclass from u_dw_rbtnfilter within w_fj_bill_mng
- end type
- type cb_6 from uo_imflatbutton within w_fj_bill_mng
- end type
- type cb_3 from uo_imflatbutton within w_fj_bill_mng
- end type
- type dw_fj from datawindow within w_fj_bill_mng
- end type
- type cb_1 from uo_imflatbutton within w_fj_bill_mng
- end type
- type cb_2 from uo_imflatbutton within w_fj_bill_mng
- end type
- type cb_4 from uo_imflatbutton within w_fj_bill_mng
- end type
- type cb_open from uo_imflatbutton within w_fj_bill_mng
- end type
- type ln_bar2 from line within w_fj_bill_mng
- end type
- type ln_bar from line within w_fj_bill_mng
- end type
- type r_bar from rectangle within w_fj_bill_mng
- end type
- end forward
- global type w_fj_bill_mng from window
- integer width = 2999
- integer height = 1372
- boolean titlebar = true
- string title = "附件管理"
- boolean controlmenu = true
- boolean minbox = true
- windowtype windowtype = popup!
- long backcolor = 67108864
- string icon = "AppIcon!"
- boolean center = true
- event retrieve_file ( )
- event retrieve_fileclass ( )
- event ue_fileway ( )
- event ue_open ( )
- cb_7 cb_7
- cbx_showpic cbx_showpic
- cb_5 cb_5
- dw_fileclass dw_fileclass
- cb_6 cb_6
- cb_3 cb_3
- dw_fj dw_fj
- cb_1 cb_1
- cb_2 cb_2
- cb_4 cb_4
- cb_open cb_open
- ln_bar2 ln_bar2
- ln_bar ln_bar
- r_bar r_bar
- end type
- global w_fj_bill_mng w_fj_bill_mng
- type variables
- long ins_billtype //当前单据类型
- //
- //
- //
- long ins_relid //当前单据ID
- string ins_relcode //当前单据号码
- long ins_relid_mx //当前明细ID
- string ins_relcode_mx //当前明细号码
- long ins_scid //分部ID
- Blob ins_lbimage
- string ori_title
- datastore ins_ds_fileclass
- Transaction Transaction_pic
- string ins_openfile_log[] //用于退出后删除
- long ins_openfile_log_p=0 //用于退出后删除
- long ins_openfile_key[]
- String is_mx_menustr
- String G_type
- end variables
- forward prototypes
- public subroutine wf_del_tempfilepathname ()
- public subroutine wf_fileopen_pic (long arg_fileid)
- public subroutine wf_retrfile (long arg_mtrlid)
- public subroutine wf_addlog_tempfilepathname (long arg_fileid, string arg_filepathname)
- end prototypes
- event retrieve_file();Long lrow
- lrow = dw_fileclass.GetRow( )
- IF lrow > 0 THEN
- dw_fj.Retrieve( ins_billtype,dw_fileclass.Object.classid[lrow],ins_relid,ins_relid_mx,ins_scid)
- ELSE
- dw_fj.Reset()
- END IF
- //201 //物料定义-附件
- //102 //销售订单-附件
- //202 //物料清单-附件
- // >.. 按main函数上的ID
- end event
- event retrieve_fileclass();Long i,ls_row,ls_rowcount,nrow
- Long ls_classid,ls_filecount,ls_allowedit
- ls_rowcount = ins_ds_fileclass.Retrieve( ins_billtype)
- //messagebox(string(ins_billtype),ls_rowcount)
- dw_fileclass.Reset()
- dw_fileclass.Enabled = FALSE
- FOR i = 1 TO ls_rowcount
- ls_allowedit = 0
- ls_filecount = 0
- ls_classid = ins_ds_fileclass.Object.classid[i]
- IF f_power_ind_fileclassview(ls_classid) THEN
-
- SELECT count(*) INTO :ls_filecount
- FROM u_file
- WHERE classid = :ls_classid AND relid = :ins_relid
- USING Transaction_pic;
- IF Transaction_pic.SQLCode <> 0 THEN
- MessageBox('错误','统计附件数量失败>'+Transaction_pic.SQLErrText,stopsign!,OK!)
- RETURN
- END IF
- IF f_power_ind_fileclassedit(ls_classid) THEN
- ls_allowedit = 1
- ELSE
- ls_allowedit = 0
- END IF
- nrow = dw_fileclass.InsertRow(0)
- dw_fileclass.Object.classid[nrow] = ls_classid
- dw_fileclass.Object.ClassName[nrow] = ins_ds_fileclass.Object.ClassName[i]
- dw_fileclass.Object.dscrp[nrow] = ins_ds_fileclass.Object.dscrp[i]
- dw_fileclass.Object.filecount[nrow] = ls_filecount
- dw_fileclass.Object.allow_edit[nrow] = ls_allowedit
- END IF
- NEXT
- IF dw_fileclass.RowCount() > 0 THEN
- dw_fileclass.SetSort('classname')
- dw_fileclass.Sort()
- dw_fileclass.SelectRow( 0, FALSE)
- dw_fileclass.SelectRow( 1, TRUE)
- dw_fileclass.ScrollToRow( 1)
- THIS.TriggerEvent( 'retrieve_file')
- END IF
- dw_fileclass.Enabled = TRUE
- //dw_fileclass.Retrieve( ins_billtype)
- end event
- event ue_fileway();String ls_path
- String ls_type
- String ls_run
- Integer i
- Long ll_newid,cnt
- Long ls_i,ls_j,ls_newrow,ls_filesize
- Blob ls_filedata
- String Pathname,ls_filename,ls_filetype
- String errmsg,arg_msg
- Long pos1,lrow,rslt,ls_fileid,ls_row
- String ls_para,ls_downarg[]
- SetNull(ls_filedata)
- uo_fj_mng_billtype ls_uo_fjbt
- ls_uo_fjbt = CREATE uo_fj_mng_billtype
- IF dw_fj.getrow()<= 0 THEN RETURN
- ls_row =dw_fj.getrow()
- ls_type = dw_fj.object.filetype[ls_row]
- IF File_Way = '选择打开程序' then
- cnt = GetFileOpenName("选择默认程序", pathname,ls_filename,"exe","程序文件(*.exe),*.exe")
-
- IF cnt=1 AND TRIM(pathname)<>'' AND TRIM(ls_filename)<>"" THEN
- LS_PATH = pathname
- ll_newid = f_sys_scidentity(0,"u_file_way","id",arg_msg,TRUE,id_sqlca)
-
- File_Way = ls_filename
- insert into u_file_way(id,filetype, way, path)
- values(:ll_newid,:ls_type,:File_Way,:LS_PATH);
- END IF
-
- ELSE
- SELECT PATH INTO :LS_PATH FROM u_file_way
- where filetype = :ls_type and way = :File_Way
- using sqlca;
- IF SQLCA.SQLCODE <>0 THEN
- RETURN
- END IF
- END IF
- //取附件信息
- ls_fileid = dw_fj.Object.fileid[ls_row]
- ls_filename = dw_fj.Object.Filename[ls_row]
- ls_filetype = Lower(Trim(dw_fj.Object.FileType[ls_row]))
- Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
- IF Trim(Pathname) <> '' THEN
-
-
- IF ls_uo_fjbt.uf_getfjbolb_fromdb( ls_fileid, ls_filedata, Transaction_pic, arg_msg) = 0 THEN
- MessageBox('系统提示',arg_msg)
- RETURN
- END IF
-
- IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
- MessageBox('系统提示',errmsg)
- RETURN
- ELSE
-
- wf_addlog_tempfilepathname(ls_fileid,Pathname)
- ls_run = LS_PATH+' "'+Pathname+'"'
- run(ls_run)
- END IF
- END IF
- end event
- event ue_open();cb_open.triggerevent(clicked!)
- end event
- public subroutine wf_del_tempfilepathname ();//wf_del_tempfilepathname
- // 删除临时文件
- long li
- for li=1 to ins_openfile_log_p
- if len(trim(ins_openfile_log[li]))<=0 then
- else
- FileDelete(ins_openfile_log[li])
- end if
- next
- end subroutine
- public subroutine wf_fileopen_pic (long arg_fileid);
- s_edit_index_tran s_pic
- s_pic.f_long= arg_fileid
- s_pic.sqltransaction = sys_filedb_sqlca
- OpenWithParm(w_fj_fileopen,s_pic)
- end subroutine
- public subroutine wf_retrfile (long arg_mtrlid);Long lrow
- lrow = dw_fileclass.GetRow( )
- IF lrow > 0 THEN
- dw_fj.Retrieve( ins_billtype,dw_fileclass.Object.classid[lrow],arg_mtrlid,ins_relid_mx,ins_scid)
- ELSE
- dw_fj.Reset()
- END IF
- String ls_mtrlcode
- SELECT mtrlcode
- INTO :ls_mtrlcode
- FROM u_mtrldef
- Where mtrlid = :arg_mtrlid;
- IF sqlca.SQLCode = 0 THEN
- THIS.Title = ls_mtrlcode
- ELSE
- THIS.Title = ''
- END IF
-
- end subroutine
- public subroutine wf_addlog_tempfilepathname (long arg_fileid, string arg_filepathname);//wf_addlog_tempfilepathname
- if isnull(arg_filepathname) or len(trim(arg_filepathname))<3 then return
- ins_openfile_log_p++
- ins_openfile_log[ins_openfile_log_p]=arg_filepathname
- ins_openfile_key[ins_openfile_log_p] = arg_fileid
- // string ins_openfile_log[] //用于退出后删除
- // long ins_openfile_log_p=0 //用于退出后删除
- //
- end subroutine
- on w_fj_bill_mng.create
- this.cb_7=create cb_7
- this.cbx_showpic=create cbx_showpic
- this.cb_5=create cb_5
- this.dw_fileclass=create dw_fileclass
- this.cb_6=create cb_6
- this.cb_3=create cb_3
- this.dw_fj=create dw_fj
- this.cb_1=create cb_1
- this.cb_2=create cb_2
- this.cb_4=create cb_4
- this.cb_open=create cb_open
- this.ln_bar2=create ln_bar2
- this.ln_bar=create ln_bar
- this.r_bar=create r_bar
- this.Control[]={this.cb_7,&
- this.cbx_showpic,&
- this.cb_5,&
- this.dw_fileclass,&
- this.cb_6,&
- this.cb_3,&
- this.dw_fj,&
- this.cb_1,&
- this.cb_2,&
- this.cb_4,&
- this.cb_open,&
- this.ln_bar2,&
- this.ln_bar,&
- this.r_bar}
- end on
- on w_fj_bill_mng.destroy
- destroy(this.cb_7)
- destroy(this.cbx_showpic)
- destroy(this.cb_5)
- destroy(this.dw_fileclass)
- destroy(this.cb_6)
- destroy(this.cb_3)
- destroy(this.dw_fj)
- destroy(this.cb_1)
- destroy(this.cb_2)
- destroy(this.cb_4)
- destroy(this.cb_open)
- destroy(this.ln_bar2)
- destroy(this.ln_bar)
- destroy(this.r_bar)
- end on
- event resize;ln_bar.EndX = THIS.Width
- ln_bar2.EndX = THIS.Width
- r_bar.Width = THIS.Width
- end event
- event open;s_edit_index_tran s_tran //翻页功能窗口 传递参数使用
- s_tran = Message.PowerObjectParm
- IF NOT IsNull(s_tran.sqltransaction ) THEN
- Transaction_pic = s_tran.sqltransaction
- ELSE
- MessageBox('提示','没有数据库事务',information!,OK!)
- Close(THIS)
- RETURN
- END IF
- IF NOT IsNull(s_tran.f_long ) THEN
- ins_billtype = s_tran.f_long
- ELSE
- ins_billtype = 0
- MessageBox('提示','单据类型不正确或没有指定',information!,OK!)
- Close(THIS)
- RETURN
- END IF
- IF NOT IsNull(s_tran.g_long ) THEN
- ins_relid = s_tran.g_long
- ELSE
- ins_relid = 0
- END IF
- IF NOT IsNull(s_tran.f_string ) THEN
- ins_relcode = s_tran.f_string
- ELSE
- ins_relcode = ''
- END IF
- IF NOT IsNull(s_tran.d_long ) THEN
- ins_relid_mx = s_tran.d_long
- ELSE
- ins_relid_mx = 0
- END IF
- IF NOT IsNull(s_tran.d_string ) THEN
- ins_relcode_mx = s_tran.d_string
- ELSE
- ins_relcode_mx = ''
- END IF
- IF NOT IsNull(s_tran.e_long ) THEN
- ins_scid = s_tran.e_long
- ELSE
- ins_scid = 0
- END IF
- ori_title = THIS.Title
- IF ins_relcode_mx = '' THEN
- THIS.Title = ori_title+ ' ['+Trim(ins_relcode)+']'
- ELSE
- THIS.Title = ori_title+ ' ['+Trim(ins_relcode)+'->'+ Trim(ins_relcode_mx)+']'
- END IF
- ins_ds_fileclass = CREATE datastore
- ins_ds_fileclass.DataObject = dw_fileclass.DataObject
- ins_ds_fileclass.SetTransObject(sqlca)
- //dw_fileclass.SetTransObject(sqlca)
- dw_fj.SetTransObject(Transaction_pic)
- THIS.TriggerEvent('retrieve_fileclass')
- end event
- event close;// 删除临时文件
- wf_del_tempfilepathname()
- end event
- type cb_7 from uo_imflatbutton within w_fj_bill_mng
- integer x = 151
- integer width = 274
- integer height = 164
- integer taborder = 20
- string text = "打开方式"
- string normalpicname = "audit.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;open(w_fileway_edit)
- end event
- type cbx_showpic from checkbox within w_fj_bill_mng
- integer x = 507
- integer y = 92
- integer width = 425
- integer height = 56
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "直接查看图片"
- boolean checked = true
- end type
- event clicked;if this.checked then
- f_SetProfileString (sys_empid, "w_fj_bill_mng", "cbx_showpic", '1')
- else
- f_SetProfileString (sys_empid, "w_fj_bill_mng", "cbx_showpic", '0')
- end if
- end event
- event constructor;THIS.BackColor = 14215660
- String showpic
- showpic = f_ProfileString (sys_empid, "w_fj_bill_mng", "cbx_showpic", "1")
- IF showpic = '1' THEN
- THIS.Checked = TRUE
- ELSE
- THIS.Checked = FALSE
- END IF
- end event
- type cb_5 from uo_imflatbutton within w_fj_bill_mng
- integer width = 151
- integer height = 164
- integer taborder = 10
- string text = "刷新"
- string normalpicname = "refresh.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;PARENT.TriggerEvent('retrieve_fileclass')
- end event
- type dw_fileclass from u_dw_rbtnfilter within w_fj_bill_mng
- integer y = 184
- integer height = 1056
- integer taborder = 80
- string dataobject = "dw_fj_fileclass_list"
- boolean hscrollbar = true
- boolean vscrollbar = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
- this.SelectRow( 0, FALSE)
- this.SelectRow( currentrow, TRUE)
- this.ScrollToRow( currentrow)
- parent.triggerevent( 'retrieve_file')
- END IF
- end event
- type cb_6 from uo_imflatbutton within w_fj_bill_mng
- integer x = 1435
- integer width = 274
- integer height = 164
- integer taborder = 30
- string text = "另存文件"
- string normalpicname = "save.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;//附件下载并打开
- Integer i
- Long ls_i,ls_j,ls_newrow,ls_filesize
- Blob ls_filedata
- String Pathname,ls_filename
- String errmsg,arg_msg
- Long pos1,lrow,rslt,ls_fileid
- String ls_para,ls_downarg[],ls_filetype
- SetNull(ls_filedata)
- uo_fj_mng_billtype ls_uo_fjbt
- ls_uo_fjbt=create uo_fj_mng_billtype
- long ls_row
- ls_row=dw_fj.getrow()
- if ls_row<=0 then
- messagebox('提示','当前没有文件',information!,OK!)
- return
- end if
- //取附件信息
- ls_fileid = dw_fj.object.fileid[ls_row]
- ls_filename = dw_fj.object.filename[ls_row]
- ls_filetype = dw_fj.object.filetype[ls_row]
-
- IF len(ls_filetype) > 0 THEN
- i = GetFileSaveName("另存为",Pathname,ls_filename,"*","*."+ls_filetype+",*."+ls_filetype)
- ELSE
- i = GetFileSaveName("另存为",Pathname,ls_filename,"*","*.*,*.*")
- END IF
- IF i = 1 AND Trim(Pathname) <> '' THEN
- if ls_uo_fjbt.uf_getfjbolb_fromdb( ls_fileid, ls_filedata, Transaction_pic, arg_msg)=0 THEN
- MessageBox('错误',arg_msg,stopsign!,OK!)
- RETURN
- END IF
-
- IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
- MessageBox('错误',errmsg,stopsign!,OK!)
- RETURN
- ELSE
-
- MessageBox('提示','附件保存成功!'+'~r~n'+'保存路径:'+Pathname,information!,OK!)
- END IF
- END IF
- //
- end event
- type cb_3 from uo_imflatbutton within w_fj_bill_mng
- integer x = 1861
- integer width = 151
- integer height = 164
- integer taborder = 50
- string text = "删除"
- string normalpicname = "delete.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;long lrow
- lrow=dw_fileclass.getrow( )
- if lrow<=0 then
- messagebox('提示','当前没有指定文件类型,可能是权限限制',information!,OK!)
- return
- end if
- if not dw_fileclass.object.allow_edit[lrow]>0 then
- messagebox('提示','你没有权限修改此类附件',information!,OK!)
- return
- end if
- String arg_msg = ""
- long ls_count
- long cur_row
- cur_row=dw_fj.getrow( )
- long cur_fileid
- uo_fj_mng_billtype ls_uo_btfj
- ls_uo_btfj =create uo_fj_mng_billtype
- if cur_row <= 0 then
- messagebox('提示','请选定要删除的文件!',information!,OK!)
- return
- end if
- if messagebox ("询问","是否确定要删除当前文件["+string(dw_fj.object.displayname[cur_row]) +"]?(选择确定后记录将不可恢复)",question!,yesno! ) = 2 then
- return
- end if
- cur_fileid= dw_fj.object.fileid[cur_row]
- if ls_uo_btfj.uf_del_file(cur_fileid,Transaction_pic,arg_msg)=0 then
- MessageBox('错误',arg_msg,stopsign!,OK!)
- return
- end if
- parent.triggerevent( 'retrieve_file')
- MessageBox('提示','文件删除成功!',information!,OK!)
- end event
- type dw_fj from datawindow within w_fj_bill_mng
- integer x = 1015
- integer y = 184
- integer width = 1925
- integer height = 1056
- integer taborder = 70
- string title = "none"
- string dataobject = "dw_fj_file_list"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- event rowfocuschanged;IF currentrow > 0 THEN
- dw_fj.SelectRow( 0, FALSE)
- dw_fJ.SelectRow( currentrow, TRUE)
- dw_fJ.ScrollToRow( currentrow)
- //wf_file_retrieve(THIS.Object.fileid[currentrow],THIS.Object.Filename[currentrow])
- END IF
- end event
- event doubleclicked;//IF row <= 0 THEN RETURN
- //cb_open.triggerevent(clicked!)
- IF row <= 0 THEN RETURN
- string ls_type
- string way
- long i,id
- datastore ds_way
- ds_way = create datastore
- ds_way.DataObject = 'ds_fileway_list'
- ds_way.SetTransObject(sqlca)
- is_mx_menustr = "Text=直接打开~tEvent=ue_open"
- is_mx_menustr = is_mx_menustr + "|" + "Text=选择打开程序~tEvent=ue_fileway"
- ls_type= This.object.filetype[this.getrow()]
- G_type = ls_type
- ds_way.retrieve(ls_type)
- for i = 1 to ds_way.rowcount()
- id = ds_way.object.id[i]
- way = ds_way.object.way[i]
- is_mx_menustr = is_mx_menustr + "|Text=" + way+"~tEvent=ue_fileway"
- //is_mx_menustr = is_mx_menustr + "|" + "Text=终止订单~tEvent=ue_stopbuytask"
- next
- m_Dfc_Control_PopupMenu_way dmPopupMenu
- IF Len(Trim(is_mx_menustr)) <> 0 THEN
- dmPopupMenu = CREATE m_Dfc_Control_PopupMenu_way
- dmPopupMenu.mf_BuildMenu(THIS, is_mx_menustr)
- dmPopupMenu.mf_PopMenu()
- DESTROY dmPopupMenu
- END IF
- //cb_open.triggerevent(clicked!)
- end event
- type cb_1 from uo_imflatbutton within w_fj_bill_mng
- integer x = 1010
- integer width = 151
- integer height = 164
- integer taborder = 10
- string text = "刷新"
- string normalpicname = "refresh.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;PARENT.TriggerEvent('retrieve_file')
- end event
- type cb_2 from uo_imflatbutton within w_fj_bill_mng
- integer x = 1710
- integer width = 151
- integer height = 164
- integer taborder = 40
- string text = "新增"
- string normalpicname = "update.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;Long lrow
- lrow = dw_fileclass.GetRow( )
- IF lrow <= 0 THEN
- MessageBox('提示','当前没有指定文件类型,可能是权限限制',information!,OK!)
- RETURN
- END IF
- IF Not dw_fileclass.Object.allow_edit[lrow] > 0 THEN
- MessageBox('提示','你没有权限修改此类附件',information!,OK!)
- RETURN
- END IF
- s_fileinfo s_file
- s_file.classid = dw_fileclass.Object.classid[lrow]
- s_file.fileid = 0
- s_file.Filename = ''
- s_file.dscrp = ''
- s_file.encrypted = 0
- s_file.compressed = 0
- s_file.FileType = ''
- s_file.relid = ins_relid
- s_file.relid_mx = ins_relid_mx
- s_file.relcode = ins_relcode
- s_file.billtype = ins_billtype
- s_file.scid = ins_scid
- s_file.SqlTransaction = Transaction_pic
- SetNull(s_file.filedata)
- OpenWithParm(w_fj_fileadd,s_file)
- s_file = Message.PowerObjectParm
- If (Not IsNull(s_file.fileid )) THEN
- // IF s_file.fileid > 0 THEN
- Parent.TriggerEvent( 'retrieve_file')
- IF dw_fileclass.GetRow( ) > 0 THEN
- dw_fileclass.Object.filecount[dw_fileclass.GetRow( )] = dw_fileclass.Object.filecount[dw_fileclass.GetRow( )]+1
- END IF
- // END IF
- END IF
- end event
- type cb_4 from uo_imflatbutton within w_fj_bill_mng
- integer x = 2011
- integer width = 151
- integer height = 164
- integer taborder = 60
- string text = "退出"
- string normalpicname = "exit.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;close(parent)
- end event
- type cb_open from uo_imflatbutton within w_fj_bill_mng
- integer x = 1161
- integer width = 274
- integer height = 164
- integer taborder = 20
- string text = "查看文件"
- string normalpicname = "audit.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;//附件下载并打开
- Integer i
- Long ls_i,ls_j,ls_newrow,ls_filesize
- Blob ls_filedata
- String Pathname,ls_filename,ls_filetype
- String errmsg,arg_msg
- Long pos1,lrow,rslt,ls_fileid
- String ls_para,ls_downarg[]
- SetNull(ls_filedata)
- uo_fj_mng_billtype ls_uo_fjbt
- ls_uo_fjbt = CREATE uo_fj_mng_billtype
- Long ls_row
- ls_row = dw_fj.GetRow()
- IF ls_row <= 0 THEN
- MessageBox('提示','当前没有文件',information!,OK!)
- RETURN
- END IF
- //取附件信息
- ls_fileid = dw_fj.Object.fileid[ls_row]
- ls_filename = dw_fj.Object.Filename[ls_row]
- ls_filetype = Lower(Trim(dw_fj.Object.FileType[ls_row]))
- IF cbx_showpic.Checked THEN
- IF ls_filetype = 'bmp' OR ls_filetype = 'rle' OR ls_filetype = 'wmf' OR ls_filetype = 'tif' OR ls_filetype = 'jpg' OR ls_filetype = 'gif' OR ls_filetype = 'jpeg' THEN
- wf_fileopen_pic(ls_fileid)
- RETURN
- END IF
- END IF
- //下载附件并打开
- Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
- IF Trim(Pathname) <> '' THEN
-
-
- IF ls_uo_fjbt.uf_getfjbolb_fromdb( ls_fileid, ls_filedata, Transaction_pic, arg_msg) = 0 THEN
- MessageBox('错误',arg_msg,stopsign!,OK!)
- RETURN 0
- END IF
-
- IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
- MessageBox('错误',errmsg,stopsign!,OK!)
- RETURN
- ELSE
-
- //记录临时文件位置,本窗口退出后删除
- wf_addlog_tempfilepathname(ls_fileid,Pathname)
-
- //打开附件
- String lsNull
- ShellExecute32( Handle(THIS), lsNull, Pathname, lsNull, lsNull, 1 )
- END IF
- END IF
- DESTROY ls_uo_fjbt
- end event
- type ln_bar2 from line within w_fj_bill_mng
- long linecolor = 16777215
- integer linethickness = 4
- integer beginx = -23
- integer beginy = 172
- integer endx = 2016
- integer endy = 172
- end type
- type ln_bar from line within w_fj_bill_mng
- long linecolor = 268435456
- integer linethickness = 4
- integer beginx = -23
- integer beginy = 168
- integer endx = 1984
- integer endy = 168
- end type
- type r_bar from rectangle within w_fj_bill_mng
- long linecolor = 16777215
- integer linethickness = 4
- long fillcolor = 1073741824
- integer x = 2642
- integer y = 48
- integer width = 146
- integer height = 68
- end type
- event constructor;THIS.FillColor = 14215660
- THIS.LineColor = 14215660
- THIS.X = -1
- THIS.Y = -1
- THIS.Height = ln_bar.BeginY - 5
- end event
|