📄 w_mcyhz_maintain1.srw
字号:
$PBExportHeader$w_mcyhz_maintain1.srw
$PBExportComments$企业名称核准修改
forward
global type w_mcyhz_maintain1 from window
end type
type st_1 from statictext within w_mcyhz_maintain1
end type
type cb_3 from commandbutton within w_mcyhz_maintain1
end type
type cb_exit from commandbutton within w_mcyhz_maintain1
end type
type cb_condition from commandbutton within w_mcyhz_maintain1
end type
type cb_delete from commandbutton within w_mcyhz_maintain1
end type
type cb_cancel from commandbutton within w_mcyhz_maintain1
end type
type cb_save from commandbutton within w_mcyhz_maintain1
end type
type cb_add from commandbutton within w_mcyhz_maintain1
end type
type dw_1 from datawindow within w_mcyhz_maintain1
end type
type tab_1 from tab within w_mcyhz_maintain1
end type
type tabpage_1 from userobject within tab_1
end type
type dw_2 from datawindow within tabpage_1
end type
type tabpage_1 from userobject within tab_1
dw_2 dw_2
end type
type tabpage_2 from userobject within tab_1
end type
type cb_4 from commandbutton within tabpage_2
end type
type cb_2 from commandbutton within tabpage_2
end type
type cb_1 from commandbutton within tabpage_2
end type
type dw_3 from datawindow within tabpage_2
end type
type tabpage_2 from userobject within tab_1
cb_4 cb_4
cb_2 cb_2
cb_1 cb_1
dw_3 dw_3
end type
type tab_1 from tab within w_mcyhz_maintain1
tabpage_1 tabpage_1
tabpage_2 tabpage_2
end type
end forward
shared variables
boolean flag_qymc=false
end variables
global type w_mcyhz_maintain1 from window
integer y = 4
integer width = 3657
integer height = 2404
boolean titlebar = true
string title = "名称预核准表维护"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
windowtype windowtype = response!
long backcolor = 80269524
st_1 st_1
cb_3 cb_3
cb_exit cb_exit
cb_condition cb_condition
cb_delete cb_delete
cb_cancel cb_cancel
cb_save cb_save
cb_add cb_add
dw_1 dw_1
tab_1 tab_1
end type
global w_mcyhz_maintain1 w_mcyhz_maintain1
type variables
long current_row
boolean insert_flag
string wv_qymc, wv_zh // 企业名称,字号,
string wv_hztzs, wv_zhpy // 核准通知书文号, 字号拼音
integer mchzblq //名称核准保留期
string ws_enterprise_type // 临时企业类型
string nbxh,pinyin_string
end variables
forward prototypes
public function boolean delete_qymccx (string nbxh1)
public function boolean wf_insert_record (long i)
public function boolean wf_update_record (long i)
end prototypes
public function boolean delete_qymccx (string nbxh1);// 删除企业名称查询表对应记录
delete from a_qymccx
where nbxh = : nbxh1;
if sqlca.sqlcode <> 0 then
beep(3)
messagebox("错误","企业名称查询表中没有对应的记录存在,删除失败!")
return false
else
end if
return true
end function
public function boolean wf_insert_record (long i);// 插入QYMCCX 表数据
long ll_i
string ls_djjg, ls_qylx, ls_qylx1, ls_tmp_qylx, ls_jbdw
string ls_qymc, ls_zh, ls_mcjc, ls_wwmc, ls_hydm
string ls_zhpy, ls_mclx, ls_hyml
datetime ldt_blqx_begin, ldt_blqx_end, ldt_hzrq
date ld_tmp_date, ld_now_date
string ls_zs
//名称类型
ls_mclx = '1'
//新记录且已输入值
//当前记录的内部序号为空,需要生成内部序号
ls_jbdw = tab_1.tabpage_1.dw_2.getitemstring(i, "jbdw")
ls_qylx1=tab_1.tabpage_1.dw_2.getitemstring(i, "qylx")
ls_qylx = left(ls_qylx1 , 2)
// 根据企业类型,设置类型码
CHOOSE CASE left(ls_qylx,1)
CASE '1','2'
// 公司、分公司
ls_tmp_qylx = '6'
CASE '3','4'
// 内资法人、营业、办事机构
ls_tmp_qylx = '2'
CASE '5','6','7'
// 外商
ls_tmp_qylx = '4'
CASE '9'
choose case ls_qylx
case '91'
ls_tmp_qylx = '2'
case '90'
ls_tmp_qylx = '7'
case '92','93'
ls_tmp_qylx = '5'
case '94'
ls_tmp_qylx = '8'
case '99'
ls_tmp_qylx = '9'
end choose
END CHOOSE
//首先生成一个新的7位流水号
//利用序列发生器生成一个新的序列号
//select nbxh.nextval into :tmp_long from dual;
nbxhlbm=ls_tmp_qylx
ll_i=fn_nbxh()//得到生成内部序号的情况
if ll_i<0 then
Messagebox("错 误 信 息","系统序列值发生错误,请重新进入系统!")//失败
end if
//新的内部序号=当前登记机关码(6位) + 企业类型码(1位) + '00' + 流水号(7位)
//nbxh= djjg + tmp_qylx + '00'+ lsh
nbxh=qy.nbxh
tab_1.tabpage_1.dw_2.setitem(i, "nbxh", nbxh)
ls_qymc = tab_1.tabpage_1.dw_2.getitemstring(i, "qymc")
ls_zh = tab_1.tabpage_1.dw_2.getitemstring(i, "zh")
ls_mcjc = tab_1.tabpage_1.dw_2.getitemstring(i, "mcjc")
ls_wwmc = tab_1.tabpage_1.dw_2.getitemstring(i, "wwmc")
ls_hydm = tab_1.tabpage_1.dw_2.getitemstring(i, "hydm")
ls_zs = tab_1.tabpage_1.dw_2.getitemstring(i, "a_qymccx_zs")
// 行业门类
ls_hyml = left(ls_hydm,1)
ldt_hzrq = tab_1.tabpage_1.dw_2.getitemdatetime(i, "hzrq")
ls_zhpy = tab_1.tabpage_1.dw_2.getitemstring(i, "zhpy")
// 设置名称保留期
ldt_blqx_begin = ldt_hzrq
ld_tmp_date = date(ldt_hzrq)
ldt_blqx_end = datetime(relativedate(ld_tmp_date, mchzblq))
ld_now_date = today()
// 在插入QYMCCX表中相应记录
INSERT INTO a_qymccx
( nbxh,
qymc,
wwmc,
zh,
zhpy,
mcjc,
qylx,
hydm,
hzrq,
djjg,
blqx1,
blqx2,
mclx,
gxdw,
czrq,
hyml,
hmry,
zs,
mchzbz,
mccctgbz)
VALUES ( :nbxh,
:ls_qymc,
:ls_wwmc,
:ls_zh,
:ls_zhpy,
:ls_mcjc,
:ls_qylx1,
:ls_hydm,
:ldt_hzrq,
:ls_djjg,
:ldt_blqx_begin,
:ldt_blqx_end,
:ls_mclx,
:ls_jbdw,
:ld_now_date,
:ls_hyml,
:czy,
:ls_zs,
'4',
'2');
IF sqlca.sqlcode <> 0 then
beep(3)
messagebox("错误",sqlca.sqlerrtext)
return false
end if
return true
end function
public function boolean wf_update_record (long i);// 修改QYMCCX 表数据
string ls_djjg, ls_qylx, ls_tmp_qylx, ls_jbdw
string ls_qymc, ls_zh, ls_mcjc, ls_wwmc, ls_hydm,ls_qylx1
string ls_zhpy, ls_hyml
datetime ldt_hzrq
date ld_now_date
string ls_zs
// 取得DW当前值
ls_djjg = dw_1.getitemstring(i, "djjg")
ls_jbdw = dw_1.getitemstring(i, "jbdw")
ls_qylx1=dw_1.getitemstring(i, "qylx")
ls_qylx = left(dw_1.getitemstring(i, "qylx") , 2)
ls_qymc = dw_1.getitemstring(i, "qymc")
ls_zh = dw_1.getitemstring(i, "zh")
ls_mcjc = dw_1.getitemstring(i, "mcjc")
ls_wwmc = dw_1.getitemstring(i, "wwmc")
ls_hydm = dw_1.getitemstring(i, "hydm")
ls_hyml = left(ls_hydm,1)
ldt_hzrq = dw_1.getitemdatetime(i, "hzrq")
ls_zhpy = dw_1.getitemstring(i, "zhpy")
nbxh = dw_1.getitemstring(i, "nbxh")
ls_zs = dw_1.getitemstring(i, "a_qymccx_zs")
// 修改记录
UPDATE a_qymccx
SET qymc = :ls_qymc,
wwmc = :ls_wwmc,
zh = :ls_zh,
zhpy = :ls_zhpy,
mcjc = :ls_mcjc,
qylx = :ls_qylx1,
hydm = :ls_hydm,
hzrq = :ldt_hzrq,
djjg = :ls_djjg,
gxdw = :ls_jbdw,
czrq = :ld_now_date,
hyml = :ls_hyml,
zs = :ls_zs,
mchzbz = '4',
mccctgbz = '2'
WHERE nbxh = :nbxh;
IF sqlca.sqlcode = -1 then
// 失败
beep(3)
messagebox("错误",sqlca.sqlerrtext)
return false
elseif sqlca.sqlcode = 100 then
// not found
messagebox("警告","修改记录数为0!")
end if
return true
end function
on w_mcyhz_maintain1.create
this.st_1=create st_1
this.cb_3=create cb_3
this.cb_exit=create cb_exit
this.cb_condition=create cb_condition
this.cb_delete=create cb_delete
this.cb_cancel=create cb_cancel
this.cb_save=create cb_save
this.cb_add=create cb_add
this.dw_1=create dw_1
this.tab_1=create tab_1
this.Control[]={this.st_1,&
this.cb_3,&
this.cb_exit,&
this.cb_condition,&
this.cb_delete,&
this.cb_cancel,&
this.cb_save,&
this.cb_add,&
this.dw_1,&
this.tab_1}
end on
on w_mcyhz_maintain1.destroy
destroy(this.st_1)
destroy(this.cb_3)
destroy(this.cb_exit)
destroy(this.cb_condition)
destroy(this.cb_delete)
destroy(this.cb_cancel)
destroy(this.cb_save)
destroy(this.cb_add)
destroy(this.dw_1)
destroy(this.tab_1)
end on
event open;choose case g_subsysytem_id
case 'A'
ws_enterprise_type = '01'
case 'B'
ws_enterprise_type = '02'
case 'C'
ws_enterprise_type = '03'
case else
ws_enterprise_type = '%'
end choose
dw_1.settransobject(sqlca)
tab_1.tabpage_1.dw_2.settransobject(sqlca)
tab_1.tabpage_2.dw_3.settransobject(sqlca)
wv_qymc = '%'
wv_zh = '%'
wv_hztzs = '%'
wv_zhpy = '%'
cb_delete.enabled=false
cb_save.enabled=false
cb_cancel.enabled=false
cb_3.enabled=false
end event
event closequery;tab_1.tabpage_1.dw_2.accepttext()
end event
type st_1 from statictext within w_mcyhz_maintain1
integer x = 37
integer y = 748
integer width = 1595
integer height = 68
integer textsize = -10
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 255
long backcolor = 12632256
boolean focusrectangle = false
end type
type cb_3 from commandbutton within w_mcyhz_maintain1
integer x = 3104
integer y = 388
integer width = 448
integer height = 104
integer taborder = 70
integer textsize = -12
integer weight = 400
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "&H.核准通知"
end type
event clicked;string ls_qylx,ls_nbxh
ls_nbxh=dw_1.getitemstring(dw_1.getrow(),'nbxh')
ls_qylx=dw_1.getitemstring(dw_1.getrow(),'qylx')
nbxh=trim(ls_nbxh)+trim(ls_qylx)
cx_bz='2'
openwithparm(w_mchztzd,nbxh)
end event
type cb_exit from commandbutton within w_mcyhz_maintain1
integer x = 3104
integer y = 508
integer width = 448
integer height = 104
integer taborder = 80
integer textsize = -12
integer weight = 400
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "&X.退 出"
boolean cancel = true
end type
event clicked;//回退删除操作
rollback;
close(parent)
close(w_mchzxg)
end event
type cb_condition from commandbutton within w_mcyhz_maintain1
integer x = 3104
integer y = 28
integer width = 448
integer height = 104
integer taborder = 20
integer textsize = -12
integer weight = 400
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "&Q.查 询"
end type
event clicked;qymchz_stur stru_qymchz;
long ll_return_count;
string ls_nbxh1,ls_qymc1
tab_1.tabpage_1.dw_2.accepttext()
if dw_1.modifiedcount() > 0 or dw_1.deletedcount() > 0 then
beep(1)
if messagebox("提示","已经修改数据尚未保存,是否继续?",question!,yesno!) = 2 then
// prevent the condition window from opening
return
end if
end if
open(w_mcyhz_cond)
stru_qymchz = message.powerobjectparm ;
wv_qymc = stru_qymchz.qymc;
wv_zh = stru_qymchz.zh;
wv_hztzs = stru_qymchz.hztzs;
wv_zhpy = stru_qymchz.zhpy;
if wv_qymc="ooo" then return
if isnull(wv_zh) then wv_zh='%'
if isnull(wv_hztzs) then wv_hztzs='%'
if isnull(wv_zhpy) then wv_zhpy='%'
ll_return_count = dw_1.retrieve(wv_qymc, wv_zh, wv_hztzs, &
wv_zhpy,ws_enterprise_type)
if ll_return_count < 1 then
messagebox("提示","没有满足条件的记录!")
cb_delete.enabled = false
cb_save.enabled=false
cb_cancel.enabled=false
cb_3.enabled=false
dw_1.sharedata(tab_1.tabpage_1.dw_2)
tab_1.tabpage_2.dw_3.reset()
return
else
dw_1.modify("qymc.background.color = '0~tif(mcztbz = " + char(34) +'2' +char(34) +",rgb(137,197,237),rgb(220,222,152))'")
dw_1.modify("zh.background.color = '0~tif(mcztbz = " + char(34) +'2' +char(34) +",rgb(137,197,237),rgb(220,222,152))'")
dw_1.modify("hydm.background.color = '0~tif(mcztbz = " + char(34) +'2' +char(34) +",rgb(137,197,237),rgb(220,222,152))'")
dw_1.modify("hzrq.background.color = '0~tif(mcztbz = " + char(34) +'2' +char(34) +",rgb(137,197,237),rgb(220,222,152))'")
dw_1.modify("jbdw.background.color = '0~tif(mcztbz = " + char(34) +'2' +char(34) +",rgb(137,197,237),rgb(220,222,152))'")
dw_1.modify("hztzs.background.color = '0~tif(mcztbz = " + char(34) +'2' +char(34) +",rgb(137,197,237),rgb(220,222,152))'")
dw_1.modify("qylx.background.color = '0~tif(mcztbz = " + char(34) +'2' +char(34) +",rgb(137,197,237),rgb(220,222,152))'")
dw_1.modify("zhpy.background.color = '0~tif(mcztbz = " + char(34) +'2' +char(34) +",rgb(137,197,237),rgb(220,222,152))'")
dw_1.modify("a_qymchz_zcdjjg.background.color = '0~tif(mcztbz = " + char(34) +'2' +char(34) +",rgb(137,197,237),rgb(220,222,152))'")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -