$PBExportHeader$w_sys_option_def.srw forward global type w_sys_option_def from w_publ_base end type type ln_bar from line within w_sys_option_def end type type ln_bar2 from line within w_sys_option_def end type type r_bar from rectangle within w_sys_option_def end type type tab_1 from tab within w_sys_option_def end type type tabpage_7 from userobject within tab_1 end type type dw_sys_option from u_dw_rbtnfilter within tabpage_7 end type type tv_sys_option from treeview within tabpage_7 end type type tabpage_7 from userobject within tab_1 dw_sys_option dw_sys_option tv_sys_option tv_sys_option end type type tabpage_3 from userobject within tab_1 end type type cbx_1 from checkbox within tabpage_3 end type type cb_7 from uo_imflatbutton within tabpage_3 end type type cb_6 from uo_imflatbutton within tabpage_3 end type type cb_1 from uo_imflatbutton within tabpage_3 end type type dw_4 from u_dw_rbtnfilter within tabpage_3 end type type tabpage_3 from userobject within tab_1 cbx_1 cbx_1 cb_7 cb_7 cb_6 cb_6 cb_1 cb_1 dw_4 dw_4 end type type tabpage_1 from userobject within tab_1 end type type cb_3 from uo_imflatbutton within tabpage_1 end type type dw_3 from u_dw_rbtnfilter within tabpage_1 end type type tabpage_1 from userobject within tab_1 cb_3 cb_3 dw_3 dw_3 end type type tabpage_4 from userobject within tab_1 end type type cbx_2 from checkbox within tabpage_4 end type type cb_9 from uo_imflatbutton within tabpage_4 end type type cb_8 from uo_imflatbutton within tabpage_4 end type type cb_5 from uo_imflatbutton within tabpage_4 end type type cb_4 from uo_imflatbutton within tabpage_4 end type type dw_1 from datawindow within tabpage_4 end type type tabpage_4 from userobject within tab_1 cbx_2 cbx_2 cb_9 cb_9 cb_8 cb_8 cb_5 cb_5 cb_4 cb_4 dw_1 dw_1 end type type tabpage_2 from userobject within tab_1 end type type cb_11 from uo_imflatbutton within tabpage_2 end type type cb_10 from uo_imflatbutton within tabpage_2 end type type cb_2 from uo_imflatbutton within tabpage_2 end type type dw_5 from u_dw_rbtnfilter within tabpage_2 end type type tabpage_2 from userobject within tab_1 cb_11 cb_11 cb_10 cb_10 cb_2 cb_2 dw_5 dw_5 end type type tab_1 from tab within w_sys_option_def tabpage_7 tabpage_7 tabpage_3 tabpage_3 tabpage_1 tabpage_1 tabpage_4 tabpage_4 tabpage_2 tabpage_2 end type end forward global type w_sys_option_def from w_publ_base integer width = 3611 integer height = 2380 string title = "系统选项设置" boolean maxbox = true windowstate windowstate = maximized! event retr_mx ( ) event retr_zlmx ( ) ln_bar ln_bar ln_bar2 ln_bar2 r_bar r_bar tab_1 tab_1 end type global w_sys_option_def w_sys_option_def type variables datawindow dw_1,dw_2,dw_3,dw_5 datawindow dw_sys_option String ins_sqlerrtext Boolean ls_update_flag = TRUE Long modifyrow_no = 0 string is_module boolean dw_edit_mode_hile = false end variables forward prototypes public function integer wf_dft_face () public subroutine wf_refresh_option (string arg_module) public function integer wf_hidecol_face () public subroutine wf_refresh_hilecol () end prototypes public function integer wf_dft_face ();if dw_edit_mode then tab_1.tabpage_3.cb_6.text="放弃[&E]" tab_1.tabpage_3.cb_1.text="保存[&S]" else tab_1.tabpage_3.cb_6.text="修改[&E]" tab_1.tabpage_3.cb_1.text="新建[&S]" end if tab_1.tabpage_3.cbx_1.enabled = not dw_edit_mode tab_1.tabpage_3.cb_1.triggerevent('ue_textchange') tab_1.tabpage_3.cb_6.triggerevent('ue_textchange') return 1 end function public subroutine wf_refresh_option (string arg_module);Long i Long ll_row uo_sys_option uo_opt uo_opt = CREATE uo_sys_option tab_1.tabpage_7.dw_sys_option.SetRedraw(FALSE) tab_1.tabpage_7.dw_sys_option.Reset() FOR i = 1 TO UpperBound(s_sys_opt) IF s_sys_opt[i].optionname = '' THEN CONTINUE if s_sys_opt[i].module_int = 100 THEN CONTINUE IF arg_module = '' OR & arg_module <> '' AND arg_module = s_sys_opt[i].module THEN IF Mid(sys_optionstr,Long(s_sys_opt[i].optionid),1) <> '1' THEN CONTINUE ll_row = tab_1.tabpage_7.dw_sys_option.InsertRow(0) tab_1.tabpage_7.dw_sys_option.Object.module[ll_row] = s_sys_opt[i].module tab_1.tabpage_7.dw_sys_option.Object.optionid[ll_row] = s_sys_opt[i].optionid tab_1.tabpage_7.dw_sys_option.Object.optionname[ll_row] = s_sys_opt[i].optionname tab_1.tabpage_7.dw_sys_option.Object.itype[ll_row] = s_sys_opt[i].itype String ls_value,arg_msg, ls_valuedisplay IF uo_opt.uof_get_sys_option_value(s_sys_opt[i].optionid,ls_value,arg_msg) = 0 THEN ls_value = s_sys_opt[i].dftvalue END IF tab_1.tabpage_7.dw_sys_option.Object.dftvalue[ll_row] = ls_value IF s_sys_opt[i].itype = 0 THEN IF ls_value = '0' THEN tab_1.tabpage_7.dw_sys_option.Object.valuedisplay[ll_row] = '否' ELSEIF ls_value = '1' THEN tab_1.tabpage_7.dw_sys_option.Object.valuedisplay[ll_row] = '是' ELSE tab_1.tabpage_7.dw_sys_option.Object.valuedisplay[ll_row] = '' END IF ELSEIF s_sys_opt[i].itype = 1 OR s_sys_opt[i].itype = 2 OR s_sys_opt[i].itype = 3 THEN tab_1.tabpage_7.dw_sys_option.Object.valuedisplay[ll_row] = ls_value ELSEIF s_sys_opt[i].itype = 4 THEN uo_opt.uof_get_sys_option_displayvalue(ls_value,s_sys_opt[i].dscrp,ls_valuedisplay,arg_msg) tab_1.tabpage_7.dw_sys_option.Object.valuedisplay[ll_row] = ls_valuedisplay ELSE tab_1.tabpage_7.dw_sys_option.Object.valuedisplay[ll_row] = '' END IF tab_1.tabpage_7.dw_sys_option.Object.module_int[ll_row] = s_sys_opt[i].module_int tab_1.tabpage_7.dw_sys_option.Object.dscrp[ll_row] = s_sys_opt[i].dscrp END IF NEXT tab_1.tabpage_7.dw_sys_option.SetSort('module_int asc,optionid asc') tab_1.tabpage_7.dw_sys_option.Sort() tab_1.tabpage_7.dw_sys_option.SetRedraw(TRUE) DESTROY uo_opt end subroutine public function integer wf_hidecol_face ();IF dw_edit_mode_hile THEN tab_1.tabpage_2.cb_10.Text = "放弃[&E]" tab_1.tabpage_2.cb_2.Enabled = TRUE ELSE tab_1.tabpage_2.cb_10.Text = "修改[&E]" tab_1.tabpage_2.cb_2.Enabled = FALSE END IF tab_1.tabpage_2.cb_10.TriggerEvent('ue_textchange') RETURN 1 end function public subroutine wf_refresh_hilecol ();Long i Long ll_row String ls_value String arg_msg uo_sys_option uo_opt uo_opt = CREATE uo_sys_option dw_5.SetRedraw(FALSE) dw_5.Reset() FOR i = 200 TO UpperBound(s_sys_opt) IF s_sys_opt[i].module_int <> 100 then continue // IF s_sys_opt[i].optionname = 'status' & // OR s_sys_opt[i].optionname = 'woodcode' & // OR s_sys_opt[i].optionname = 'pcode' & // OR s_sys_opt[i].optionname = 'mtrlsectype' & // OR s_sys_opt[i].optionname = 'zxmtrlmode' & // OR s_sys_opt[i].optionname = 'addqty' THEN ll_row = dw_5.GetRow() IF dw_5.GetRow() > 0 THEN IF dw_5.Object.optionid[ll_row] <> 0 THEN ll_row = dw_5.InsertRow (0) ELSE ll_row = dw_5.GetRow() END IF ELSE ll_row = dw_5.InsertRow (0) END IF //ll_row = dw_5.InsertRow(0) CHOOSE CASE s_sys_opt[i].optionname CASE 'status' dw_5.Object.optionname[ll_row] = sys_option_change_status CASE 'woodcode' dw_5.Object.optionname[ll_row] = sys_option_change_woodcode CASE 'pcode' dw_5.Object.optionname[ll_row] = sys_option_change_pcode CASE 'mtrlsectype' dw_5.Object.optionname[ll_row] = sys_option_change_mtrlsectype CASE 'zxmtrlmode' dw_5.Object.optionname[ll_row] = sys_option_change_zxmtrlmode CASE 'addqty' dw_5.Object.optionname[ll_row] = sys_option_change_addqty CASE 'plancode' dw_5.Object.optionname[ll_row] = "批号" CASE ELSE CONTINUE //dw_5.Object.optionname[ll_row] = s_sys_opt[i].optionname END CHOOSE dw_5.Object.optionid[ll_row] = Long(s_sys_opt[i].optionid) IF uo_opt.uof_get_sys_option_value(s_sys_opt[i].optionid,ls_value,arg_msg) = 0 THEN ls_value = s_sys_opt[i].dftvalue END IF dw_5.Object.Value[ll_row] = Long(ls_value) // END IF NEXT dw_5.SetSort('optionid asc') dw_5.Sort() dw_5.SetRedraw(TRUE) DESTROY uo_opt end subroutine on w_sys_option_def.create int iCurrent call super::create this.ln_bar=create ln_bar this.ln_bar2=create ln_bar2 this.r_bar=create r_bar this.tab_1=create tab_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.ln_bar this.Control[iCurrent+2]=this.ln_bar2 this.Control[iCurrent+3]=this.r_bar this.Control[iCurrent+4]=this.tab_1 end on on w_sys_option_def.destroy call super::destroy destroy(this.ln_bar) destroy(this.ln_bar2) destroy(this.r_bar) destroy(this.tab_1) end on event open;call super::open; wf_refresh_option('') dw_1 = tab_1.tabpage_1.dw_3 dw_2 = tab_1.tabpage_3.dw_4 dw_3 = tab_1.tabpage_4.dw_1 dw_5 = tab_1.tabpage_2.dw_5 dw_sys_option = tab_1.tabpage_7.dw_sys_option dw_1.SetTransObject(sqlca) dw_1.Retrieve() dw_2.SetTransObject(sqlca) dw_2.Retrieve(0) dw_3.SetTransObject(sqlca) dw_3.Retrieve() wf_refresh_hilecol() end event event resize;call super::resize;ln_bar.EndX = THIS.Width ln_bar2.EndX = THIS.Width r_bar.Width = THIS.Width tab_1.Width = THIS.Width - tab_1.X - 40 tab_1.Height = THIS.Height - tab_1.Y - 150 tab_1.tabpage_7.tv_sys_option.Height = tab_1.Height - 30 dw_sys_option.Height = tab_1.Height - 30 dw_sys_option.Width = THIS.Width - (3600 - 2231) dw_1.Width = THIS.Width - (3600 - 2898) dw_1.Height = THIS.Height - (2300 - 1852) - 50 dw_3.Width = THIS.Width - (3600 - 2898) dw_3.Height = THIS.Height - (2300 - 1852) - 50 tab_1.tabpage_3.dw_4.Width = THIS.Width - (3600 - 2898) tab_1.tabpage_3.dw_4.Height = THIS.Height - (2300 - 1852) - 50 dw_5.Width = THIS.Width - (3600 - 2898) dw_5.Height = THIS.Height - (2300 - 1852) - 50 end event type cb_func from w_publ_base`cb_func within w_sys_option_def boolean visible = false integer x = 165 integer width = 306 integer height = 164 string text = "危险功能" end type event cb_func::clicked;open(w_dangus) //Long ll_i //Int rslt = 1 // //Long ll_funcid,ll_parentid //Int li_functype //String ls_treename,ls_menuname // //INSERT INTO sys_func_pwr // (funcid,parentid,functype,treename,menuname) // Values(256,0,0,'销售管理','销售'); //IF sqlca.SQLCode <> 0 THEN // rslt = 0 // GOTO ext //END IF // //INSERT INTO sys_func_pwr // (funcid,parentid,functype,treename,menuname) // Values(257,0,0,'生产管理','生产'); //IF sqlca.SQLCode <> 0 THEN // rslt = 0 // GOTO ext //END IF // //INSERT INTO sys_func_pwr // (funcid,parentid,functype,treename,menuname) // Values(258,0,0,'仓库管理','仓库'); //IF sqlca.SQLCode <> 0 THEN // rslt = 0 // GOTO ext //END IF // //INSERT INTO sys_func_pwr // (funcid,parentid,functype,treename,menuname) // Values(259,0,0,'采购管理','采购'); //IF sqlca.SQLCode <> 0 THEN // rslt = 0 // GOTO ext //END IF // //INSERT INTO sys_func_pwr // (funcid,parentid,functype,treename,menuname) // Values(260,0,0,'人事工资','人事工资'); //IF sqlca.SQLCode <> 0 THEN // rslt = 0 // GOTO ext //END IF // //INSERT INTO sys_func_pwr // (funcid,parentid,functype,treename,menuname) // Values(261,0,0,'财务管理','财务'); // //INSERT INTO sys_func_pwr // (funcid,parentid,functype,treename,menuname) // Values(262,0,0,'系统维护','系统'); //IF sqlca.SQLCode <> 0 THEN // rslt = 0 // GOTO ext //END IF // //INSERT INTO sys_func_pwr // (funcid,parentid,functype,treename,menuname) // Values(263,0,9,'特殊权限','特殊权限'); //IF sqlca.SQLCode <> 0 THEN // rslt = 0 // GOTO ext //END IF // // // //FOR ll_i = 1 TO 255 // IF s_powerlinfo[ll_i].powerid = 0 THEN CONTINUE // ll_funcid = s_powerlinfo[ll_i].powerid // CHOOSE CASE s_powerlinfo[ll_i].powertype // CASE '销售管理' // ll_parentid = 256 // CASE '生产管理' // ll_parentid = 257 // CASE '仓库管理' // ll_parentid = 258 // CASE '采购管理' // ll_parentid = 259 // CASE '人事工资' // ll_parentid = 260 // CASE '财务管理' // ll_parentid = 261 // CASE '系统维护' // ll_parentid = 262 // CASE '特殊权限' // ll_parentid = 263 // END CHOOSE // ls_treename = s_powerlinfo[ll_i].powername // ls_menuname = s_powerlinfo[ll_i].powername // // INSERT INTO sys_func_pwr // (funcid,parentid,functype,treename,menuname) // Values(:ll_funcid,:ll_parentid,9,:ls_treename,:ls_menuname); // // IF sqlca.SQLCode <> 0 THEN // rslt = 0 // GOTO ext // END IF // //NEXT // //ext : //IF rslt = 0 THEN // ROLLBACK; // MessageBox('','error') //ELSE // COMMIT; // MessageBox('','ok') //END IF // // // // end event type cb_exit from w_publ_base`cb_exit within w_sys_option_def integer x = 0 integer width = 165 integer height = 164 integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type ln_bar from line within w_sys_option_def long linecolor = 268435456 integer linethickness = 4 integer beginy = 172 integer endx = 2007 integer endy = 172 end type type ln_bar2 from line within w_sys_option_def long linecolor = 16777215 integer linethickness = 4 integer beginy = 176 integer endx = 2039 integer endy = 176 end type type r_bar from rectangle within w_sys_option_def long linecolor = 16777215 integer linethickness = 4 long fillcolor = 1073741824 integer x = 2139 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 type tab_1 from tab within w_sys_option_def integer y = 184 integer width = 3529 integer height = 1988 integer taborder = 30 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long backcolor = 134217739 boolean raggedright = true boolean boldselectedtext = true boolean perpendiculartext = true tabposition tabposition = tabsonleft! integer selectedtab = 1 tabpage_7 tabpage_7 tabpage_3 tabpage_3 tabpage_1 tabpage_1 tabpage_4 tabpage_4 tabpage_2 tabpage_2 end type on tab_1.create this.tabpage_7=create tabpage_7 this.tabpage_3=create tabpage_3 this.tabpage_1=create tabpage_1 this.tabpage_4=create tabpage_4 this.tabpage_2=create tabpage_2 this.Control[]={this.tabpage_7,& this.tabpage_3,& this.tabpage_1,& this.tabpage_4,& this.tabpage_2} end on on tab_1.destroy destroy(this.tabpage_7) destroy(this.tabpage_3) destroy(this.tabpage_1) destroy(this.tabpage_4) destroy(this.tabpage_2) end on event doubleclicked;cb_func.Visible = NOT cb_func.Visible end event type tabpage_7 from userobject within tab_1 integer x = 608 integer y = 16 integer width = 2903 integer height = 1956 long backcolor = 134217739 string text = "系统选项" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_sys_option dw_sys_option tv_sys_option tv_sys_option end type on tabpage_7.create this.dw_sys_option=create dw_sys_option this.tv_sys_option=create tv_sys_option this.Control[]={this.dw_sys_option,& this.tv_sys_option} end on on tabpage_7.destroy destroy(this.dw_sys_option) destroy(this.tv_sys_option) end on type dw_sys_option from u_dw_rbtnfilter within tabpage_7 integer x = 667 integer width = 2231 integer height = 1952 integer taborder = 20 string dataobject = "dw_sys_option" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) END IF end event event doubleclicked;call super::doubleclicked;IF row > 0 THEN s_sys_option ls_s_opt,ls_s_opt_ref ls_s_opt.optionid = THIS.Object.optionid[row] ls_s_opt.optionname = THIS.Object.optionname[row] ls_s_opt.dftvalue = THIS.Object.dftvalue[row] ls_s_opt.itype = THIS.Object.itype[row] ls_s_opt.dscrp = THIS.Object.dscrp[row] CHOOSE CASE ls_s_opt.itype CASE 0 OpenWithParm(w_sys_option_def_itype0,ls_s_opt) CASE 1 OpenWithParm(w_sys_option_def_itype1,ls_s_opt) CASE 2 OpenWithParm(w_sys_option_def_itype2,ls_s_opt) CASE 3 OpenWithParm(w_sys_option_def_itype3,ls_s_opt) CASE 4 OpenWithParm(w_sys_option_def_itype4,ls_s_opt) END CHOOSE ls_s_opt_ref = Message.PowerObjectParm IF ls_s_opt_ref.ifset = 0 THEN RETURN String arg_msg uo_sys_option uo_opt uo_opt = CREATE uo_sys_option IF uo_opt.uof_add_sys_option(ls_s_opt.optionid,& ls_s_opt.optionname,ls_s_opt_ref.dftvalue,arg_msg,TRUE) = 0 THEN MessageBox('提示',arg_msg) DESTROY uo_opt RETURN END IF uo_opt.uof_sys_option() DESTROY uo_opt THIS.Object.dftvalue[row] = ls_s_opt_ref.dftvalue IF ls_s_opt_ref.valuedisplay <> '' THEN THIS.Object.valuedisplay[row] = ls_s_opt_ref.valuedisplay ELSE THIS.Object.valuedisplay[row] = ls_s_opt_ref.dftvalue END IF //wf_refresh_option(is_module) END IF end event type tv_sys_option from treeview within tabpage_7 integer y = 4 integer width = 663 integer height = 1952 integer taborder = 10 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! boolean linesatroot = true string picturename[] = {"graphics\content.BMP","graphics\Shell32 005.bmp"} long picturemaskcolor = 536870912 long statepicturemaskcolor = 536870912 end type event constructor;Long ll_handl ll_handl = THIS.InsertItemLast(0,sys_message_title,1) THIS.InsertItemLast(ll_handl,'系统',2) THIS.InsertItemLast(ll_handl,'应收,应付',2) //THIS.InsertItemLast(ll_handl,'应付',2) THIS.InsertItemLast(ll_handl,'销售',2) THIS.InsertItemLast(ll_handl,'采购,外协',2) THIS.InsertItemLast(ll_handl,'仓库',2) THIS.InsertItemLast(ll_handl,'生产辅助',2) THIS.InsertItemLast(ll_handl,'工资',2) THIS.ExpandItem(ll_handl) end event event selectionchanged;Long ll_hand treeviewitem tvi ll_hand = THIS.FindItem(CurrentTreeItem!,0) IF ll_hand = 1 THEN is_module = '' ELSE THIS.GetItem(ll_hand,tvi) is_module = tvi.Label END IF wf_refresh_option(is_module) end event type tabpage_3 from userobject within tab_1 event create ( ) event destroy ( ) integer x = 608 integer y = 16 integer width = 2903 integer height = 1956 long backcolor = 134217739 string text = "单据打印格式重定向" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 cbx_1 cbx_1 cb_7 cb_7 cb_6 cb_6 cb_1 cb_1 dw_4 dw_4 end type on tabpage_3.create this.cbx_1=create cbx_1 this.cb_7=create cb_7 this.cb_6=create cb_6 this.cb_1=create cb_1 this.dw_4=create dw_4 this.Control[]={this.cbx_1,& this.cb_7,& this.cb_6,& this.cb_1,& this.dw_4} end on on tabpage_3.destroy destroy(this.cbx_1) destroy(this.cb_7) destroy(this.cb_6) destroy(this.cb_1) destroy(this.dw_4) end on type cbx_1 from checkbox within tabpage_3 integer x = 951 integer y = 24 integer width = 411 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "显示默认格式" end type event clicked;int li_dft if this.checked then cb_1.enabled = false cb_6.enabled = false cb_7.enabled = false li_dft = -1 else cb_1.enabled = true cb_6.enabled = true cb_7.enabled = true li_dft = 0 end if dw_4.Retrieve(li_dft) end event type cb_7 from uo_imflatbutton within tabpage_3 integer x = 603 integer height = 96 integer taborder = 60 string text = "删除" string normalpicname = "delete.bmp" end type event clicked;call super::clicked;IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN RETURN END IF String arg_msg IF DW_2.GetRow() <= 0 THEN MessageBox('','没有操作目标记录!') RETURN END IF DW_2.SetRedraw (FALSE) DW_2.DeleteRow (0) DW_2.TriggerEvent (RowFocusChanged!) IF DW_2.Update() = -1 THEN ROLLBACK; MessageBox ('系统提示',"删除记录操作失败!",Exclamation!,OK!) ELSE COMMIT; END IF DW_2.SetRedraw (TRUE) end event type cb_6 from uo_imflatbutton within tabpage_3 integer x = 302 integer height = 96 integer taborder = 50 string text = "修改" string normalpicname = "open.bmp" end type event clicked;call super::clicked;Long i IF dw_edit_mode THEN IF dw_2.GetItemStatus(dw_2.GetRow(), 0, Primary!) = NewModified! OR dw_2.GetItemStatus(dw_2.GetRow(), 0, Primary!) = New! THEN dw_2.DeleteRow(dw_2.GetRow()) ELSE dw_2.ReselectRow(dw_2.GetRow()) END IF FOR i = 1 TO 12 dw_2.SetTabOrder ( i, 0 ) NEXT modifyrow_no = 0 ELSE modifyrow_no = dw_2.GetRow() FOR i = 1 TO 12 dw_2.SetTabOrder ( i, i*10 ) NEXT dw_2.SetFocus() dw_2.SelectRow(0,FALSE) dw_2.ScrollToRow (modifyrow_no) dw_2.SelectRow(modifyrow_no,TRUE) END IF dw_edit_mode = NOT dw_edit_mode WF_dft_face() end event type cb_1 from uo_imflatbutton within tabpage_3 integer height = 96 integer taborder = 30 string text = "增加" string normalpicname = "new.bmp" end type event clicked;call super::clicked;Long ll_newid,i String errmsg dw_2.AcceptText() IF dw_edit_mode THEN dw_2.AcceptText() IF dw_2.GetNextModified(0, Primary!) = 0 THEN MessageBox('提示','没有任何修改,不可以保存!', Information!, OK! ) RETURN END IF IF Trim(dw_2.Object.dft_new_dwname[dw_2.GetRow()]) = '' THEN MessageBox('提示','请输入新打印dw', Information!, OK! ) RETURN END IF IF Trim(dw_2.Object.chnname[dw_2.GetRow()]) = '' THEN MessageBox('提示','请输入中文名称', Information!, OK! ) RETURN END IF IF Trim(dw_2.Object.dwtype[dw_2.GetRow()]) = '' THEN MessageBox('提示','请输入窗口名称', Information!, OK! ) RETURN END IF IF Trim(dw_2.Object.pblname[dw_2.GetRow()]) = '' THEN MessageBox('提示','请输入所属格式库文件', Information!, OK! ) RETURN END IF IF dw_2.Object.dwprintid[dw_2.GetRow()] = 0 THEN ll_newid = f_sys_scidentity(0,"sys_dft_dwprint_dynamic","dwprintid",errmsg,FALSE,sqlca) IF ll_newid <= 0 THEN MessageBox('错误',errmsg, StopSign!, OK! ) RETURN ELSE dw_2.Object.dwprintid[dw_2.GetRow()] = ll_newid END IF END IF END IF IF dw_edit_mode THEN String ls_errmsg IF dw_2.Update() = -1 THEN IF Pos(ins_sqlerrtext,"Cannot insert duplicate key row") > 0 THEN ls_errmsg = "关键内容重复" ELSE ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext END IF ROLLBACK; MessageBox ('提示',ls_errmsg+",保存操作失败!",Exclamation!,OK!) LS_UPDATE_FLAG = FALSE RETURN ELSE COMMIT; FOR i = 1 TO 12 dw_2.SetTabOrder ( i, 0 ) NEXT LS_UPDATE_FLAG = TRUE END IF ins_sqlerrtext = "" ELSE Long li_row, li_cur_row li_cur_row = dw_2.GetRow() li_row = dw_2.InsertRow (0) FOR i = 1 TO 12 dw_2.SetTabOrder ( i, i*10 ) NEXT dw_2.SelectRow(0,FALSE) dw_2.ScrollToRow (li_row) dw_2.SelectRow(li_row,TRUE) dw_2.SetFocus() modifyrow_no = li_row END IF dw_edit_mode = NOT dw_edit_mode WF_dft_FACE() end event type dw_4 from u_dw_rbtnfilter within tabpage_3 integer y = 100 integer width = 2898 integer height = 1852 integer taborder = 20 string dataobject = "dw_dft_dwprint_dynamic" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode then return 1 end event event rowfocuschanged;call super::rowfocuschanged;IF modifyrow_no >0 AND dw_edit_mode THEN THIS.SETROW(modifyrow_no) THIS.ScrollToRow(modifyrow_no) else this.selectrow(0,false) this.selectrow(currentrow,true) END IF end event event doubleclicked;call super::doubleclicked;if dw_edit_mode then if dwo.name = "dwtype" then open(w_system_window_ch) long ll_mainid string ls_win ll_mainid = message.doubleparm if ll_mainid > 0 then if UpperBound(s_sys_win_open) >= ll_mainid then ls_win = s_sys_win_open[ll_mainid].Name this.object.dwtype[row] = ls_win end if end if end if end if end event type tabpage_1 from userobject within tab_1 event create ( ) event destroy ( ) integer x = 608 integer y = 16 integer width = 2903 integer height = 1956 long backcolor = 134217739 string text = "单据打印样式" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 cb_3 cb_3 dw_3 dw_3 end type on tabpage_1.create this.cb_3=create cb_3 this.dw_3=create dw_3 this.Control[]={this.cb_3,& this.dw_3} end on on tabpage_1.destroy destroy(this.cb_3) destroy(this.dw_3) end on type cb_3 from uo_imflatbutton within tabpage_1 integer height = 96 integer taborder = 30 string text = "删除" string normalpicname = "delete.bmp" end type event clicked;call super::clicked;if dw_1.getrow()<=0 then messagebox("提示","请选择要删除的样式", Information!, OK! ) return end if IF MessageBox ("询问","是否确定要删除当前打印样式吗?",Question!,YesNo! ) = 2 THEN RETURN string ls_dname,ls_dwname ls_dname = dw_1.object.dname[dw_1.getrow()] ls_dwname = dw_1.object.dwname [dw_1.getrow()] delete from sys_dwnSyntax where dname = :ls_dname and dwname = :ls_dwname; if sqlca.sqlcode <> 0 then messagebox("提示","删除的打印样式:"+ls_dwname+"/"+ls_dname+'失败 ~n'+sqlca.sqlerrtext, Information!, OK! ) rollback; return end if commit; dw_1.retrieve() messagebox("提示","删除的打印样式:"+ls_dwname+"/"+ls_dname+'成功', Information!, OK! ) end event type dw_3 from u_dw_rbtnfilter within tabpage_1 integer y = 100 integer width = 2898 integer height = 1852 integer taborder = 20 string dataobject = "dw_sys_option_def_dwnsyntax" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) end event type tabpage_4 from userobject within tab_1 integer x = 608 integer y = 16 integer width = 2903 integer height = 1956 long backcolor = 134217739 string text = "附加文件" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 cbx_2 cbx_2 cb_9 cb_9 cb_8 cb_8 cb_5 cb_5 cb_4 cb_4 dw_1 dw_1 end type on tabpage_4.create this.cbx_2=create cbx_2 this.cb_9=create cb_9 this.cb_8=create cb_8 this.cb_5=create cb_5 this.cb_4=create cb_4 this.dw_1=create dw_1 this.Control[]={this.cbx_2,& this.cb_9,& this.cb_8,& this.cb_5,& this.cb_4,& this.dw_1} end on on tabpage_4.destroy destroy(this.cbx_2) destroy(this.cb_9) destroy(this.cb_8) destroy(this.cb_5) destroy(this.cb_4) destroy(this.dw_1) end on type cbx_2 from checkbox within tabpage_4 integer x = 951 integer y = 24 integer width = 411 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "显示系统文件" end type event clicked; String ls_list String ls_filename Long ll_pos, ll_row IF This.Checked THEN dw_1.Reset() ls_list = getlibrarylist () ll_pos = Pos(ls_list, ',') DO WHILE ll_pos > 0 ls_filename = Left(ls_list, ll_pos - 1) ls_list = Mid(ls_list, ll_pos + 1) ll_row = dw_1.Find("libname = '"+ls_filename+"'", 1, dw_1.RowCount()) IF Not ll_row > 0 THEN ll_row = dw_1.InsertRow(0) dw_1.Object.libname[ll_row] = ls_filename END IF ll_pos = Pos(ls_list, ',') LOOP ls_filename = ls_list ll_row = dw_1.InsertRow(0) dw_1.Object.libname[ll_row] = ls_filename ELSE dw_1.Retrieve() END IF //dw_4.Retrieve(li_dft) end event type cb_9 from uo_imflatbutton within tabpage_4 boolean visible = false integer x = 905 integer height = 96 integer taborder = 70 string text = "测试连接" string normalpicname = "update.bmp" end type event clicked;call super::clicked; if f_setliblist()=1 then messagebox('','ok') else messagebox('','no') end if end event type cb_8 from uo_imflatbutton within tabpage_4 integer x = 603 integer height = 96 integer taborder = 70 string text = "删除" string normalpicname = "delete.bmp" end type event clicked;call super::clicked;IF MessageBox ('询问',"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN RETURN END IF String arg_msg IF DW_3.GetRow() <= 0 THEN MessageBox('提示','没有操作目标记录!', Information!, OK! ) RETURN END IF DW_3.SetRedraw (False) DW_3.DeleteRow (0) DW_3.TriggerEvent (RowFocusChanged!) IF DW_3.Update() = -1 THEN ROLLBACK; MessageBox ('提示',"删除记录操作失败!",Exclamation!,OK!) ELSE COMMIT; END IF DW_3.SetRedraw (True) end event type cb_5 from uo_imflatbutton within tabpage_4 integer height = 96 integer taborder = 60 string text = "增加" string normalpicname = "new.bmp" end type event clicked;call super::clicked;dw_3.insertrow(0) end event type cb_4 from uo_imflatbutton within tabpage_4 integer x = 302 integer height = 96 integer taborder = 40 string text = "保存" string normalpicname = "save.bmp" end type event clicked;call super::clicked;Long ll_i dw_3.AcceptText() FOR ll_i = 1 TO dw_3.RowCount() IF Trim(dw_3.Object.libname[ll_i]) = '' THEN MessageBox('提示','请输入LIBRARY名称', Information!, OK! ) RETURN END IF NEXT IF dw_3.Update(TRUE,FALSE) = -1 THEN MessageBox('错误','保存资料出错!'+sqlca.SQLErrText, StopSign!, OK! ) ROLLBACK; RETURN END IF COMMIT; MessageBox('提示','保存资料成功!', Information!, OK! ) end event type dw_1 from datawindow within tabpage_4 integer y = 100 integer width = 2898 integer height = 1852 integer taborder = 70 string title = "none" string dataobject = "dw_setliblist" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type type tabpage_2 from userobject within tab_1 integer x = 608 integer y = 16 integer width = 2903 integer height = 1956 long backcolor = 134217739 string text = "单据字段隐藏选项" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 cb_11 cb_11 cb_10 cb_10 cb_2 cb_2 dw_5 dw_5 end type on tabpage_2.create this.cb_11=create cb_11 this.cb_10=create cb_10 this.cb_2=create cb_2 this.dw_5=create dw_5 this.Control[]={this.cb_11,& this.cb_10,& this.cb_2,& this.dw_5} end on on tabpage_2.destroy destroy(this.cb_11) destroy(this.cb_10) destroy(this.cb_2) destroy(this.dw_5) end on type cb_11 from uo_imflatbutton within tabpage_2 integer x = 603 integer width = 421 integer height = 96 integer taborder = 60 string text = "重置布局" string normalpicname = "delete.BMP" end type event clicked;call super::clicked;IF MessageBox('提示','是否确定删除当前所有用户的单据布局?', Question!, YesNo! ) = 2 THEN RETURN DELETE From sys_user_dwnSyntax; IF sqlca.SQLCode <> 0 THEN ROLLBACK; MessageBox('错误','删除用户单据布局失败', StopSign!, OK! ) RETURN ELSE COMMIT; MessageBox('提示','删除用户单据布局成功', Information!, OK! ) RETURN END IF end event type cb_10 from uo_imflatbutton within tabpage_2 integer x = 302 integer height = 96 integer taborder = 30 string text = "修改" string normalpicname = "open.bmp" end type event clicked;call super::clicked;Long i IF dw_edit_mode_hile THEN FOR i = 1 TO 1 dw_5.SetTabOrder ( i, 0 ) NEXT modifyrow_no = 0 ELSE modifyrow_no = dw_5.GetRow() FOR i = 1 TO 1 dw_5.SetTabOrder ( i, i*10 ) NEXT dw_5.SetFocus() dw_5.SelectRow(0,FALSE) dw_5.ScrollToRow (modifyrow_no) dw_5.SelectRow(modifyrow_no,TRUE) END IF dw_edit_mode_hile = NOT dw_edit_mode_hile WF_hidecol_face() end event type cb_2 from uo_imflatbutton within tabpage_2 integer height = 96 integer taborder = 10 boolean enabled = false string text = "保存" string normalpicname = "new.bmp" end type event clicked;call super::clicked;Long ll_newid,i String ll_optionid,ll_value String errmsg,ls_optionname,arg_msg dw_5.AcceptText() uo_sys_option uo_opt uo_opt = CREATE uo_sys_option FOR i = 1 TO dw_5.RowCount() ll_value = String(dw_5.Object.Value[i]) ll_optionid = String(dw_5.Object.optionid[i]) ls_optionname = dw_5.Object.optionname[i] IF uo_opt.uof_add_sys_option(ll_optionid,& ls_optionname,ll_value,arg_msg,TRUE) = 0 THEN MessageBox('提示',arg_msg) DESTROY uo_opt RETURN END IF NEXT uo_opt.uof_sys_option() DESTROY uo_opt FOR i = 1 TO 1 dw_5.SetTabOrder ( i, 0 ) NEXT dw_edit_mode_hile = NOT dw_edit_mode_hile WF_hidecol_FACE() end event type dw_5 from u_dw_rbtnfilter within tabpage_2 integer x = 5 integer y = 100 integer width = 2231 integer height = 1820 integer taborder = 70 string dataobject = "dw_sys_option_hidecol" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_setposition_use = true end type event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) END IF end event