123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- $PBExportHeader$w_taobao_sku.srw
- forward
- global type w_taobao_sku from w_publ_base_style
- end type
- type cb_reflash from uo_imflatbutton within w_taobao_sku
- end type
- type dw_1 from u_dw_rbtnfilter within w_taobao_sku
- end type
- type cb_edit from uo_imflatbutton within w_taobao_sku
- end type
- type cb_del from uo_imflatbutton within w_taobao_sku
- end type
- end forward
- global type w_taobao_sku from w_publ_base_style
- integer width = 3739
- integer height = 2040
- string title = "淘宝sku配置设置"
- boolean maxbox = true
- boolean resizable = true
- windowstate windowstate = maximized!
- cb_reflash cb_reflash
- dw_1 dw_1
- cb_edit cb_edit
- cb_del cb_del
- end type
- global w_taobao_sku w_taobao_sku
- type variables
- long ins_child = 4
- long ins_child_min = 1
- end variables
- forward prototypes
- public subroutine wf_face ()
- public function integer wf_save (ref string arg_msg, ref long rt_row)
- end prototypes
- public subroutine wf_face ();long i
- cb_reflash.Enabled = not dw_edit_mode
- cb_del.Enabled = dw_edit_mode
- IF dw_edit_mode THEN
-
- FOR i = 1 To ins_child
- dw_1.SetTabOrder(i, i * 10)
- NEXT
-
- cb_edit.Text = '保存'
- cb_edit.normalpicname = 'Save.bmp'
- ELSE
-
- FOR i = 1 To ins_child_min - 1
- dw_1.SetTabOrder(i, i * 10)
- NEXT
- FOR i = ins_child_min To ins_child
- dw_1.SetTabOrder(i, 0)
- NEXT
-
- cb_edit.Text = '修改'
- cb_edit.normalpicname = 'OPEN.bmp'
- END IF
- cb_edit.of_init_draw()
- cb_edit.of_paint()
- cb_edit.TriggerEvent('ue_textchange')
- end subroutine
- public function integer wf_save (ref string arg_msg, ref long rt_row);Int rslt = 1
- Long i
- String ls_skuid, ls_outer_status, ls_outer_woodcode, ls_outer_pcode
- long ll_fetchflag
- FOR i = 1 To dw_1.RowCount()
- ls_skuid = dw_1.Object.tb_sku_sku_id[i]
- ls_outer_status = dw_1.Object.tb_sku_outer_status[i]
- ls_outer_woodcode = dw_1.Object.tb_sku_outer_woodcode[i]
- ls_outer_pcode = dw_1.Object.tb_sku_outer_pcode[i]
- ll_fetchflag = dw_1.Object.tb_sku_fetchflag[i]
-
- UPDATE tb_sku SET
- outer_status = :ls_outer_status,
- outer_woodcode = :ls_outer_woodcode,
- outer_pcode = :ls_outer_pcode,
- fetchflag = :ll_fetchflag
- Where sku_id = :ls_skuid;
- IF sqlca.SQLCode <> 0 THEN
- rt_row = i
- rslt = 0
- arg_msg = '第'+string(i)+'行,更新淘宝sku配置信息失败,' + sqlca.SQLErrText
- GOTO ext
- END IF
- NEXT
- ext:
- IF rslt = 1 THEN
- COMMIT;
- ELSE
- ROLLBACK;
- END IF
- return rslt
- end function
- on w_taobao_sku.create
- int iCurrent
- call super::create
- this.cb_reflash=create cb_reflash
- this.dw_1=create dw_1
- this.cb_edit=create cb_edit
- this.cb_del=create cb_del
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_reflash
- this.Control[iCurrent+2]=this.dw_1
- this.Control[iCurrent+3]=this.cb_edit
- this.Control[iCurrent+4]=this.cb_del
- end on
- on w_taobao_sku.destroy
- call super::destroy
- destroy(this.cb_reflash)
- destroy(this.dw_1)
- destroy(this.cb_edit)
- destroy(this.cb_del)
- end on
- event ue_before_open;call super::ue_before_open;dw_1.SetTransObject(sqlca)
- end event
- event open;call super::open;cb_reflash.TriggerEvent(clicked!)
- end event
- event resize;call super::resize;dw_1.width = this.workspacewidth() - dw_1.x
- dw_1.Height = this.workspaceheight() - dw_1.Y
- end event
- type cb_func from w_publ_base_style`cb_func within w_taobao_sku
- integer x = 453
- end type
- type cb_exit from w_publ_base_style`cb_exit within w_taobao_sku
- integer x = 603
- end type
- type ln_bar from w_publ_base_style`ln_bar within w_taobao_sku
- end type
- type ln_bar2 from w_publ_base_style`ln_bar2 within w_taobao_sku
- end type
- type r_bar from w_publ_base_style`r_bar within w_taobao_sku
- end type
- type cb_reflash from uo_imflatbutton within w_taobao_sku
- integer width = 151
- integer height = 164
- integer taborder = 40
- boolean bringtotop = true
- string text = "刷新"
- string normalpicname = "refresh.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;dw_1.Retrieve()
- end event
- type dw_1 from u_dw_rbtnfilter within w_taobao_sku
- event ue_dwndropdown pbm_dwndropdown
- integer y = 184
- integer width = 3314
- integer height = 1640
- integer taborder = 30
- boolean bringtotop = true
- string dataobject = "dw_taobao_sku"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_filter_use = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event ue_dwndropdown;IF Not dw_edit_mode THEN RETURN
- String ls_col_pz,ls_col_mtrlid
- String ls_pz_ch
- String ls_col_value
- String ls_data_type
- Long ll_row,ll_mtrlid
- s_pzwin_open arg_s_win
- ll_row = This.GetRow()
- IF ll_row > 0 THEN
- ls_col_mtrlid = "u_mtrldef_mtrlid"//This.Describe("#1.Name")
-
- IF Not Pos(Lower(ls_col_mtrlid),'mtrlid') > 0 THEN RETURN
-
- ll_mtrlid = This.GetItemNumber(ll_row,ls_col_mtrlid)
- if isnull(ll_mtrlid) then return
- ls_col_pz = This.GetColumnName( )
-
- ls_data_type = This.Describe(ls_col_pz+".ColType")
- IF Pos(Lower(ls_data_type),"char") > 0 THEN
- ls_col_value = This.GetItemString(ll_row,ls_col_pz)
- END IF
-
- arg_s_win.arg_x = This.X + This.PointerX() + Parent.X
- arg_s_win.arg_y = This.Y + This.PointerY() + Parent.Y
-
- arg_s_win.arg_col = ls_col_pz
- arg_s_win.arg_mtrlid = ll_mtrlid
- arg_s_win.arg_col_value = ls_col_value
-
- ls_pz_ch = f_mtrl_pz(arg_s_win)
-
- IF IsNull(ls_pz_ch) Or ls_pz_ch = '' THEN RETURN
-
- This.SetItem(ll_row,ls_col_pz,ls_pz_ch)
- END IF
- end event
- event clicked;call super::clicked;IF row > 0 THEN
- This.SetRow(row)
- this.selectrow(row, true)
- END IF
- end event
- event rowfocuschanged;call super::rowfocuschanged;This.SelectRow(0, False)
- Long row
- row = This.GetRow()
- IF row > 0 THEN
- This.SelectRow(row, True)
- END IF
- end event
- type cb_edit from uo_imflatbutton within w_taobao_sku
- integer x = 151
- integer width = 151
- integer height = 164
- integer taborder = 50
- boolean bringtotop = true
- string text = "修改"
- string normalpicname = "open.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;IF Not uo_power_spi.f_taobao_sku_edit(sys_msg_pow) THEN
- MessageBox(publ_operator,sys_msg_pow)
- RETURN
- END IF
- String arg_msg
- Long ll_row
- IF dw_edit_mode THEN
- dw_1.AcceptText()
- IF wf_save(arg_msg, ll_row) <> 1 THEN
- dw_1.ScrollToRow(ll_row)
- MessageBox('ERROR', arg_msg)
- RETURN
- END IF
- END IF
- dw_edit_mode = Not dw_edit_mode
- wf_face()
- end event
- type cb_del from uo_imflatbutton within w_taobao_sku
- integer x = 302
- integer width = 151
- integer height = 164
- integer taborder = 20
- boolean bringtotop = true
- boolean enabled = false
- string text = "放弃"
- string normalpicname = "Undo.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;String ls_msg
- IF dw_edit_mode THEN
- dw_edit_mode = Not dw_edit_mode
- cb_reflash.TriggerEvent(Clicked!)
- wf_face()
- END IF
- end event
|