611
社区成员
发帖
与我相关
我的任务
分享
在dw的ItemChange事件中
string ls_ColName
string ls_xh //型号
string ls_cc //尺寸
decimal lc_dj //定价
long ll_sl //数量
ls_ColName = this.GetColumnName()
if ls_ColName="型号" then
if this.AcceptText()<0 then
return
end if
ls_xh = trim(this.GetItemString(row,"型号"))
if ls_xh = "" or IsNull(ls_xh) then
return
end if
DECLARE emp_js CURSOR FOR
SELECT 尺寸,定价,sum(数量)
FROM 商品表
WHERE 商品=:ls_xh
GROUP BY 尺寸,定价
;
OPEN emp_js;
FETCH emp_js INTO :ls_cc,:lc_dj,:ll_sl;
do while SQLCA.SQLCode=0
ls_cc = trim(ls_cc)
if ls_cc="M" then
dw_1.SetItem(row,"M",ll_sl)
end if
if ls_cc="L" then
dw_1.SetItem(row,"L",ll_sl)
end if
if ls_cc="XL" then
dw_1.SetItem(row,"XL",ll_sl)
end if
if ls_cc="XXL" then
dw_1.SetItem(row,"XXL",ll_sl)
end if
if ls_cc="XXXL" then
dw_1.SetItem(row,"XXXL",ll_sl)
end if
FETCH emp_js INTO :ls_cc,:lc_dj,:ll_sl;
loop
CLOSE emp_js;
end ifif dwo.name = '型號对应的列的列名' then
dec sl
select 数量 into :sl from 出貨資料 where 型號 = :data and 尺寸 = 'M';
if sqlca.sqlcode = 0 then
setitem(row, 'M对应的列的列名', sl)
end if
select 数量 into :sl from 出貨資料 where 型號 = :data and 尺寸 = 'L';
if sqlca.sqlcode = 0 then
setitem(row, 'L对应的列的列名', sl)
end if
select 数量 into :sl from 出貨資料 where 型號 = :data and 尺寸 = 'XL';
if sqlca.sqlcode = 0 then
setitem(row, 'XL对应的列的列名', sl)
end if
select top 1 定價 into :sl from 商品基本資料 where 型號 = :data;
if sqlca.sqlcode = 0 then
setitem(row, '定價对应的列的列名', sl)
end if
end if