123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523 |
- $PBExportHeader$w_mtrldef_edit_dftsaleprice.srw
- forward
- global type w_mtrldef_edit_dftsaleprice from w_publ_easyq
- end type
- type cb_save from uo_imflatbutton within w_mtrldef_edit_dftsaleprice
- end type
- type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_dftsaleprice
- end type
- type cb_cancel from uo_imflatbutton within w_mtrldef_edit_dftsaleprice
- end type
- end forward
- global type w_mtrldef_edit_dftsaleprice from w_publ_easyq
- string title = "产品价格表价格批设定"
- cb_save cb_save
- tv_1 tv_1
- cb_cancel cb_cancel
- end type
- global w_mtrldef_edit_dftsaleprice w_mtrldef_edit_dftsaleprice
- type variables
- String cur_handtype = '%'
- Long cur_pricelistid[]
- Int cur_temp_count
- String cur_column_string[]
- end variables
- forward prototypes
- public function integer wf_refresh_face ()
- public function integer wf_retrieve_wagemx ()
- public function integer wf_save (ref string arg_msg, boolean ifcommit)
- end prototypes
- public function integer wf_refresh_face ();//wf_refresh_face
- Int ls_i
- cb_func.Enabled = NOT dw_edit_mode
- cb_1.Enabled = NOT dw_edit_mode
- IF dw_edit_mode THEN
- cb_cancel.Enabled = TRUE
- cb_save.Text = '保存'
- cb_save.normalpicname = 'Save.bmp'
- ls_i = 1
- DO WHILE ls_i <= 15
- dw_1.SetTabOrder("price"+String(ls_i,'00'),10*ls_i)
- ls_i++
- LOOP
- ELSE
- cb_cancel.Enabled = FALSE
- cb_save.Text = '修改'
- cb_save.normalpicname = 'open.bmp'
- ls_i = 1
- DO WHILE ls_i <= 15
- dw_1.SetTabOrder("price"+String(ls_i,'00'),0)
- ls_i++
- LOOP
- END IF
-
- cb_save.TriggerEvent('ue_textchange')
- cb_save.of_init_draw()
- cb_save.of_paint()
- RETURN 0
- end function
- public function integer wf_retrieve_wagemx ();Int rslt = 1
- Long ls_j,ls_k,ls_rowcount
- Long ll_mtrlid,ll_pricelistid
- Decimal ld_temp_amt
- ls_rowcount = dw_1.RowCount()
- OPEN(w_sys_wait_jdt) //初始化进度条
- w_sys_wait_jdt.Show()
- w_sys_wait_jdt.wf_accepttol(ls_rowcount)
- FOR ls_j = 1 TO ls_rowcount
- ll_mtrlid = dw_1.Object.mtrlid[ls_j]
-
- FOR ls_k = 1 TO cur_temp_count
-
- w_sys_wait_jdt.st_msg.Text = "正在查询数据("+String(ls_j)+","+String(ls_k)+")..." //进度信息
-
-
- ll_pricelistid = cur_pricelistid[ls_k]
-
- SELECT price
- INTO :ld_temp_amt
- FROM u_sale_price_mx
- WHERE pricelistid = :ll_pricelistid AND
- mtrlid = :ll_mtrlid;
- IF sqlca.SQLCode <> 0 THEN
- ld_temp_amt = 0
- END IF
-
- dw_1.SetItem(ls_j,"price"+String(ls_k,'00'),ld_temp_amt)
- NEXT
- w_sys_wait_jdt.wf_inc(ls_j) //进度
- NEXT
- dw_1.AcceptText()
- CLOSE(w_sys_wait_jdt)
- RETURN rslt
- end function
- public function integer wf_save (ref string arg_msg, boolean ifcommit);Int rslt = 1
- long ls_rowcount,ls_j,ls_k
- Long ll_mtrlid,ll_pricelistid
- Decimal ld_temp_amt
- dw_1.AcceptText()
- ls_rowcount = dw_1.RowCount()
- Open(w_sys_wait_jdt) //初始化进度条
- w_sys_wait_jdt.Show()
- w_sys_wait_jdt.wf_accepttol(ls_rowcount)
- FOR ls_j = 1 TO ls_rowcount
-
- ll_mtrlid = dw_1.Object.mtrlid[ls_j]
-
- FOR ls_k = 1 TO cur_temp_count
- ll_pricelistid = cur_pricelistid[ls_k]
- CHOOSE CASE ls_k
- CASE 1
- ld_temp_amt = dw_1.Object.price01[ls_j]
- CASE 2
- ld_temp_amt = dw_1.Object.price02[ls_j]
- CASE 3
- ld_temp_amt = dw_1.Object.price03[ls_j]
- CASE 4
- ld_temp_amt = dw_1.Object.price04[ls_j]
- CASE 5
- ld_temp_amt = dw_1.Object.price05[ls_j]
- CASE 6
- ld_temp_amt = dw_1.Object.price06[ls_j]
- CASE 7
- ld_temp_amt = dw_1.Object.price07[ls_j]
- CASE 8
- ld_temp_amt = dw_1.Object.price08[ls_j]
- CASE 9
- ld_temp_amt = dw_1.Object.price09[ls_j]
- CASE 10
- ld_temp_amt = dw_1.Object.price10[ls_j]
- CASE 11
- ld_temp_amt = dw_1.Object.price11[ls_j]
- CASE 12
- ld_temp_amt = dw_1.Object.price12[ls_j]
- CASE 13
- ld_temp_amt = dw_1.Object.price13[ls_j]
- CASE 14
- ld_temp_amt = dw_1.Object.price14[ls_j]
- CASE 15
- ld_temp_amt = dw_1.Object.price15[ls_j]
- END CHOOSE
- w_sys_wait_jdt.st_msg.Text = "正在保存数据("+String(ls_j)+","+String(ls_k)+")..." //进度信息
-
- UPDATE u_sale_price_mx
- SET price = :ld_temp_amt
- WHERE mtrlid = :ll_mtrlid
- AND pricelistid = :ll_pricelistid;
- IF sqlca.SQLCode = 0 THEN
- IF sqlca.SQLNRows = 0 THEN
- INSERT INTO u_sale_price_mx
- (pricelistid,mtrlid,price)
- VALUES
- (:ll_pricelistid,:ll_mtrlid,:ld_temp_amt);
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '新增价格表失败,在第'+String(ls_j)+'行,第'+String(ls_k)+'列工资项目'
- GOTO ext
- END IF
- END IF
- ELSE
- rslt = 0
- arg_msg = '更新价格表失败,在第'+String(ls_j)+'行,第'+String(ls_k)+'列工资项目'
- GOTO ext
- END IF
-
- NEXT
- w_sys_wait_jdt.wf_inc(ls_j) //进度
- NEXT
- dw_1.AcceptText()
- ext:
- IF rslt = 1 AND ifcommit THEN
- COMMIT;
- ELSE
- ROLLBACK;
- END IF
- Close(w_sys_wait_jdt)
- RETURN rslt
- end function
- on w_mtrldef_edit_dftsaleprice.create
- int iCurrent
- call super::create
- this.cb_save=create cb_save
- this.tv_1=create tv_1
- this.cb_cancel=create cb_cancel
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_save
- this.Control[iCurrent+2]=this.tv_1
- this.Control[iCurrent+3]=this.cb_cancel
- end on
- on w_mtrldef_edit_dftsaleprice.destroy
- call super::destroy
- destroy(this.cb_save)
- destroy(this.tv_1)
- destroy(this.cb_cancel)
- end on
- event open;call super::open;cb_1.triggerevent(clicked!)
- wf_refresh_face()
- end event
- event resize;call super::resize;tv_1.Height = dw_1.Height
- end event
- type cb_func from w_publ_easyq`cb_func within w_mtrldef_edit_dftsaleprice
- integer x = 709
- end type
- type cb_exit from w_publ_easyq`cb_exit within w_mtrldef_edit_dftsaleprice
- integer x = 1417
- end type
- type cb_2 from w_publ_easyq`cb_2 within w_mtrldef_edit_dftsaleprice
- integer x = 1010
- integer taborder = 100
- boolean bringtotop = true
- end type
- type cb_psetup from w_publ_easyq`cb_psetup within w_mtrldef_edit_dftsaleprice
- integer x = 1161
- boolean bringtotop = true
- end type
- type cb_1 from w_publ_easyq`cb_1 within w_mtrldef_edit_dftsaleprice
- boolean bringtotop = true
- end type
- event cb_1::clicked;call super::clicked;dw_1.SetRedraw(FALSE)
- dw_1.SetTransObject(sqlca)
- dw_1.Retrieve(cur_handtype)
- String ls_pricelistname
- Long ls_pricelistid
- Int ls_j = 1
- DO WHILE ls_j <= 40
- dw_1.Modify("price"+String(ls_j,'00')+"_t.visible=true")
- dw_1.Modify("price"+String(ls_j,'00')+".visible=true")
- ls_j++
- LOOP
- DECLARE pricelist_cur CURSOR FOR
-
- SELECT
- u_sale_price_list.listname,
- u_sale_price_list.pricelistid
- FROM u_sale_price_list
- Order By u_sale_price_list.code;
-
- OPEN pricelist_cur;
- ls_j = 1
- FETCH pricelist_cur INTO :ls_pricelistname,:ls_pricelistid;
- DO WHILE sqlca.SQLCode = 0
- cur_pricelistid[ls_j] = ls_pricelistid
- cur_column_string[ls_j] = "price"+String(ls_j,'00')
- dw_1.Modify("price"+String(ls_j,'00')+"_t.Text='"+ls_pricelistname+"'")
-
- FETCH pricelist_cur INTO :ls_pricelistname,:ls_pricelistid;
- ls_j++
- LOOP
- CLOSE pricelist_cur;
- cur_temp_count = ls_j - 1
- DO WHILE ls_j <= 15
- dw_1.Modify("price"+String(ls_j,'00')+"_t.visible=false")
- dw_1.Modify("price"+String(ls_j,'00')+".visible=false")
- ls_j++
- LOOP
- wf_retrieve_wagemx()
- dw_1.SetRedraw(TRUE)
- end event
- type st_3 from w_publ_easyq`st_3 within w_mtrldef_edit_dftsaleprice
- boolean visible = false
- integer x = 1358
- integer y = 396
- end type
- type st_4 from w_publ_easyq`st_4 within w_mtrldef_edit_dftsaleprice
- boolean visible = false
- integer x = 1705
- integer y = 536
- end type
- type em_1 from w_publ_easyq`em_1 within w_mtrldef_edit_dftsaleprice
- boolean visible = false
- integer x = 1271
- integer y = 464
- integer taborder = 110
- end type
- type em_2 from w_publ_easyq`em_2 within w_mtrldef_edit_dftsaleprice
- boolean visible = false
- integer x = 1787
- integer y = 456
- integer taborder = 140
- end type
- type ddlb_yl from w_publ_easyq`ddlb_yl within w_mtrldef_edit_dftsaleprice
- integer x = 1778
- integer y = 48
- end type
- type cbx_yl from w_publ_easyq`cbx_yl within w_mtrldef_edit_dftsaleprice
- integer x = 1573
- integer y = 52
- end type
- type dw_1 from w_publ_easyq`dw_1 within w_mtrldef_edit_dftsaleprice
- integer x = 855
- integer y = 184
- integer width = 2656
- integer height = 1740
- string dataobject = "dw_mtrldef_edit_dftprice"
- boolean setcolumn_visible_use = false
- end type
- event dw_1::rowfocuschanged;IF currentrow <=0 THEN RETURN
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- end event
- event dw_1::clicked;call super::clicked;IF row <=0 THEN RETURN
- this.selectrow(0,false)
- this.selectrow(row,true)
- end event
- type sle_mtrl from w_publ_easyq`sle_mtrl within w_mtrldef_edit_dftsaleprice
- end type
- type sle_cust from w_publ_easyq`sle_cust within w_mtrldef_edit_dftsaleprice
- end type
- type st_mtrl from w_publ_easyq`st_mtrl within w_mtrldef_edit_dftsaleprice
- end type
- type st_cust from w_publ_easyq`st_cust within w_mtrldef_edit_dftsaleprice
- end type
- type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_mtrldef_edit_dftsaleprice
- integer x = 1829
- integer y = 56
- end type
- type pb_em1 from w_publ_easyq`pb_em1 within w_mtrldef_edit_dftsaleprice
- end type
- type pb_em2 from w_publ_easyq`pb_em2 within w_mtrldef_edit_dftsaleprice
- boolean visible = false
- end type
- type pb_2 from w_publ_easyq`pb_2 within w_mtrldef_edit_dftsaleprice
- boolean visible = false
- end type
- type cb_help from w_publ_easyq`cb_help within w_mtrldef_edit_dftsaleprice
- integer x = 859
- end type
- type cb_copyself from w_publ_easyq`cb_copyself within w_mtrldef_edit_dftsaleprice
- integer x = 453
- end type
- type gb_1 from w_publ_easyq`gb_1 within w_mtrldef_edit_dftsaleprice
- end type
- type ln_bar from w_publ_easyq`ln_bar within w_mtrldef_edit_dftsaleprice
- end type
- type ln_bar2 from w_publ_easyq`ln_bar2 within w_mtrldef_edit_dftsaleprice
- end type
- type r_bar from w_publ_easyq`r_bar within w_mtrldef_edit_dftsaleprice
- end type
- type ln_1 from w_publ_easyq`ln_1 within w_mtrldef_edit_dftsaleprice
- boolean visible = false
- end type
- type ln_2 from w_publ_easyq`ln_2 within w_mtrldef_edit_dftsaleprice
- boolean visible = false
- end type
- type ln_3 from w_publ_easyq`ln_3 within w_mtrldef_edit_dftsaleprice
- end type
- type ln_4 from w_publ_easyq`ln_4 within w_mtrldef_edit_dftsaleprice
- end type
- type cb_save from uo_imflatbutton within w_mtrldef_edit_dftsaleprice
- integer x = 151
- integer width = 151
- integer height = 164
- integer taborder = 20
- boolean bringtotop = true
- string text = "修改"
- string normalpicname = "save.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;IF NOT f_power_ind(964) THEN
- MessageBox('提示','你没有使用权限!', Information!, OK! )
- RETURN
- END IF
- string ls_msg
- IF dw_edit_mode THEN
- dw_1.SetFilter('')
- dw_1.Filter()
- dw_1.AcceptText()
-
- IF wf_save(ls_msg,TRUE) = 1 THEN
- f_setsysoplog('录入','录入价格,整体列表模式',ls_msg,TRUE)
- MessageBox('提示','保存成功!', Information!, OK! )
- ELSE
- MessageBox('提示','保存失败!原因:'+ls_msg, Information!, OK! )
- END IF
- END IF
- dw_edit_mode = NOT dw_edit_mode
- dw_1.ResetUpdate()
- IF NOT dw_edit_mode THEN
- cb_1.TriggerEvent(Clicked!)
- END IF
- wf_refresh_face()
- end event
- type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_dftsaleprice
- integer y = 184
- integer width = 855
- integer height = 1740
- integer taborder = 60
- boolean bringtotop = true
- integer textsize = -9
- fontcharset fontcharset = gb2312charset!
- fontfamily fontfamily = anyfont!
- string facename = "宋体"
- end type
- event selectionchanged;call super::selectionchanged;cur_handtype = THIS.uo_cur_info.handtype
- cur_handtype = cur_handtype + '%'
- cb_1.TriggerEvent(Clicked!)
- end event
- type cb_cancel from uo_imflatbutton within w_mtrldef_edit_dftsaleprice
- integer x = 302
- integer width = 151
- integer height = 164
- integer taborder = 50
- boolean bringtotop = true
- string text = "取消"
- string normalpicname = "undo.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;dw_edit_mode = FALSE
- dw_1.SetFilter('')
- dw_1.Filter()
- cb_1.TriggerEvent(Clicked!)
- wf_refresh_face()
- end event
|