$PBExportHeader$uo_fx_fj.sru
$PBExportComments$协同系统 物料配置 UO (用于选择物料配置)
forward
global type uo_fx_fj from nonvisualobject
end type
end forward

global type uo_fx_fj from nonvisualobject
end type
global uo_fx_fj uo_fx_fj

type variables
long ins_comid // 协同企业ID(供应商 物料所在的企业)

boolean ins_isReady = false // 当全部获取了10个(7个)配置表的时候，ins_isReady = true

datastore ins_ds_color, ins_ds_color_w, ins_ds_color_p
datastore ins_ds_pztype_def, ins_ds_pztype_mx
datastore ins_ds_configure_type, ins_ds_configure_code, ins_ds_configure_codemx
datastore ins_ds_configure, ins_ds_configure2
end variables

forward prototypes
public function integer update_fxfj (s_fileinfo_arr s_arr, ref string arg_msg)
end prototypes

public function integer update_fxfj (s_fileinfo_arr s_arr, ref string arg_msg);Long i
Int rslt = 1

oleobject item, outware, mxs
mxs = FXAppCom.CreArrOfPbDictionary()

for i = 1 to upperbound(s_arr.Fileid)
	item = FXAppCom.CreatePbDictionary()
	item.SetInt('fileid', s_arr.Fileid[i])
	item.SetInt('billtype', s_arr.billtype[i])
	item.SetString('displayName', s_arr.displayName[i])
	item.SetString('fileName', s_arr.fileName[i])
	item.SetString('fileType', s_arr.fileType[i])
	item.SetString('dscrp', s_arr.dscrp[i])
	item.SetFile('filedata', s_arr.filepath[i])
	item.SetInt('relid_erp', s_arr.relid[i])
	item.SetInt('relid_mx', s_arr.relid_mx[i])
	item.SetString('relcode', s_arr.relcode[i])
	
	mxs.Add(item)
next

oleobject request,response
request = FXAppCom.CreatePbDictionary()
request.SetString('token', app_token_fx)
request.SetObject('FxFileFjs', mxs)

response = FXAppCom.DoExecute('UpdateFxFileFj', request)
arg_msg = response.GetString('ErrMsg')

if (arg_msg <> '') then
	rslt = 0
	goto ext
end if

ext:
return rslt

end function

on uo_fx_fj.create
call super::create
TriggerEvent( this, "constructor" )
end on

on uo_fx_fj.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on

event destructor;destroy ins_ds_color
destroy ins_ds_color_w
destroy ins_ds_color_p
destroy ins_ds_pztype_def
destroy ins_ds_pztype_mx
destroy ins_ds_configure_type
destroy ins_ds_configure_code
destroy ins_ds_configure_codemx
destroy ins_ds_configure
destroy ins_ds_configure2
end event

