$PBExportHeader$w_credport_edit.srw forward global type w_credport_edit from window end type type cb_3 from commandbutton within w_credport_edit end type type cb_1 from commandbutton within w_credport_edit end type type dw_2 from datawindow within w_credport_edit end type type gb_2 from groupbox within w_credport_edit end type end forward global type w_credport_edit from window integer width = 2377 integer height = 1152 boolean titlebar = true string title = "自动凭证设置" boolean controlmenu = true windowtype windowtype = response! long backcolor = 67108864 string icon = "AppIcon!" boolean center = true cb_3 cb_3 cb_1 cb_1 dw_2 dw_2 gb_2 gb_2 end type global w_credport_edit w_credport_edit type variables string ins_sqlerrtext2,ins_sqlerrtext3 end variables on w_credport_edit.create this.cb_3=create cb_3 this.cb_1=create cb_1 this.dw_2=create dw_2 this.gb_2=create gb_2 this.Control[]={this.cb_3,& this.cb_1,& this.dw_2,& this.gb_2} end on on w_credport_edit.destroy destroy(this.cb_3) destroy(this.cb_1) destroy(this.dw_2) destroy(this.gb_2) end on event open;dw_2.settransobject(sqlca) //2.凭证字 datawindowchild childdw_credword dw_2.GetChild("credtype",childdw_credword) childdw_credword.SetTransObject (sqlca) childdw_credword.Retrieve(sys_accsetid) IF childdw_credword.RowCount() <= 0 THEN childdw_credword.InsertRow(0) END IF long ll_credid ll_credid = message.doubleparm if ll_credid > 0 then dw_2.retrieve(ll_credid) else dw_2.reset() end if end event type cb_3 from commandbutton within w_credport_edit integer x = 1166 integer y = 924 integer width = 311 integer height = 96 integer taborder = 30 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "取消" end type event clicked;close(parent) end event type cb_1 from commandbutton within w_credport_edit integer x = 731 integer y = 924 integer width = 311 integer height = 96 integer taborder = 20 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "保存" end type event clicked;Long cnt,i dw_2.AcceptText() cnt = 0 SELECT count(*) Into :cnt From cw_Credenceword Where accsetid = :sys_accsetid; IF sqlca.SQLCode <> 0 THEN MessageBox(publ_operator,'查询帐套是否有设置凭证字失败,'+sqlca.SQLErrText) RETURN END IF IF cnt > 0 THEN MessageBox(publ_operator,'请选择凭证字') RETURN END IF IF dw_2.Update() = -1 THEN ROLLBACK; MessageBox (publ_operator,"保存凭证参数设置失败! ~n"+ins_sqlerrtext2) RETURN END IF COMMIT; MessageBox (publ_operator,"保存成功!") Close(Parent) end event type dw_2 from datawindow within w_credport_edit integer x = 101 integer y = 84 integer width = 2167 integer height = 700 integer taborder = 20 string title = "none" string dataobject = "dw_credport_edit" boolean livescroll = true borderstyle borderstyle = stylelowered! end type event dberror;ins_sqlerrtext2 = SQLErrText RETURN 1 end event type gb_2 from groupbox within w_credport_edit integer x = 59 integer y = 20 integer width = 2258 integer height = 848 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