📄 w_add.srw
字号:
$PBExportHeader$w_add.srw
forward
global type w_add from window
end type
type st_7 from statictext within w_add
end type
type st_2 from statictext within w_add
end type
type sle_product_type_id from singlelineedit within w_add
end type
type sle_rebate from singlelineedit within w_add
end type
type sle_previous_price from singlelineedit within w_add
end type
type sle_present_price from singlelineedit within w_add
end type
type cb_4 from commandbutton within w_add
end type
type cb_2 from commandbutton within w_add
end type
type em_update_time from editmask within w_add
end type
type em_issue_time from editmask within w_add
end type
type em_end_time from editmask within w_add
end type
type em_start_time from editmask within w_add
end type
type mle_note from multilineedit within w_add
end type
type st_21 from statictext within w_add
end type
type st_20 from statictext within w_add
end type
type st_19 from statictext within w_add
end type
type st_17 from statictext within w_add
end type
type st_16 from statictext within w_add
end type
type st_15 from statictext within w_add
end type
type sle_url from singlelineedit within w_add
end type
type st_14 from statictext within w_add
end type
type st_13 from statictext within w_add
end type
type st_12 from statictext within w_add
end type
type mle_description from multilineedit within w_add
end type
type mle_keyword from multilineedit within w_add
end type
type st_11 from statictext within w_add
end type
type sle_picture from singlelineedit within w_add
end type
type st_10 from statictext within w_add
end type
type st_9 from statictext within w_add
end type
type sle_model from singlelineedit within w_add
end type
type st_8 from statictext within w_add
end type
type sle_brand from singlelineedit within w_add
end type
type st_6 from statictext within w_add
end type
type sle_merchant_id from singlelineedit within w_add
end type
type sle_keyfilter from singlelineedit within w_add
end type
type cb_1 from commandbutton within w_add
end type
type st_5 from statictext within w_add
end type
type dw_1 from datawindow within w_add
end type
type st_4 from statictext within w_add
end type
type st_3 from statictext within w_add
end type
type sle_product_type from singlelineedit within w_add
end type
type sle_tablename from singlelineedit within w_add
end type
type st_1 from statictext within w_add
end type
end forward
global type w_add from window
integer x = 681
integer y = 12
integer width = 3214
integer height = 2156
boolean titlebar = true
string title = "打折信息输入界面"
boolean controlmenu = true
long backcolor = 134217732
boolean clientedge = true
boolean center = true
st_7 st_7
st_2 st_2
sle_product_type_id sle_product_type_id
sle_rebate sle_rebate
sle_previous_price sle_previous_price
sle_present_price sle_present_price
cb_4 cb_4
cb_2 cb_2
em_update_time em_update_time
em_issue_time em_issue_time
em_end_time em_end_time
em_start_time em_start_time
mle_note mle_note
st_21 st_21
st_20 st_20
st_19 st_19
st_17 st_17
st_16 st_16
st_15 st_15
sle_url sle_url
st_14 st_14
st_13 st_13
st_12 st_12
mle_description mle_description
mle_keyword mle_keyword
st_11 st_11
sle_picture sle_picture
st_10 st_10
st_9 st_9
sle_model sle_model
st_8 st_8
sle_brand sle_brand
st_6 st_6
sle_merchant_id sle_merchant_id
sle_keyfilter sle_keyfilter
cb_1 cb_1
st_5 st_5
dw_1 dw_1
st_4 st_4
st_3 st_3
sle_product_type sle_product_type
sle_tablename sle_tablename
st_1 st_1
end type
global w_add w_add
on w_add.create
this.st_7=create st_7
this.st_2=create st_2
this.sle_product_type_id=create sle_product_type_id
this.sle_rebate=create sle_rebate
this.sle_previous_price=create sle_previous_price
this.sle_present_price=create sle_present_price
this.cb_4=create cb_4
this.cb_2=create cb_2
this.em_update_time=create em_update_time
this.em_issue_time=create em_issue_time
this.em_end_time=create em_end_time
this.em_start_time=create em_start_time
this.mle_note=create mle_note
this.st_21=create st_21
this.st_20=create st_20
this.st_19=create st_19
this.st_17=create st_17
this.st_16=create st_16
this.st_15=create st_15
this.sle_url=create sle_url
this.st_14=create st_14
this.st_13=create st_13
this.st_12=create st_12
this.mle_description=create mle_description
this.mle_keyword=create mle_keyword
this.st_11=create st_11
this.sle_picture=create sle_picture
this.st_10=create st_10
this.st_9=create st_9
this.sle_model=create sle_model
this.st_8=create st_8
this.sle_brand=create sle_brand
this.st_6=create st_6
this.sle_merchant_id=create sle_merchant_id
this.sle_keyfilter=create sle_keyfilter
this.cb_1=create cb_1
this.st_5=create st_5
this.dw_1=create dw_1
this.st_4=create st_4
this.st_3=create st_3
this.sle_product_type=create sle_product_type
this.sle_tablename=create sle_tablename
this.st_1=create st_1
this.Control[]={this.st_7,&
this.st_2,&
this.sle_product_type_id,&
this.sle_rebate,&
this.sle_previous_price,&
this.sle_present_price,&
this.cb_4,&
this.cb_2,&
this.em_update_time,&
this.em_issue_time,&
this.em_end_time,&
this.em_start_time,&
this.mle_note,&
this.st_21,&
this.st_20,&
this.st_19,&
this.st_17,&
this.st_16,&
this.st_15,&
this.sle_url,&
this.st_14,&
this.st_13,&
this.st_12,&
this.mle_description,&
this.mle_keyword,&
this.st_11,&
this.sle_picture,&
this.st_10,&
this.st_9,&
this.sle_model,&
this.st_8,&
this.sle_brand,&
this.st_6,&
this.sle_merchant_id,&
this.sle_keyfilter,&
this.cb_1,&
this.st_5,&
this.dw_1,&
this.st_4,&
this.st_3,&
this.sle_product_type,&
this.sle_tablename,&
this.st_1}
end on
on w_add.destroy
destroy(this.st_7)
destroy(this.st_2)
destroy(this.sle_product_type_id)
destroy(this.sle_rebate)
destroy(this.sle_previous_price)
destroy(this.sle_present_price)
destroy(this.cb_4)
destroy(this.cb_2)
destroy(this.em_update_time)
destroy(this.em_issue_time)
destroy(this.em_end_time)
destroy(this.em_start_time)
destroy(this.mle_note)
destroy(this.st_21)
destroy(this.st_20)
destroy(this.st_19)
destroy(this.st_17)
destroy(this.st_16)
destroy(this.st_15)
destroy(this.sle_url)
destroy(this.st_14)
destroy(this.st_13)
destroy(this.st_12)
destroy(this.mle_description)
destroy(this.mle_keyword)
destroy(this.st_11)
destroy(this.sle_picture)
destroy(this.st_10)
destroy(this.st_9)
destroy(this.sle_model)
destroy(this.st_8)
destroy(this.sle_brand)
destroy(this.st_6)
destroy(this.sle_merchant_id)
destroy(this.sle_keyfilter)
destroy(this.cb_1)
destroy(this.st_5)
destroy(this.dw_1)
destroy(this.st_4)
destroy(this.st_3)
destroy(this.sle_product_type)
destroy(this.sle_tablename)
destroy(this.st_1)
end on
event open;dataname=Message.StringParm
sle_tablename.text=dataname
em_update_time.text=String(today(),"yyyy-mm-dd")
dw_1.setTransObject(SQLCA)
dw_1.retrieve()
select product_type_id
into :sle_product_type_id.text
from product_type
where rtrim(product_table_name)=rtrim(:dataname);
end event
type st_7 from statictext within w_add
integer x = 2473
integer y = 744
integer width = 224
integer height = 64
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "折"
boolean focusrectangle = false
end type
type st_2 from statictext within w_add
integer x = 928
integer y = 168
integer width = 379
integer height = 64
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "产品类型ID:"
boolean focusrectangle = false
end type
type sle_product_type_id from singlelineedit within w_add
integer x = 1312
integer y = 168
integer width = 306
integer height = 84
integer taborder = 30
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean displayonly = true
borderstyle borderstyle = stylelowered!
end type
type sle_rebate from singlelineedit within w_add
integer x = 2240
integer y = 736
integer width = 233
integer height = 84
integer taborder = 140
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean displayonly = true
borderstyle borderstyle = stylelowered!
end type
type sle_previous_price from singlelineedit within w_add
integer x = 1349
integer y = 740
integer width = 402
integer height = 84
integer taborder = 130
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
end type
event modified;double previous_price
double present_price
if sle_previous_price.text="" or sle_present_price.text="" then
return;
end if
previous_price=double(sle_previous_price.text)
present_price=double(sle_present_price.text)
sle_rebate.text=string(round(present_price/previous_price*10,1))
end event
type sle_present_price from singlelineedit within w_add
integer x = 361
integer y = 740
integer width = 402
integer height = 84
integer taborder = 130
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
end type
event modified;double previous_price
double present_price
if sle_previous_price.text="" or sle_present_price.text="" then
return;
end if
previous_price=double(sle_previous_price.text)
present_price=double(sle_present_price.text)
sle_rebate.text=string(round(present_price/previous_price*10,1))
end event
type cb_4 from commandbutton within w_add
integer x = 2432
integer y = 1680
integer width = 430
integer height = 104
integer taborder = 200
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "关闭"
end type
event clicked;close(parent)
end event
type cb_2 from commandbutton within w_add
integer x = 2423
integer y = 1436
integer width = 430
integer height = 108
integer taborder = 190
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "添加纪录"
end type
event clicked;int product_type_id, merchant_id, source_id
string product_type,brand, model, keyword, picture, description
datetime start_time, end_time, issue_time, update_time
string url, note
double present_price, previous_price,rebate
product_type=sle_product_type.text
product_type_id=integer(sle_product_type_id.text)
merchant_id=integer(sle_merchant_id.text)
brand=sle_brand.text
model=sle_model.text
keyword=mle_keyword.text
picture=sle_picture.text
description=mle_description.text
em_start_time.getdata(start_time)
em_end_time.getdata(end_time)
em_issue_time.getdata(issue_time)
em_update_time.getdata(update_time)
url=sle_url.text
note=mle_note.text
present_price=double(sle_present_price.text)
previous_price=double(sle_previous_price.text)
rebate=round(double(sle_rebate.text),1)
dataname=trim(dataname)
string mysql,strInsStmt
int e //0-no exists
select count(*)
into :e
from product_type
where product_table_name=:dataname;
if e = 0 then
mysql="create table "+dataname &
+" (id integer default autoincrement not null," &
+"product_type varchar(20) not null," &
+"product_type_id integer not null," &
+"merchant_id integer not null," &
+"brand varchar(50)," &
+"model varchar(20)," &
+"keyword varchar(200)," &
+"picture varchar(30)," &
+"description varchar(200)," &
+"start_time char(10) not null," &
+"end_time char(10) not null," &
+"url varchar(30)," &
+"present_price numeric(6,2) not null," &
+"previous_price numeric(6,2) not null," &
+"rebate numeric(2,1) not null," &
+"issue_time char(10) not null," &
+"update_time char(10)," &
+"note varchar(300))"
EXECUTE IMMEDIATE :mysql ;
end if
strInsStmt="insert into "+dataname+"(product_type,product_type_id,merchant_id," &
+"brand,model,keyword,picture,description,start_time,end_time,url," &
+"present_price,previous_price,rebate,issue_time,update_time,note)"
strInsStmt+=" values('"+product_type+"',"+String(product_type_id)+","+String(merchant_id) &
+",'"+brand+"','"+model+"','"+keyword+"','"+picture+"','"+description+ &
+"','"+string(start_time,"yyyy-mm-dd")+"','"+string(end_time,"yyyy-mm-dd")+"','"+url+"'," &
+String(present_price)+","+String(previous_price)+","+String(rebate)+",'" &
+string(issue_time,"yyyy-mm-dd")+"','"+string(update_time,"yyyy-mm-dd") &
+"','"+note+"')"
EXECUTE IMMEDIATE :strInsStmt;
//PREPARE SQLSA FROM :strInsStmt;
//DECLARE InsStmt DYNAMIC PROCEDURE FOR SQLSA;
//EXECUTE DYNAMIC InsStmt;
//COMMIT using sqlca;
end event
type em_update_time from editmask within w_add
integer x = 1349
integer y = 620
integer width = 512
integer height = 84
integer taborder = 170
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
maskdatatype maskdatatype = datetimemask!
string mask = "yyyy年mm月dd日"
end type
type em_issue_time from editmask within w_add
integer x = 361
integer y = 620
integer width = 512
integer height = 84
integer taborder = 160
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
string text = "1900年01月01日"
borderstyle borderstyle = stylelowered!
maskdatatype maskdatatype = datetimemask!
string mask = "yyyy年mm月dd日"
end type
type em_end_time from editmask within w_add
integer x = 1349
integer y = 500
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -