$PBExportHeader$w_main_fx_old_backup.srw
$PBExportComments$分销系统主窗口
forward
global type w_main_fx_old_backup from w_publ_base
end type
type st_username from statictext within w_main_fx_old_backup
end type
type cb_saletask from uo_imflatbutton within w_main_fx_old_backup
end type
type cb_retrieve from uo_imflatbutton within w_main_fx_old_backup
end type
type dw_feedback from u_dw_rbtnfilter within w_main_fx_old_backup
end type
type st_1 from statictext within w_main_fx_old_backup
end type
type st_2 from statictext within w_main_fx_old_backup
end type
type rb_auto from radiobutton within w_main_fx_old_backup
end type
type rb_unauto from radiobutton within w_main_fx_old_backup
end type
type gb_1 from groupbox within w_main_fx_old_backup
end type
type r_1 from rectangle within w_main_fx_old_backup
end type
type r_2 from rectangle within w_main_fx_old_backup
end type
type dw_send from u_dw_rbtnfilter within w_main_fx_old_backup
end type
end forward

global type w_main_fx_old_backup from w_publ_base
integer width = 3835
integer height = 2356
string title = "分销系统"
boolean maxbox = true
boolean resizable = true
long backcolor = 16777215
boolean center = true
st_username st_username
cb_saletask cb_saletask
cb_retrieve cb_retrieve
dw_feedback dw_feedback
st_1 st_1
st_2 st_2
rb_auto rb_auto
rb_unauto rb_unauto
gb_1 gb_1
r_1 r_1
r_2 r_2
dw_send dw_send
end type
global w_main_fx_old_backup w_main_fx_old_backup

type variables
long ins_interval = 60
end variables

forward prototypes
public function integer wf_retrieve ()
end prototypes

public function integer wf_retrieve ();int rslt = 1

dw_feedback.Reset()
dw_send.Reset( )

string arg_msg
oleobject list, item
list = FXAppCom.GetToDoList(app_token_fx, ref arg_msg)
if (arg_msg <> '') then
	rslt = 0
	MessageBox('提示', '获取待处理清单失败:' + arg_msg)
	goto gettheirtodolist
end if

dw_feedback.SetRedraw(false)
long i
for i = 1 to list.Count
	item = list.GetItem(i - 1)
	
	dw_feedback.Object.comname[i] = item.GetString('comname')
	dw_feedback.Object.serialnum[i] = item.GetString('serialNum')
	dw_feedback.Object.sendsccode[i] = item.GetString('sendSCcode')
	dw_feedback.Object.adduser[i] = item.GetString('addUser')
	dw_feedback.Object.addtime[i] = item.GetDateTime('addTime')
	dw_feedback.Object.status[i] = item.GetInt('status')
	dw_feedback.Object.billtype[i] = item.GetInt('billType')
	dw_feedback.Object.summary[i] = item.GetString('summary')
	dw_feedback.Object.postscript[i] = item.GetString('postscript')
	dw_feedback.Object.remark[i] = item.GetString('remark')
	dw_feedback.Object.relatedcode[i] = item.GetString('relatedCode')
next
dw_feedback.SetRedraw(true)

gettheirtodolist:
list = FXAppCom.GetTheirToDoList(app_token_fx, ref arg_msg)
if (arg_msg <> '') then
	rslt = 0
	MessageBox('提示', '获取待对方处理清单失败:' + arg_msg)
	goto ext
end if

dw_send.SetRedraw(false)
for i = 1 to list.Count
	item = list.GetItem(i - 1)
	
	dw_send.Object.comname[i] = item.GetString('comname')
	dw_send.Object.serialnum[i] = item.GetString('serialNum')
	dw_send.Object.sendsccode[i] = item.GetString('receiveSCcode')
	dw_send.Object.adduser[i] = item.GetString('addUser')
	dw_send.Object.addtime[i] = item.GetDateTime('addTime')
	dw_send.Object.status[i] = item.GetInt('status')
	dw_send.Object.billtype[i] = item.GetInt('billType')
	dw_send.Object.summary[i] = item.GetString('summary')
	dw_send.Object.postscript[i] = item.GetString('postscript')
	dw_send.Object.remark[i] = item.GetString('remark')
	dw_send.Object.relatedcode[i] = item.GetString('relatedCode')
next
dw_send.SetRedraw(true)

ext:
return rslt
end function

on w_main_fx_old_backup.create
int iCurrent
call super::create
this.st_username=create st_username
this.cb_saletask=create cb_saletask
this.cb_retrieve=create cb_retrieve
this.dw_feedback=create dw_feedback
this.st_1=create st_1
this.st_2=create st_2
this.rb_auto=create rb_auto
this.rb_unauto=create rb_unauto
this.gb_1=create gb_1
this.r_1=create r_1
this.r_2=create r_2
this.dw_send=create dw_send
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.st_username
this.Control[iCurrent+2]=this.cb_saletask
this.Control[iCurrent+3]=this.cb_retrieve
this.Control[iCurrent+4]=this.dw_feedback
this.Control[iCurrent+5]=this.st_1
this.Control[iCurrent+6]=this.st_2
this.Control[iCurrent+7]=this.rb_auto
this.Control[iCurrent+8]=this.rb_unauto
this.Control[iCurrent+9]=this.gb_1
this.Control[iCurrent+10]=this.r_1
this.Control[iCurrent+11]=this.r_2
this.Control[iCurrent+12]=this.dw_send
end on

on w_main_fx_old_backup.destroy
call super::destroy
destroy(this.st_username)
destroy(this.cb_saletask)
destroy(this.cb_retrieve)
destroy(this.dw_feedback)
destroy(this.st_1)
destroy(this.st_2)
destroy(this.rb_auto)
destroy(this.rb_unauto)
destroy(this.gb_1)
destroy(this.r_1)
destroy(this.r_2)
destroy(this.dw_send)
end on

event open;call super::open;// 界面显示
if (app_relationtype = 0) then // 客户
	this.Title = '分销系统(客户端)'
else // 供应商
	this.Title = '分销系统(供应商)'
end if

if (Len(app_username) > 4) then
	st_username.Text = '用户：' + Mid(app_username, 1, 1) + '...' + Mid(app_username, Len(app_username), 2) + ',您好！'
else
	st_username.Text =  '用户：' + Trim(app_username) + ',您好！'
end if

wf_retrieve( )

if rb_auto.checked then timer(ins_interval)
end event

event resize;call super::resize;if (this.Width < 3800) then this.Width = 3800
if (this.Height < 2250) then this.Height = 2250


end event

event closequery;call super::closequery;if (MessageBox('提示', '确定要退出系统?', Question!, YesNoCancel!) <> 1) then return 1
end event

event timer;call super::timer;wf_retrieve( )
end event

event key;call super::key;if (key = KeyF5!) then wf_retrieve( )
end event

type cb_func from w_publ_base`cb_func within w_main_fx_old_backup
boolean visible = false
integer x = 1883
integer y = 164
integer width = 402
integer height = 100
integer taborder = 0
end type

type cb_exit from w_publ_base`cb_exit within w_main_fx_old_backup
integer x = 3319
integer y = 2072
integer width = 448
integer height = 100
integer taborder = 50
string normalpicname = "graphics\ic_06.bmp"
integer picsize = 16
end type

type st_username from statictext within w_main_fx_old_backup
integer x = 2743
integer y = 216
integer width = 617
integer height = 64
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 16777215
string text = "用户：xxxxxx,您好！"
boolean focusrectangle = false
end type

type cb_saletask from uo_imflatbutton within w_main_fx_old_backup
integer x = 3319
integer y = 416
integer width = 448
integer taborder = 10
boolean bringtotop = true
string text = "订单页"
end type

event clicked;call super::clicked;open(w_buytask_fx)
end event

type cb_retrieve from uo_imflatbutton within w_main_fx_old_backup
integer x = 3319
integer y = 1564
integer width = 448
integer taborder = 40
boolean bringtotop = true
string text = "立即刷新(F5)"
string normalpicname = "graphics\refresh.BMP"
integer picsize = 16
end type

event clicked;call super::clicked;wf_retrieve( )
end event

type dw_feedback from u_dw_rbtnfilter within w_main_fx_old_backup
integer x = 14
integer y = 412
integer width = 3278
integer height = 812
integer taborder = 60
boolean bringtotop = true
string dataobject = "dw_fx_feedback"
boolean hscrollbar = true
boolean vscrollbar = true
boolean hsplitscroll = true
borderstyle borderstyle = stylebox!
boolean rbutton_filter_use = true
boolean rbutton_setposition_use = true
boolean titleclick_sort_use = true
end type

