lzh
2025-06-24 13c4a636539584ab977fddacfae884b3ec250aee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
ÿþ--[[
    Tðy: Rú^MR
   \O€ÿLZH
   åegÿ2024-12-19
 
   ýQpeÿ BeforeDataObjCreate
   ŸRý€:  ¾‹neˆ'§~+R
 
   ôf9e°‹U_:
 
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require( "oi_base_mobox" )
 
function BeforeDataObjCreate( strLuaDEID )
    local nRet, strRetInfo
    
    nRet, strRetInfo = mobox.getCurEditDataObjAttr(strLuaDEID,"BHJB","N_ALLOT_QTY")
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖSS_S_MR‘ù[aŒ^\'`1Y%! " .. strRetInfo) end
 
    local obj_attrs = json.decode(strRetInfo)
    local bhjb = obj_attrs[1].value  -- eˆ'§~+R ck8^/'}%`
    local dbts = tonumber(obj_attrs[2].value)  -- ŒèbXbpe
    
    if (dbts < 0 or dbts ~= math.floor(dbts)) then
        lua.Error(strLuaDEID, debug.getinfo(1), "ŒèbXbpe Ný€:N00\pebpe!")
    end
    
    local attr_value = {}
    if(bhjb == 'ck8^')then
        attr_value[1] = lua.KeyValueObj( "S_LEVEL", 2)
    elseif(bhjb == ''}%`')then
        attr_value[1] = lua.KeyValueObj( "S_LEVEL", 1)
    else
        lua.Error(strLuaDEID, debug.getinfo(1), "eˆ'§~+R Ný€:Nzz!")
    end
    nRet, strRetInfo = mobox.setCurEditDataObjAttr( strLuaDEID, lua.table2str(attr_value) ) 
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "¾‹náOo`1Y%!  "..strRetInfo ) end
    
end