$PBExportHeader$w_briefdef_edit.srw forward global type w_briefdef_edit from w_publ_base end type type gb_1 from groupbox within w_briefdef_edit end type type dw_brieftype from datawindow within w_briefdef_edit end type type cb_addtype from uo_imflatbutton within w_briefdef_edit end type type cb_modtype from uo_imflatbutton within w_briefdef_edit end type type cb_deltype from uo_imflatbutton within w_briefdef_edit end type type dw_brief from datawindow within w_briefdef_edit end type type cb_ok from uo_imflatbutton within w_briefdef_edit end type type cb_addbrief from uo_imflatbutton within w_briefdef_edit end type type cb_modbrief from uo_imflatbutton within w_briefdef_edit end type type cb_delbrief from uo_imflatbutton within w_briefdef_edit end type type cb_1 from uo_imflatbutton within w_briefdef_edit end type type cb_2 from uo_imflatbutton within w_briefdef_edit end type type cb_3 from uo_imflatbutton within w_briefdef_edit end type end forward global type w_briefdef_edit from w_publ_base integer width = 3502 integer height = 1736 string title = "凭证摘要" boolean minbox = false windowtype windowtype = response! long backcolor = 80269524 event retrieve_dw ( ) event retrieve_childdw ( ) gb_1 gb_1 dw_brieftype dw_brieftype cb_addtype cb_addtype cb_modtype cb_modtype cb_deltype cb_deltype dw_brief dw_brief cb_ok cb_ok cb_addbrief cb_addbrief cb_modbrief cb_modbrief cb_delbrief cb_delbrief cb_1 cb_1 cb_2 cb_2 cb_3 cb_3 end type global w_briefdef_edit w_briefdef_edit type variables s_brief s_brief_edit string rt_brief='' end variables event retrieve_dw;long lirow dw_brieftype.retrieve(sys_accsetid) lirow=dw_brieftype.insertrow(1) dw_brieftype.object.accsetid[lirow]=sys_accsetid dw_brieftype.object.brieftypeid[lirow]=0 dw_brieftype.object.typename[lirow]='[所有类别]' dw_brieftype.selectrow(0,false) dw_brieftype.selectrow(lirow,true) end event event retrieve_childdw;long uc_row,ls_brieftypeid uc_row=dw_brieftype.getrow() if uc_row<=0 then return ls_brieftypeid=dw_brieftype.object.brieftypeid[uc_row] dw_brief.retrieve(sys_accsetid,ls_brieftypeid) end event on w_briefdef_edit.create int iCurrent call super::create this.gb_1=create gb_1 this.dw_brieftype=create dw_brieftype this.cb_addtype=create cb_addtype this.cb_modtype=create cb_modtype this.cb_deltype=create cb_deltype this.dw_brief=create dw_brief this.cb_ok=create cb_ok this.cb_addbrief=create cb_addbrief this.cb_modbrief=create cb_modbrief this.cb_delbrief=create cb_delbrief this.cb_1=create cb_1 this.cb_2=create cb_2 this.cb_3=create cb_3 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.gb_1 this.Control[iCurrent+2]=this.dw_brieftype this.Control[iCurrent+3]=this.cb_addtype this.Control[iCurrent+4]=this.cb_modtype this.Control[iCurrent+5]=this.cb_deltype this.Control[iCurrent+6]=this.dw_brief this.Control[iCurrent+7]=this.cb_ok this.Control[iCurrent+8]=this.cb_addbrief this.Control[iCurrent+9]=this.cb_modbrief this.Control[iCurrent+10]=this.cb_delbrief this.Control[iCurrent+11]=this.cb_1 this.Control[iCurrent+12]=this.cb_2 this.Control[iCurrent+13]=this.cb_3 end on on w_briefdef_edit.destroy call super::destroy destroy(this.gb_1) destroy(this.dw_brieftype) destroy(this.cb_addtype) destroy(this.cb_modtype) destroy(this.cb_deltype) destroy(this.dw_brief) destroy(this.cb_ok) destroy(this.cb_addbrief) destroy(this.cb_modbrief) destroy(this.cb_delbrief) destroy(this.cb_1) destroy(this.cb_2) destroy(this.cb_3) end on event open;call super::open;dw_brief.settransobject(sqlca) dw_brieftype.settransobject(sqlca) this.triggerevent("retrieve_dw") this.triggerevent("retrieve_childdw") end event event close;CLOSEWITHRETURN(THIS,rt_brief) end event type cb_func from w_publ_base`cb_func within w_briefdef_edit integer x = 1157 integer y = 480 end type type cb_exit from w_publ_base`cb_exit within w_briefdef_edit integer x = 3127 integer y = 320 end type type gb_1 from groupbox within w_briefdef_edit integer x = 14 integer y = 88 integer width = 754 integer height = 1420 integer taborder = 20 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "摘要类别" end type type dw_brieftype from datawindow within w_briefdef_edit integer x = 46 integer y = 152 integer width = 690 integer height = 936 integer taborder = 60 boolean bringtotop = true string dataobject = "dw_brieftype_index" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rowfocuschanged;if currentrow<=0 then return this.selectrow(0,false) this.selectrow(currentrow,true) parent.triggerevent("retrieve_childdw") end event type cb_addtype from uo_imflatbutton within w_briefdef_edit integer x = 233 integer y = 1100 integer width = 311 integer height = 96 integer taborder = 70 boolean bringtotop = true string text = "增加" string normalpicname = "new.bmp" end type event clicked;IF NOT f_power_ind(1969,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF string new_brieftype_name='' long new_brieftypeid=0 long ls_newid string errmsg='' s_inputbox S_SREU S_SREU.TITLE='请输入新摘要类别名称(确定后将新建该类型的凭证摘要):' S_SREU.OLD_TEXT='[新类型名称]' openwithparm(w_inputbox,S_SREU) new_brieftype_name=Message.StringParm if trim(new_brieftype_name)='' or isnull(new_brieftype_name) then return // new_brieftype_name ls_newid=f_sys_scidentity(sys_accsetid,"cw_brieftype","brieftypeid",errmsg,TRUE,id_sqlca) if ls_newid<0 then messagebox(publ_operator,errmsg) rollback; end if INSERT INTO cw_brieftype (accsetid,brieftypeid,typename ) VALUES (:sys_accsetid,:ls_newid,:new_brieftype_name ) ; if sqlca.sqlcode<>0 then rollback; messagebox(publ_operator,'新建摘要类别"'+new_brieftype_name+'"失败,可能是名称已经存在或网络故障!') return end if commit; messagebox(publ_operator,'新建摘要类别操作成功,请对其进行初始化!') parent.triggerevent("retrieve_dw") parent.triggerevent("retrieve_childdw") end event type cb_modtype from uo_imflatbutton within w_briefdef_edit integer x = 233 integer y = 1244 integer width = 311 integer height = 96 integer taborder = 110 boolean bringtotop = true string text = "修改" string normalpicname = "open.bmp" end type event clicked;IF NOT f_power_ind(1969,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF string check long al_mtrlid,i=0,ls_brieftypeid,row,currentrow decimal ls_saleprice string al_name,al_rep,al_tele,new_brieftype_name row=dw_brieftype.getrow() if not row>0 then messagebox('错误','请选择当前摘要类别!') return end if al_name=dw_brieftype.object.typename[row] ls_brieftypeid=dw_brieftype.object.brieftypeid[row] s_inputbox S_SREU S_SREU.TITLE='请输入摘要类别新名称:' S_SREU.OLD_TEXT=al_name openwithparm(w_inputbox,S_SREU) new_brieftype_name=Message.StringParm if trim(new_brieftype_name)='' or isnull(new_brieftype_name) or trim(new_brieftype_name)=al_name then return update cw_brieftype set typename =:new_brieftype_name where (brieftypeid=:ls_brieftypeid ) and (accsetid=:sys_accsetid) ; if sqlca.sqlcode<>0 then rollback; messagebox('失败','修改名称操作失败,可能是新名称已经存在或网络故障!') return end if commit; messagebox('成功','摘要类别修改成功!') dw_brieftype.object.typename[row]=new_brieftype_name end event type cb_deltype from uo_imflatbutton within w_briefdef_edit integer x = 233 integer y = 1388 integer width = 311 integer height = 96 integer taborder = 130 boolean bringtotop = true string text = "删除" string normalpicname = "delete.bmp" end type event clicked;IF NOT f_power_ind(1969,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF string check long al_mtrlid,i=0,ls_brieftypeid,row,currentrow decimal ls_saleprice string al_name,al_rep,al_tele row=dw_brieftype.getrow() if not row>0 then messagebox(publ_operator,'请选择当前摘要类别!') return end if al_name=dw_brieftype.object.typename[row] IF MessageBox (publ_operator,"是否确定要删除摘要类别'"+al_name+"'吗?",Question!,YesNo! ) = 2 THEN RETURN ls_brieftypeid=dw_brieftype.object.brieftypeid[row] DELETE cw_brief where cw_brief.brieftypeid=:ls_brieftypeid and accsetid=:sys_accsetid; if sqlca.sqlcode<>0 then rollback; messagebox(publ_operator,'删除摘要类别明细操作失败!') RETURN end if DELETE cw_brieftype where cw_brieftype.brieftypeid=:ls_brieftypeid and accsetid=:sys_accsetid; if sqlca.sqlcode<>0 then rollback; messagebox(publ_operator,'删除摘要类别操作失败!') RETURN end if COMMIT; MESSAGEBOX(publ_operator,'摘要类别删除操作成功!') dw_brief.reset() parent.triggerevent("retrieve_dw") parent.triggerevent("retrieve_childdw") end event type dw_brief from datawindow within w_briefdef_edit integer x = 777 integer y = 152 integer width = 2290 integer height = 1420 integer taborder = 80 boolean bringtotop = true string dataobject = "dw_brief_index" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rowfocuschanged;if currentrow<=0 then return this.selectrow(0,false) this.selectrow(currentrow,true) end event event doubleclicked;cb_ok.triggerevent(clicked!) end event type cb_ok from uo_imflatbutton within w_briefdef_edit integer x = 3122 integer y = 196 integer width = 311 integer height = 96 integer taborder = 100 boolean bringtotop = true string normalpicname = "ok.bmp" end type event clicked;LONG LS_ROW LS_ROW=dw_brief.getrow() if LS_ROW<=0 then messagebox('系统提示','请先选择目标行!',StopSign!) return end if rt_brief=dw_brief.OBJECT.briefname[LS_ROW] CLOSE(PARENT) end event type cb_addbrief from uo_imflatbutton within w_briefdef_edit integer x = 3122 integer y = 1100 integer width = 311 integer height = 96 integer taborder = 90 boolean bringtotop = true string text = "增加" string normalpicname = "new.bmp" end type event clicked;IF NOT f_power_ind(1969,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF Long li_row li_row = dw_brieftype.GetRow() IF li_row <= 0 THEN MessageBox(publ_operator,'没有摘要类别,请先新建摘要类别') RETURN END IF s_brief_edit.edittype = 1 s_brief_edit.brieftypeid = dw_brieftype.Object.brieftypeid[li_row] s_brief_edit.briefid = 0 s_brief_edit.briefname = '' OpenWithParm(w_brief_edit,s_brief_edit) parent.triggerevent("retrieve_childdw") end event type cb_modbrief from uo_imflatbutton within w_briefdef_edit integer x = 3122 integer y = 1244 integer width = 311 integer height = 96 integer taborder = 120 boolean bringtotop = true string text = "修改" string normalpicname = "open.bmp" end type event clicked;IF NOT f_power_ind(1969,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF long li_row,li_childrow li_row=dw_brieftype.getrow() if li_row<=0 then messagebox(publ_operator,'没有摘要类别,请先新建摘要类别') return end if li_childrow=dw_brief.getrow() if li_childrow<=0 then messagebox(publ_operator,'没有修改凭证') return end if s_brief_edit.edittype=2 s_brief_edit.brieftypeid=dw_brief.object.brieftypeid[li_childrow] s_brief_edit.briefid=dw_brief.object.briefid[li_childrow] s_brief_edit.briefname=dw_brief.object.briefname[li_childrow] openwithparm(w_brief_edit,s_brief_edit) parent.triggerevent("retrieve_childdw") end event type cb_delbrief from uo_imflatbutton within w_briefdef_edit integer x = 3122 integer y = 1388 integer width = 311 integer height = 96 integer taborder = 140 boolean bringtotop = true string text = "删除" string normalpicname = "delete.bmp" end type event clicked;IF NOT f_power_ind(1969,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF Long li_row,ls_briefid li_row = dw_brief.GetRow() IF li_row <= 0 THEN MessageBox(publ_operator,'没有可删除的凭证摘要') RETURN END IF ls_briefid = dw_brief.Object.briefid[li_row] DELETE cw_brief Where cw_brief.briefid = :ls_briefid AND accsetid = :sys_accsetid; IF sqlca.SQLCode <> 0 THEN ROLLBACK; MessageBox(publ_operator,'删除凭证摘要操作失败!') RETURN END IF COMMIT; MessageBox(publ_operator,'凭证摘要删除操作成功!') PARENT.TriggerEvent("retrieve_childdw") end event type cb_1 from uo_imflatbutton within w_briefdef_edit integer x = 2688 integer y = 24 integer width = 384 integer height = 96 integer taborder = 40 boolean bringtotop = true string text = "清除默认科目" end type event clicked;IF NOT f_power_ind(1969,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF long li_row,ls_briefid li_row=dw_brief.getrow() if li_row<=0 then messagebox(publ_operator,'没有可删除的凭证摘要') return end if ls_briefid=dw_brief.object.briefid[li_row] update cw_brief set dftsubid = '' where cw_brief.briefid=:ls_briefid and accsetid=:sys_accsetid; if sqlca.sqlcode<>0 then rollback; messagebox(publ_operator,'更新凭证摘要默认科目操作失败!') RETURN end if COMMIT; MESSAGEBOX(publ_operator,'更新凭证摘要默认科目操作成功!') parent.triggerevent("retrieve_childdw") end event type cb_2 from uo_imflatbutton within w_briefdef_edit integer x = 2377 integer y = 24 integer width = 311 integer height = 96 integer taborder = 50 boolean bringtotop = true string text = "打印" string normalpicname = "print.bmp" end type event clicked;IF NOT f_power_ind(1969,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF open(w_rp_brief) end event type cb_3 from uo_imflatbutton within w_briefdef_edit integer x = 2066 integer y = 24 integer width = 311 integer height = 96 integer taborder = 40 boolean bringtotop = true string text = "刷新" string normalpicname = "refresh.bmp" end type event clicked;parent.triggerevent("retrieve_dw") parent.triggerevent("retrieve_childdw") end event