event clicked;call super::clicked;if (row <= 0) then return

this.SelectRow(0, false)
this.SelectRow(row, true)
end event

event doubleclicked;call super::doubleclicked;if (row <= 0) then return

s_open_packet s_tran
s_tran.sn = this.Object.serialnum[row]
s_tran.summary = this.Object.summary[row]
s_tran.postscript = this.Object.postscript[row]
s_tran.remark = this.Object.remark[row]

if (this.Object.billtype[row] = 4) then // 销售发货单
	OpenWithParm(w_outware_receive_fx, s_tran)
end if
end event

event dwnkey;if keydown(KeyF4!)  then //read layout
	uf_read_profile_filter()
	uf_read_profile_sort()
	//uf_read_profile_layout()
elseif keydown(KeyF5!)  then //save layout 不含列显示
	uf_save_profile_filter()
	uf_save_profile_sort()
	wf_retrieve( )
	//uf_save_profile_layout()
elseif keydown(KeyF9!)  then //reset layout 不含列显示
	uf_reset_layout()
elseif keydown(KeyF2!)  then //save layout 不含列显示
	this.triggerevent('ue_setlayout')
end if
end event

type st_1 from statictext within w_main_fx_old_backup
integer x = 46
integer y = 332
integer width = 261
integer height = 76
boolean bringtotop = true
integer textsize = -12
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 16777215
long backcolor = 12632256
string text = "待处理"
boolean focusrectangle = false
end type

type st_2 from statictext within w_main_fx_old_backup
integer x = 46
integer y = 1280
integer width = 407
integer height = 76
boolean bringtotop = true
integer textsize = -12
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 16777215
long backcolor = 12632256
string text = "待对方处理"
boolean focusrectangle = false
end type

type rb_auto from radiobutton within w_main_fx_old_backup
integer x = 3365
integer y = 1436
integer width = 165
integer height = 60
integer taborder = 20
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long backcolor = 16777215
string text = "开"
end type

event clicked;if this.Checked then timer(ins_interval)
if not this.Checked then timer(0)
end event

type rb_unauto from radiobutton within w_main_fx_old_backup
integer x = 3570
integer y = 1436
integer width = 165
integer height = 60
integer taborder = 30
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long backcolor = 16777215
string text = "关"
boolean checked = true
end type

event clicked;if this.Checked then timer(0)
if not this.Checked then timer(ins_interval)
end event

type gb_1 from groupbox within w_main_fx_old_backup
integer x = 3319
integer y = 1360
integer width = 448
integer height = 180
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long backcolor = 16777215
string text = "自动刷新"
end type

type r_1 from rectangle within w_main_fx_old_backup
long linecolor = 33554432
integer linethickness = 4
long fillcolor = 12632256
integer x = 14
integer y = 316
integer width = 3278
integer height = 100
end type

type r_2 from rectangle within w_main_fx_old_backup
long linecolor = 33554432
integer linethickness = 4
long fillcolor = 12632256
integer x = 14
integer y = 1264
integer width = 3278
integer height = 100
end type

type dw_send from u_dw_rbtnfilter within w_main_fx_old_backup
integer x = 14
integer y = 1360
integer width = 3278
integer height = 812
integer taborder = 70
string dataobject = "dw_fx_feedback"
boolean hscrollbar = true
boolean vscrollbar = true
boolean hsplitscroll = true
borderstyle borderstyle = stylebox!
boolean rbutton_filter_use = true
boolean rbutton_setposition_use = true
boolean titleclick_sort_use = true
end type

event dwnkey;if keydown(KeyF4!)  then //read layout
	uf_read_profile_filter()
	uf_read_profile_sort()
	//uf_read_profile_layout()
elseif keydown(KeyF5!)  then //save layout 不含列显示
	uf_save_profile_filter()
	uf_save_profile_sort()
	wf_retrieve( )
	//uf_save_profile_layout()
elseif keydown(KeyF9!)  then //reset layout 不含列显示
	uf_reset_layout()
elseif keydown(KeyF2!)  then //save layout 不含列显示
	this.triggerevent('ue_setlayout')
end if
end event

