$PBExportHeader$w_dw_update.srw forward global type w_dw_update from w_publ_base end type type lb_1 from listbox within w_dw_update end type type lb_2 from listbox within w_dw_update end type type dw_list from u_dw_rbtnfilter within w_dw_update end type type dw_lib from u_dw_rbtnfilter within w_dw_update end type type cb_add from uo_imflatbutton within w_dw_update end type type cb_retrieve from uo_imflatbutton within w_dw_update end type type dw_pb from u_dw_rbtnfilter within w_dw_update end type type cb_saveupload from uo_imflatbutton within w_dw_update end type type cbx_1 from checkbox within w_dw_update end type type cb_save from uo_imflatbutton within w_dw_update end type type cb_upload from uo_imflatbutton within w_dw_update end type type cb_2 from uo_imflatbutton within w_dw_update end type type cb_3 from uo_imflatbutton within w_dw_update end type type cbx_4 from checkbox within w_dw_update end type type cb_5 from uo_imflatbutton within w_dw_update end type type cb_7 from uo_imflatbutton within w_dw_update end type type p_resize from picture within w_dw_update end type type gb_1 from groupbox within w_dw_update end type type gb_2 from groupbox within w_dw_update end type type ln_bar2 from line within w_dw_update end type type ln_bar from line within w_dw_update end type type r_bar from rectangle within w_dw_update end type end forward global type w_dw_update from w_publ_base integer width = 3625 integer height = 2388 string title = "新打印格式上传" boolean maxbox = true boolean resizable = true windowstate windowstate = maximized! event ue_f7 ( ) event ue_pset1 ( ) event ue_import ( ) event retrieve_list ( ) lb_1 lb_1 lb_2 lb_2 dw_list dw_list dw_lib dw_lib cb_add cb_add cb_retrieve cb_retrieve dw_pb dw_pb cb_saveupload cb_saveupload cbx_1 cbx_1 cb_save cb_save cb_upload cb_upload cb_2 cb_2 cb_3 cb_3 cbx_4 cbx_4 cb_5 cb_5 cb_7 cb_7 p_resize p_resize gb_1 gb_1 gb_2 gb_2 ln_bar2 ln_bar2 ln_bar ln_bar r_bar r_bar end type global w_dw_update w_dw_update type variables String ls_path,lib_path,lib_name long dw_lib_h,dw_list_h,dw_list_w long cur_type = 0 long j DataWindowChild dw_child DataWindowChild dw_child2 long if_update = 0 end variables forward prototypes public subroutine wf_addexplore (long arg_type) public subroutine wf_retrdw (string arg_path) public subroutine wf_retrpb () public function integer wf_check (ref string arg_msg) public function integer wf_init (ref string arg_msg) end prototypes event ue_f7();Long lib_row Long list_row str_rpt s_parm dw_lib.accepttext() dw_list.accepttext() lib_row = dw_lib.GetRow() list_row = dw_list.GetRow() IF lib_row <= 0 OR list_row <= 0 THEN RETURN dw_list.accepttext() s_parm.auto = "auto" s_parm.transation = sqlca//数据库连接 s_parm.oname = dw_list.object.ctag[list_row] s_parm.otype = lib_path s_parm.rcname = dw_list.object.ctag[list_row] s_parm.retr_pram_falg = -1 s_parm.retr_flag = true s_parm.import_flag = true s_parm.pblpath = dw_lib.object.lib_path[lib_row] OpenWithParm(w_rpt_main,s_parm) end event event ue_pset1();Long i if dw_list.RowCount() < 2 then return FOR i = 2 TO dw_list.RowCount() dw_list.Object.fromtype[i] = dw_list.Object.fromtype[1] NEXT end event event ue_import();Long i String ls_ctag,ls_dwname,ls_wname IF dw_list.RowCount() = 0 THEN RETURN FOR i = 1 TO dw_list.RowCount() ls_ctag = dw_list.Object.ctag[i] SELECT chnname, dwtype INTO :ls_dwname, :ls_wname FROM sys_dft_dwprint_dynamic WHERE dft_new_dwname = :ls_ctag and ifdefault = 0; IF sqlca.SQLCode = 0 THEN dw_list.Object.dwname[i] = ls_dwname dw_list.Object.wname[i] = ls_wname dw_list.Object.fromtype[i] = 0 END IF NEXT end event event retrieve_list(); long ll_row ll_row = dw_lib.getrow() dw_lib.AcceptText() IF ll_row > 0 THEN lib_name = dw_lib.Object.lib_name[ll_row] lib_path = dw_lib.Object.lib_path[ll_row] wf_retrdw(lib_path) ELSE dw_list.Reset() END IF end event public subroutine wf_addexplore (long arg_type); String ls_label Int li_count,i = 1 Integer li_FileNum Blob ls_str j = 1 LS_PATH = sys_cur_path + "*.pbl" lb_1.Reset() lb_1.DirList(LS_PATH, 0) li_count = lb_1.TotalItems() dw_lib.Reset() IF li_count > 0 THEN FOR i = li_count TO 1 STEP -1 ls_label = lb_1.Text(i) li_FileNum = FileOpen(sys_cur_path + ls_label,StreamMode!) FileRead(li_FileNum,ls_str) ls_str = BlobMid(ls_str,29,100) FileClose(li_FileNum) IF Pos(sys_system_id,Trim(String(ls_str))) > 0 THEN //企精灵为ewiserp,L1为ljerp dw_lib.Object.lib_name[j] = ls_label dw_lib.Object.lib_path[j] = sys_cur_path + ls_label dw_lib.Object.flag[j] = 0 if ls_label = sys_pblname then dw_lib.Object.ifdft[j] = 1 else dw_lib.Object.ifdft[j] = 0 end if j++ END IF NEXT END IF IF dw_lib.RowCount() > 0 THEN lib_path = dw_lib.Object.lib_path[1] wf_retrdw(lib_path) ELSE dw_list.Reset() END IF end subroutine public subroutine wf_retrdw (string arg_path);if arg_path = '' then return /////////////// String ls_data,s[] Long ll_row,k String ls_msm[] s[4] = LibraryDirectory(arg_path,DirDataWindow!) //name ~t date/time modified ~t comments ~n dw_list.Reset() dw_list.SetRedraw(FALSE) DO WHILE TRUE k = Pos(s[4],'~t') IF k = 0 THEN EXIT s[1] = Left(s[4],k -1) s[4] = Mid(s[4],k+1) k = Pos(s[4],'~t') s[3] = Left(s[4],k -1) s[4] = Mid(s[4],k+1) k = Pos(s[4],'~n') s[2] = Left(s[4],k -1) s[4] = Mid(s[4],k+1) k = dw_list.InsertRow(0) dw_list.SetItem(k,1,s[1]) dw_list.SetItem(k,3,s[3]) IF Len(Trim(s[2])) > 1 THEN dw_list.object.comments[k] = left(s[2],len(s[2]) - 1 ) ll_row = 0 DO WHILE Pos(s[2],'&') > 0 ll_row++ ls_msm[ll_row] = Mid(s[2],1,Pos(s[2],'&') - 1) s[2] = Mid(s[2],Pos(s[2],'&') + 1) LOOP IF ll_row = 2 THEN dw_list.object.product[k] = long(ls_msm[1]) dw_list.object.fromtype[k] = long(ls_msm[2] ) end if if ll_row > 2 then dw_list.object.product[k] = long(ls_msm[1]) dw_list.object.fromtype[k] = long(ls_msm[2] ) dw_list.object.wname[k] = ls_msm[3] dw_list.object.dwname[k] = ls_msm[4] END IF END IF LOOP dw_list.SetRedraw(TRUE) datawindowchild childdw dw_list.SetTransObject (sqlca) childdw.SetTransObject (sqlca) childdw.Retrieve() end subroutine public subroutine wf_retrpb ();Long i,ll_row string ls_msm[] dw_pb.retrieve() IF dw_pb.RowCount() = 0 THEN RETURN string ls_comments FOR i = 1 TO dw_pb.RowCount() ls_comments = dw_pb.object.comments[i] IF Len(Trim(ls_comments)) > 1 THEN ll_row = 0 DO WHILE Pos(ls_comments,'&') > 0 ll_row++ ls_msm[ll_row] = Mid(ls_comments,1,Pos(ls_comments,'&') - 1) ls_comments = Mid(ls_comments,Pos(ls_comments,'&') + 1) LOOP IF ll_row = 2 THEN dw_pb.object.product[i] = long(ls_msm[1]) dw_pb.object.fromtype[i] = long(ls_msm[2] ) end if if ll_row > 2 then dw_pb.object.product[i] = long(ls_msm[1]) dw_pb.object.fromtype[i] = long(ls_msm[2] ) dw_pb.object.wname[i] = ls_msm[3] dw_pb.object.dwname[i] = ls_msm[4] END IF END IF NEXT end subroutine public function integer wf_check (ref string arg_msg);Long rslt = 1,i dw_list.AcceptText() FOR i = 1 TO dw_list.RowCount() IF dw_list.Object.fromtype[i] = 0 AND dw_list.Object.ch[i] = 1 THEN IF dw_list.Object.wname[i] = '' THEN arg_msg = '第' + String(i) + '行,请填写所属窗口名称' rslt = 0 GOTO ext END IF IF dw_list.Object.dwname[i] = '' THEN arg_msg = '第' + String(i) + '行,请填写打印格式名称' rslt = 0 GOTO ext END IF END IF NEXT ext: RETURN rslt end function public function integer wf_init (ref string arg_msg);Long rslt = 1,i = 1,no_mxcheck String Filename[],comments[] DateTime buildtime[] String ls_dwsyn,ls_dwsyn2 Blob lb_dwsyn DECLARE cur_inwaermx CURSOR FOR SELECT sys_autoudpb.filename, sys_autoudpb.buildtime, sys_autoudpb.comments FROM sys_autoudpb ; OPEN cur_inwaermx; FETCH cur_inwaermx INTO :Filename[i], :buildtime[i], :comments[i]; DO WHILE sqlca.SQLCode = 0 i++ FETCH cur_inwaermx INTO :Filename[i], :buildtime[i], :comments[i]; LOOP SELECT count(*) INTO :no_mxcheck FROM sys_autoudpb; IF sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = "查询操作失败,数据窗口数量" GOTO ext END IF IF i <> (no_mxcheck+1) THEN rslt = 0 arg_msg = "查询操作失败,数据窗口明细" GOTO ext END IF FOR i = 1 TO no_mxcheck ls_dwsyn = LibraryExport(sys_cur_path + sys_pblname, Filename[i], ExportDataWindow!) SELECTBLOB filedata INTO :lb_dwsyn FROM sys_autoudpb Where Filename = :Filename[i]; IF sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = "查询操作失败,数据窗口数据" GOTO ext ELSE ls_dwsyn2 = String(lb_dwsyn) END IF IF ls_dwsyn2 <> ls_dwsyn THEN IF LibraryImport(sys_cur_path + sys_pblname,Filename[i], ImportDataWindow!, ls_dwsyn2, arg_msg,comments[i] ) = -1 THEN rslt = 0 arg_msg = "查询操作失败,数据窗口数据导入错误," + arg_msg GOTO ext END IF END IF NEXT ext: IF rslt = 0 THEN ROLLBACK; ELSE COMMIT; END IF RETURN rslt end function on w_dw_update.create int iCurrent call super::create this.lb_1=create lb_1 this.lb_2=create lb_2 this.dw_list=create dw_list this.dw_lib=create dw_lib this.cb_add=create cb_add this.cb_retrieve=create cb_retrieve this.dw_pb=create dw_pb this.cb_saveupload=create cb_saveupload this.cbx_1=create cbx_1 this.cb_save=create cb_save this.cb_upload=create cb_upload this.cb_2=create cb_2 this.cb_3=create cb_3 this.cbx_4=create cbx_4 this.cb_5=create cb_5 this.cb_7=create cb_7 this.p_resize=create p_resize this.gb_1=create gb_1 this.gb_2=create gb_2 this.ln_bar2=create ln_bar2 this.ln_bar=create ln_bar this.r_bar=create r_bar iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.lb_1 this.Control[iCurrent+2]=this.lb_2 this.Control[iCurrent+3]=this.dw_list this.Control[iCurrent+4]=this.dw_lib this.Control[iCurrent+5]=this.cb_add this.Control[iCurrent+6]=this.cb_retrieve this.Control[iCurrent+7]=this.dw_pb this.Control[iCurrent+8]=this.cb_saveupload this.Control[iCurrent+9]=this.cbx_1 this.Control[iCurrent+10]=this.cb_save this.Control[iCurrent+11]=this.cb_upload this.Control[iCurrent+12]=this.cb_2 this.Control[iCurrent+13]=this.cb_3 this.Control[iCurrent+14]=this.cbx_4 this.Control[iCurrent+15]=this.cb_5 this.Control[iCurrent+16]=this.cb_7 this.Control[iCurrent+17]=this.p_resize this.Control[iCurrent+18]=this.gb_1 this.Control[iCurrent+19]=this.gb_2 this.Control[iCurrent+20]=this.ln_bar2 this.Control[iCurrent+21]=this.ln_bar this.Control[iCurrent+22]=this.r_bar end on on w_dw_update.destroy call super::destroy destroy(this.lb_1) destroy(this.lb_2) destroy(this.dw_list) destroy(this.dw_lib) destroy(this.cb_add) destroy(this.cb_retrieve) destroy(this.dw_pb) destroy(this.cb_saveupload) destroy(this.cbx_1) destroy(this.cb_save) destroy(this.cb_upload) destroy(this.cb_2) destroy(this.cb_3) destroy(this.cbx_4) destroy(this.cb_5) destroy(this.cb_7) destroy(this.p_resize) destroy(this.gb_1) destroy(this.gb_2) destroy(this.ln_bar2) destroy(this.ln_bar) destroy(this.r_bar) end on event open;call super::open; Long i,ll_row,ll_row2 dw_list.SetTransObject(sqlca) dw_list.GetChild('wname',dw_child) dw_pb.SetTransObject(sqlca) dw_pb.GetChild('wname',dw_child2) FOR i = 1 TO UpperBound(s_sys_bill) IF s_sys_bill[i].versiontype = sys_version_type OR s_sys_bill[i].versiontype = -1 THEN ll_row = dw_child.InsertRow(0) dw_child.SetItem(ll_row2,1,s_sys_bill[i].winname) dw_child.SetItem(ll_row2,2,s_sys_bill[i].billname) ll_row2 = dw_child2.InsertRow(0) dw_child2.SetItem(ll_row2,1,s_sys_bill[i].winname) dw_child2.SetItem(ll_row2,2,s_sys_bill[i].billname) END IF NEXT dw_pb.SetTransObject(sqlca) wf_addexplore(cur_type) wf_retrpb() end event event resize;call super::resize;ln_bar.EndX = THIS.Width ln_bar2.EndX = THIS.Width r_bar.Width = THIS.Width long w_width,w_height w_width = 3600 w_height = 2350 if newwidth < w_width then this.width = w_width if newheight < w_height then this.height = w_height gb_2.width = this.width - 50 gb_1.width = this.width - 50 dw_list.width = this.width - dw_list.x - 60 dw_pb.width = this.width - dw_pb.x - 60 gb_1.height = this.height - gb_1.y - 150 dw_pb.height = this.height - dw_pb.y - 170 //dw_lib.height = this.height - (w_height - dw_lib_h) //dw_list.width=this.width - (w_width - dw_list_w) //dw_pb.width=this.width - (w_width - dw_list_w) // //dw_list.height= dw_lib.height/2 - 50 //dw_pb.height= dw_lib.height/2 - 50 //cbx_2.y = dw_list.y+dw_list.height+10 //cb_1.y = dw_list.y+dw_list.height+5 //cb_del.y = dw_list.y+dw_list.height+5 //cb_4.y = dw_list.y+dw_list.height+5 //dw_pb.y = dw_list.y+dw_list.height + 100 //cbx_4.y = dw_list.y+dw_list.height+10 end event event ue_before_open;call super::ue_before_open;THIS.BackColor = 14215660 String arg_msg IF f_init_dftpbl(sys_pblname,'',arg_msg) = 0 THEN MessageBox('错误',arg_msg,StopSign!, OK! ) END IF long iflib iflib = long (f_ProfileString (sys_empid,dw_lib.DataObject, "iflib",'1') ) IF iflib = 1 THEN p_resize.picturename = 'w_resize_2.bmp' p_resize.X = 1125 dw_list.X = 1166 dw_lib.Visible = TRUE ELSE p_resize.picturename = 'w_resize_1.bmp' p_resize.X = 0 dw_list.X = p_resize.Width + 5 dw_lib.Visible = FALSE END IF end event type cb_func from w_publ_base`cb_func within w_dw_update boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_dw_update integer x = 1422 integer y = 1260 integer width = 151 integer height = 164 integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type lb_1 from listbox within w_dw_update boolean visible = false integer x = 3291 integer y = 128 integer width = 878 integer height = 544 integer taborder = 20 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type type lb_2 from listbox within w_dw_update boolean visible = false integer x = 3291 integer y = 832 integer width = 878 integer height = 544 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type type dw_list from u_dw_rbtnfilter within w_dw_update integer x = 1166 integer y = 60 integer width = 2359 integer height = 1188 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_dw_list_update" boolean hscrollbar = true boolean vscrollbar = true boolean rbutton_filter_use = true boolean titleclick_sort_use = true end type event rowfocuschanged;call super::rowfocuschanged;THIS.SetRow(currentrow) THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) end event event constructor;call super::constructor;dw_list_h = this.height dw_list_w = this.width end event event doubleclicked;call super::doubleclicked;parent.triggerevent('ue_f7') end event event clicked;call super::clicked;IF row > 0 THEN THIS.SetRow(row) end event type dw_lib from u_dw_rbtnfilter within w_dw_update integer x = 27 integer y = 60 integer width = 1093 integer height = 1188 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_lib_list" boolean vscrollbar = true boolean rbutton_filter_use = true boolean titleclick_sort_use = true boolean setcolumn_visible_use = false boolean autosave_setlayout_use = false boolean autosave_columnvisible_use = false end type event constructor;call super::constructor;dw_lib_h = this.height end event event clicked;call super::clicked;IF row = 0 THEN RETURN THIS.SetRow(row) THIS.SelectRow(0,FALSE) THIS.SelectRow(row,TRUE) end event event rowfocuschanged;IF currentrow > 0 THEN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) END IF parent.triggerevent('retrieve_list') end event type cb_add from uo_imflatbutton within w_dw_update integer x = 14 integer y = 1260 integer width = 233 integer height = 164 integer taborder = 50 boolean bringtotop = true string text = "附加库" string normalpicname = "imexport.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Integer i String Pathname String Filename Integer li_FileNum Blob ls_str Boolean lb_find = FALSE i = GetFileOpenName("Select File",Pathname,Filename,"pbl","Pb Files,*.pbl") dw_lib.AcceptText() IF i = 1 AND Trim(Pathname) <> "" AND Trim(Filename) <> "" THEN FOR j = 1 TO dw_lib.RowCount() IF Filename = dw_lib.Object.lib_name[j] THEN RETURN NEXT // li_FileNum = FileOpen(Pathname,StreamMode!) // FileRead(li_FileNum,ls_str) // ls_str = BlobMid(ls_str,29,100) // FileClose(li_FileNum) // IF Pos(sys_system_id,Trim(String(ls_str))) > 0 THEN //企精灵为ewiserp,L1为ljerp dw_lib.Object.lib_name[j] = Filename dw_lib.Object.lib_path[j] = Pathname dw_lib.Object.flag[j] = 1 dw_lib.Object.ifdft[j] = 0 j++ // ELSE // MessageBox('提示','所选PBL不是本产品格式库文件') // END IF END IF dw_lib.SetRow(j) lib_name = Filename lib_path = Pathname wf_retrdw(lib_path) RETURN end event type cb_retrieve from uo_imflatbutton within w_dw_update integer x = 247 integer y = 1260 integer width = 151 integer height = 164 integer taborder = 40 boolean bringtotop = true 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_list') end event type dw_pb from u_dw_rbtnfilter within w_dw_update integer x = 18 integer y = 1700 integer width = 3511 integer height = 552 integer taborder = 30 boolean bringtotop = true string dataobject = "dw_dw_list_pb" boolean hscrollbar = true boolean vscrollbar = true boolean rbutton_filter_use = true boolean titleclick_sort_use = true end type event clicked;call super::clicked;IF row > 0 THEN THIS.SetRow(row) end event event rowfocuschanged;call super::rowfocuschanged;THIS.SetRow(currentrow) THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) end event type cb_saveupload from uo_imflatbutton within w_dw_update integer x = 699 integer y = 1260 integer width = 311 integer height = 164 integer taborder = 30 boolean bringtotop = true string text = "保存并上传" string normalpicname = "mx1.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;String ls_temp ,ls_dwsyn,ls_msg DateTime ld_moddate Long k Long rslt = 1,i String ls_ctag,ls_ctype,ls_product,ls_fromtype,ls_dwname,ls_wname,ls_comments dw_list.AcceptText() dw_lib.AcceptText() IF wf_check(ls_msg) = 0 THEN rslt = 0 GOTO ext END IF ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()] FOR i = 1 TO dw_list.RowCount() IF dw_list.Object.ch[i] = 1 THEN ls_ctag = dw_list.Object.ctag[i] ls_ctype = dw_list.Object.ctype[i] ls_product = String(dw_list.Object.product[i]) ls_fromtype = String(dw_list.Object.fromtype[i]) ls_dwname = dw_list.Object.dwname[i] ls_wname = dw_list.Object.wname[i] ls_dwsyn = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!) ld_moddate = DateTime(Date(Left(ls_ctype,Pos(ls_ctype,' ',1))),Time(Right(ls_ctype,8))) ls_comments = ls_product + '&' + ls_fromtype + '&' IF ls_dwname <> '' THEN ls_comments = ls_comments + ls_wname + '&' + ls_dwname + '&' END IF IF LibraryImport(ls_temp, ls_ctag, ImportDataWindow!, ls_dwsyn, ls_msg,ls_comments ) = -1 THEN ls_msg = ls_ctag + '写入文件' + ls_temp + '失败' rslt = 0 GOTO ext END IF Blob lb_dwsyn UPDATE sys_autoudpb SET buildtime = :ld_moddate, uploadtime = getdate(), comments = :ls_comments , pblname = :sys_pblname Where Filename = :ls_ctag; IF sqlca.SQLCode = 0 THEN IF sqlca.SQLNRows = 0 THEN INSERT INTO sys_autoudpb ( filename, buildtime, uploadtime, comments, pblname) VALUES ( :ls_ctag, :ld_moddate, getdate(), :ls_comments , :sys_pblname) ; IF sqlca.SQLCode <> 0 THEN ls_msg = '插入数据窗口列表失败' + sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF commit; lb_dwsyn = Blob(ls_dwsyn) UPDATEBLOB sys_autoudpb SET filedata = :lb_dwsyn Where Filename = :ls_ctag; IF sqlca.SQLCode <> 0 THEN ls_msg = '更新数据窗口列表失败(1)' + sqlca.SQLErrText rslt = 0 GOTO ext END IF IF ls_fromtype = '0' THEN UPDATE sys_dft_dwprint_dynamic SET chnname = :ls_dwname, dwtype = :ls_wname , pblname = :sys_pblname Where dft_new_dwname = :ls_ctag; IF sqlca.SQLCode = 0 THEN IF sqlca.SQLNRows = 0 THEN Long ll_newid ll_newid = f_sys_scidentity(0,"sys_dft_dwprint_dynamic","dwprintid",ls_msg,FALSE,sqlca) IF ll_newid <= 0 THEN rslt = 0 GOTO ext END IF INSERT INTO sys_dft_dwprint_dynamic ( dwprintid, dft_new_dwname, chnname, dwtype, ifuse, ifdefault , pblname) VALUES ( :ll_newid, :ls_ctag, :ls_dwname, :ls_wname, 1, 0 , :sys_pblname) ; IF sqlca.SQLCode <> 0 THEN ls_msg = '插入单据格式重定向列表失败' + sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF ELSE ls_msg = '更新单据格式重定向列表失败' + sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF ELSE ls_msg = '更新数据窗口列表失败(2)' + sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF NEXT ext: IF rslt = 0 THEN ROLLBACK; MessageBox('错误',ls_msg, StopSign!, OK! ) ELSE COMMIT; MessageBox('提示','保存并上传成功', Information!, OK! ) wf_retrdw(ls_temp) dw_pb.Retrieve() wf_retrpb() END IF end event type cbx_1 from checkbox within w_dw_update integer x = 1627 integer y = 1316 integer width = 247 integer height = 60 boolean bringtotop = true 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;Long i dw_list.accepttext() IF THIS.Checked THEN FOR i = 1 TO dw_list.RowCount() dw_list.object.ch[i] = 1 NEXT ELSE FOR i = 1 TO dw_list.RowCount() dw_list.object.ch[i] = 0 NEXT END IF end event event constructor;this.backcolor = 14215660 end event type cb_save from uo_imflatbutton within w_dw_update integer x = 398 integer y = 1260 integer width = 151 integer height = 164 integer taborder = 60 boolean bringtotop = true string text = "保存" string normalpicname = "save.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;String ls_temp ,ls_dwsyn,ls_msg DateTime ld_moddate Long k Long rslt = 1,i String ls_ctag,ls_ctype,ls_dwname,ls_wname,ls_comments,ls_dwsyn_old dw_list.AcceptText() dw_lib.AcceptText() Long ls_product,ls_fromtype ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()] FOR i = 1 TO dw_list.RowCount() IF dw_list.Object.ch[i] = 1 THEN ls_ctag = dw_list.Object.ctag[i] ls_ctype = dw_list.Object.ctype[i] ls_product = dw_list.Object.product[i] ls_fromtype = dw_list.Object.fromtype[i] ls_dwname = dw_list.Object.dwname[i] ls_wname = dw_list.Object.wname[i] ls_dwsyn = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!) ld_moddate = DateTime(Date(Left(ls_ctype,Pos(ls_ctype,' ',1))),Time(Right(ls_ctype,8))) ls_comments = String(ls_product) + '&' + String(ls_fromtype) + '&' IF ls_dwname <> '' THEN ls_comments = ls_comments + ls_wname + '&' + ls_dwname + '&' END IF ls_dwsyn_old = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!) IF ls_dwsyn_old <> ls_dwsyn or dw_list.Object.comments[i] <> ls_comments THEN IF LibraryImport(ls_temp, ls_ctag, ImportDataWindow!, ls_dwsyn, ls_msg,ls_comments ) = -1 THEN ls_msg = ls_ctag + '写入文件' + ls_temp + '失败' rslt = 0 GOTO ext END IF END IF END IF NEXT ext: IF rslt = 0 THEN MessageBox('错误',ls_msg, StopSign!, OK! ) ELSE MessageBox('提示','保存成功', Information!, OK! ) wf_retrdw(ls_temp) END IF end event type cb_upload from uo_imflatbutton within w_dw_update integer x = 549 integer y = 1260 integer width = 151 integer height = 164 integer taborder = 50 boolean bringtotop = true string text = "上传" string normalpicname = "mx.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;String ls_temp ,ls_dwsyn,ls_msg DateTime ld_moddate Long k Long rslt = 1,i String ls_ctag,ls_ctype,ls_product,ls_fromtype,ls_dwname,ls_wname,ls_comments dw_list.AcceptText() dw_lib.AcceptText() IF wf_check(ls_msg) = 0 THEN rslt = 0 GOTO ext END IF ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()] FOR i = 1 TO dw_list.RowCount() IF dw_list.Object.ch[i] = 1 THEN ls_ctag = dw_list.Object.ctag[i] ls_ctype = dw_list.Object.ctype[i] ls_product = String(dw_list.Object.product[i]) ls_fromtype = String(dw_list.Object.fromtype[i]) ls_dwname = dw_list.Object.dwname[i] ls_wname = dw_list.Object.wname[i] ls_dwsyn = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!) ld_moddate = DateTime(Date(Left(ls_ctype,Pos(ls_ctype,' ',1))),Time(Right(ls_ctype,8))) ls_comments = ls_product + '&' + ls_fromtype + '&' IF ls_dwname <> '' THEN ls_comments = ls_comments + ls_wname + '&' + ls_dwname + '&' END IF Blob lb_dwsyn UPDATE sys_autoudpb SET buildtime = :ld_moddate, uploadtime = getdate(), comments = :ls_comments, pblname = :sys_pblname Where Filename = :ls_ctag; IF sqlca.SQLCode = 0 THEN IF sqlca.SQLNRows = 0 THEN INSERT INTO sys_autoudpb ( filename, buildtime, uploadtime, comments , pblname) VALUES ( :ls_ctag, :ld_moddate, getdate(), :ls_comments, ::sys_pblname) ; IF sqlca.SQLCode <> 0 THEN ls_msg = '插入数据窗口列表失败' + sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF COMMIT; lb_dwsyn = Blob(ls_dwsyn) UPDATEBLOB sys_autoudpb Set filedata = :lb_dwsyn Where Filename = :ls_ctag; IF sqlca.SQLCode <> 0 THEN ls_msg = '更新数据窗口列表失败(1)' + sqlca.SQLErrText rslt = 0 GOTO ext END IF IF ls_fromtype = '0' THEN UPDATE sys_dft_dwprint_dynamic SET chnname = :ls_dwname, dwtype = :ls_wname , pblname = :sys_pblname Where dft_new_dwname = :ls_ctag; IF sqlca.SQLCode = 0 THEN IF sqlca.SQLNRows = 0 THEN Long ll_newid ll_newid = f_sys_scidentity(0,"sys_dft_dwprint_dynamic","dwprintid",ls_msg,FALSE,sqlca) IF ll_newid <= 0 THEN rslt = 0 GOTO ext END IF INSERT INTO sys_dft_dwprint_dynamic ( dwprintid, dft_new_dwname, chnname, dwtype, ifuse, ifdefault , pblname) VALUES ( :ll_newid, :ls_ctag, :ls_dwname, :ls_wname, 1, 0 , :sys_pblname) ; IF sqlca.SQLCode <> 0 THEN ls_msg = '插入单据格式重定向列表失败' + sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF ELSE ls_msg = '更新单据格式重定向列表失败' + sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF ELSE ls_msg = '更新数据窗口列表失败(2)' + sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF NEXT ext: IF rslt = 0 THEN ROLLBACK; MessageBox('错误',ls_msg, StopSign!, OK! ) ELSE COMMIT; MessageBox('提示','上传成功', Information!, OK! ) wf_retrdw(ls_temp) dw_pb.Retrieve() wf_retrpb() END IF end event type cb_2 from uo_imflatbutton within w_dw_update integer x = 1271 integer y = 1260 integer width = 151 integer height = 164 integer taborder = 40 boolean bringtotop = true string text = "删除" string normalpicname = "DELETE.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;if messagebox ("询问","是否确定要删除当前数据窗口吗?删除后将不能恢复",question!,yesno! ) = 2 then return String ls_temp ,ls_dwsyn,ls_msg DateTime ld_moddate Long k Long rslt = 1,i String ls_ctag dw_list.AcceptText() dw_lib.AcceptText() Long ls_product,ls_fromtype ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()] FOR i = 1 TO dw_list.RowCount() IF dw_list.Object.ch[i] = 1 THEN ls_ctag = dw_list.Object.ctag[i] IF LibraryDelete(ls_temp, ls_ctag, ImportDataWindow! ) = -1 THEN ls_msg = '删除' + ls_ctag + '失败' rslt = 0 GOTO ext END IF END IF NEXT ext: IF rslt = 0 THEN MessageBox('错误',ls_msg, StopSign!, OK! ) ELSE MessageBox('提示','删除成功', Information!, OK! ) wf_retrdw(ls_temp) END IF end event type cb_3 from uo_imflatbutton within w_dw_update integer x = 1010 integer y = 1260 integer width = 261 integer height = 164 integer taborder = 40 boolean bringtotop = true string text = "其他功能" string normalpicname = "setting.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu string menustr menustr="Text=导入重定向设置~tEvent=ue_import" if len(trim(menustr))<>0 then dmPopupMenu = Create m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(This, menustr) dmPopupMenu.mf_PopMenu() Destroy dmPopupMenu end if end event type cbx_4 from checkbox within w_dw_update integer x = 361 integer y = 1592 integer width = 224 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "全选" end type event clicked;Long i dw_pb.AcceptText() IF THIS.Checked THEN FOR i = 1 TO dw_pb.RowCount() dw_pb.Object.ch[i] = 1 NEXT ELSE FOR i = 1 TO dw_pb.RowCount() dw_pb.Object.ch[i] = 0 NEXT END IF end event event constructor;this.backcolor = 14215660 end event type cb_5 from uo_imflatbutton within w_dw_update integer x = 9 integer y = 1528 integer width = 165 integer height = 164 integer taborder = 20 boolean bringtotop = true string text = "刷新" string normalpicname = "refresh.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;wf_retrpb() end event type cb_7 from uo_imflatbutton within w_dw_update integer x = 174 integer y = 1528 integer width = 165 integer height = 164 integer taborder = 20 boolean bringtotop = true string text = "删除" string normalpicname = "DELETE.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF MessageBox ("询问","是否确定要删除当前数据窗口资料吗?删除后将不能恢复",question!,yesno! ) = 2 THEN RETURN String ls_msg,ls_filename Int i,rslt = 1 dw_pb.AcceptText() FOR i = 1 TO dw_pb.RowCount() IF dw_pb.Object.ch[i] = 1 THEN ls_filename = dw_pb.Object.Filename[i] DELETE FROM sys_autoudpb Where Filename = :ls_filename; IF sqlca.SQLCode <> 0 THEN ls_msg = '删除失败' + sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF NEXT ext: IF rslt = 0 THEN MessageBox('错误',ls_msg, StopSign!, OK! ) ROLLBACK; ELSE MessageBox('提示','删除成功', Information!, OK! ) COMMIT; dw_pb.Retrieve() wf_retrpb() END IF end event type p_resize from picture within w_dw_update integer x = 1125 integer y = 60 integer width = 32 integer height = 1188 boolean bringtotop = true string picturename = "w_resize_2.bmp" boolean focusrectangle = false end type event clicked;IF THIS.picturename = 'w_resize_1.bmp' THEN THIS.picturename = 'w_resize_2.bmp' THIS.X = 1125 dw_list.X = 1166 dw_lib.Visible = TRUE f_SetProfileString (sys_empid,dw_lib.DataObject, "iflib",'1') ELSE THIS.picturename = 'w_resize_1.bmp' THIS.X = 0 dw_list.X = p_resize.Width + 5 dw_lib.Visible = FALSE f_SetProfileString (sys_empid,dw_lib.DataObject, "iflib",'0') END IF PARENT.TriggerEvent(Resize!) end event type gb_1 from groupbox within w_dw_update integer y = 1464 integer width = 3547 integer height = 804 integer taborder = 30 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "数据库数据窗口" end type event constructor;this.backcolor = 14215660 end event type gb_2 from groupbox within w_dw_update integer width = 3547 integer height = 1444 integer taborder = 10 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "格式库文件数据窗口" end type event constructor; this.backcolor = 14215660 end event type ln_bar2 from line within w_dw_update boolean visible = false long linecolor = 16777215 integer linethickness = 4 integer beginx = 9 integer beginy = 172 integer endx = 3273 integer endy = 172 end type type ln_bar from line within w_dw_update boolean visible = false long linecolor = 268435456 integer linethickness = 4 integer beginy = 168 integer endx = 3200 integer endy = 168 end type type r_bar from rectangle within w_dw_update long linecolor = 16777215 integer linethickness = 4 long fillcolor = 1073741824 integer x = 3351 integer width = 87 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