123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- $PBExportHeader$w_inout_reason_def.srw
- forward
- global type w_inout_reason_def from w_publ_edit_choice
- end type
- type cb_view from uo_imflatbutton within w_inout_reason_def
- end type
- end forward
- global type w_inout_reason_def from w_publ_edit_choice
- integer width = 2510
- integer height = 1664
- string title = "其他进出原因"
- boolean minbox = true
- windowtype windowtype = popup!
- boolean if_ue_retr = true
- boolean if_ue_filter = true
- boolean if_ue_sort = true
- boolean if_ue_sentdataout = true
- cb_view cb_view
- end type
- global w_inout_reason_def w_inout_reason_def
- type variables
- s_edit_index_tran s_tran //传递参数使用
- integer cur_inoutflag = -1 //0-出仓; 1-进仓; 2-领料; 3-调拨
- s_inout_reason INS_RT_STRU
- end variables
- on w_inout_reason_def.create
- int iCurrent
- call super::create
- this.cb_view=create cb_view
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_view
- end on
- on w_inout_reason_def.destroy
- call super::destroy
- destroy(this.cb_view)
- end on
- event retrieve_uc;dw_UC.retrieve(cur_inoutflag)
- end event
- event ue_before_open;call super::ue_before_open;s_tran = Message.PowerObjectParm
- IF Not IsNull(s_tran) THEN
- IF s_tran.work_mode = 1 THEN
- cur_inoutflag = s_tran.c_long
- cb_choice.Enabled = True
- END IF
- END IF
- end event
- event close;call super::close;CloseWithReturn(This,INS_RT_STRU)
- end event
- type cb_func from w_publ_edit_choice`cb_func within w_inout_reason_def
- end type
- type cb_exit from w_publ_edit_choice`cb_exit within w_inout_reason_def
- end type
- type cb_add from w_publ_edit_choice`cb_add within w_inout_reason_def
- end type
- event cb_add::clicked;call super::clicked;IF Not f_power_ind(79) THEN
- MessageBox('提示','你没有使用权限!', Information!, OK! )
- RETURN
- END IF
- Long i
- Long ll_staticid = 0
- String errmsg = ''
- IF dw_edit_mode THEN
- dw_uc.AcceptText()
- IF dw_uc.GetNextModified(0, Primary!) = 0 THEN
- MessageBox('提示','没有任何修改,不可以保存!', Information!, OK! )
- RETURN
- END IF
- dw_uc.Object.reason[dw_uc.GetRow()] = Trim(dw_uc.Object.reason[dw_uc.GetRow()])
- dw_uc.Object.memo[dw_uc.GetRow()] = Trim(dw_uc.Object.memo[dw_uc.GetRow()])
- dw_uc.Object.opdate[dw_uc.GetRow()] = Today()
- dw_uc.Object.opemp[dw_uc.GetRow()] = publ_operator
-
- IF dw_uc.Object.reason[dw_uc.GetRow()] = '' THEN
- MessageBox('提示','请输入原因!', Information!, OK! )
- RETURN
- END IF
-
- IF dw_uc.Object.staticid[dw_uc.GetRow()] = 0 THEN
- ll_staticid = f_sys_scidentity(0,"u_static","staticid",errmsg,False,sqlca)
- IF ll_staticid <= 0 THEN
- MessageBox("提示",errmsg, Information!, OK! )
- RETURN
- ELSE
- dw_uc.Object.staticid[dw_uc.GetRow()] = ll_staticid
- END IF
- END IF
-
-
- String ls_errmsg
- IF dw_uc.Update() = -1 THEN
- IF Pos(ins_sqlerrtext,"Cannot insert duplicate key row") > 0 THEN
- ls_errmsg = "关键内容重复"
- ELSE
- ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext
- END IF
- ROLLBACK;
- MessageBox ("提示",ls_errmsg+",保存操作失败!", Information!, OK! )
- LS_UPDATE_FLAG = False
- RETURN
- ELSE
- COMMIT;
- LS_UPDATE_FLAG = True
-
- FOR i = 1 To 3
- dw_uc.SetTabOrder ( i, 0 )
- NEXT
- END IF
- ins_sqlerrtext = ""
- ELSE
- Long li_row, li_cur_row
- li_cur_row = dw_uc.GetRow()
- li_row = dw_uc.InsertRow (0)
- FOR i = 1 To 3
- dw_uc.SetTabOrder ( i, i*10 )
- NEXT
- dw_uc.SelectRow(0,False)
- dw_uc.ScrollToRow (li_row)
- dw_uc.SelectRow(li_row,True)
-
- IF cur_inoutflag >= 0 THEN
- dw_uc.Object.inoutflag[li_row] = cur_inoutflag
- END IF
-
- dw_uc.SetFocus()
- dw_uc.SetColumn("inoutflag")
- modifyrow_no = li_row
- END IF
- dw_edit_mode = Not dw_edit_mode
- WF_FACE_CHANGE()
- end event
- type cb_edit from w_publ_edit_choice`cb_edit within w_inout_reason_def
- end type
- event cb_edit::clicked;call super::clicked;if not f_power_ind(79) then
- messagebox('提示','你没有使用权限!', Information!, OK! )
- return
- end if
- long i
- IF dw_edit_mode THEN
- if dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=NewModified! or dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=New! then
- dw_UC.deleterow(dw_UC.getrow())
- else
- dw_UC.ReselectRow(dw_UC.getrow())
- end if
- for i=1 to 3
- dw_UC.SetTabOrder ( i, 0 )
- next
- modifyrow_no = 0
- ELSE
- modifyrow_no = dw_UC.getrow()
- for i=1 to 3
- dw_UC.SetTabOrder ( i, i*10 )
- next
- dw_UC.SetFocus()
-
- dw_UC.selectrow(0,false)
- dw_UC.ScrollToRow (modifyrow_no)
- dw_uc.selectrow(modifyrow_no,true)
-
- END IF
- dw_edit_mode= NOT dw_edit_mode
- WF_FACE_CHANGE()
- end event
- type cb_delet from w_publ_edit_choice`cb_delet within w_inout_reason_def
- end type
- event cb_delet::clicked;call super::clicked;if not f_power_ind(79) then
- messagebox('提示','你没有使用权限!', Information!, OK! )
- return
- end if
- IF MessageBox ('询问',"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
- RETURN
- END IF
- dw_uc.SetRedraw (false)
- dw_UC.DeleteRow (0)
- dw_UC.TriggerEvent (rowfocuschanged!)
- if dw_UC.Update() = -1 then
- rollback;
- MessageBox ("提示","删除记录操作失败!", Information!, OK! )
- else
- commit;
- end if
- dw_uc.SetRedraw (true)
- end event
- type cb_choice from w_publ_edit_choice`cb_choice within w_inout_reason_def
- boolean enabled = false
- end type
- event cb_choice::clicked;call super::clicked;Long ll_row
- ll_row = dw_uc.GetRow()
- IF ll_row <= 0 THEN
- messagebox('提示','请先选择目标行!', Information!, OK! )
- RETURN
- END IF
- INS_RT_STRU.reason = dw_uc.Object.reason[ll_row]
- INS_RT_STRU.memo = dw_uc.Object.memo[ll_row]
- Close(Parent)
- end event
- type dw_uc from w_publ_edit_choice`dw_uc within w_inout_reason_def
- event dwnkey pbm_dwnkey
- integer width = 2478
- integer height = 1392
- string dataobject = "dw_inout_reason_def"
- end type
- event dw_uc::dwnkey;call super::dwnkey;IF Key = KeyEnter! THEN //
- keybd_event ( 9, 0, 0 , 0 ) // 按下tab
- keybd_event ( 9, 0, 2, 0 ) // 释放tab
- RETURN 1
- END IF
- end event
- event dw_uc::doubleclicked;call super::doubleclicked;if cb_choice.Enabled then
- IF row <= 0 then return
- cb_choice.triggerevent(clicked!)
- end if
- end event
- type cb_rtr from w_publ_edit_choice`cb_rtr within w_inout_reason_def
- end type
- type cb_help from w_publ_edit_choice`cb_help within w_inout_reason_def
- end type
- type ln_bar from w_publ_edit_choice`ln_bar within w_inout_reason_def
- end type
- type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_inout_reason_def
- end type
- type r_bar from w_publ_edit_choice`r_bar within w_inout_reason_def
- end type
- type cb_view from uo_imflatbutton within w_inout_reason_def
- boolean visible = false
- integer x = 837
- integer width = 151
- integer height = 164
- integer taborder = 30
- boolean bringtotop = true
- string text = "预览"
- string normalpicname = "preview.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;S_print_MSG LS_PRMSG
- LS_PRMSG.obj_dwNAME = 'dw_rp_static'
- LS_PRMSG.SHARE_DW = DW_UC
- LS_PRMSG.TAG_TEXT = PARENT.Title
- LS_PRMSG.SETUP_FLAG = 0
- LS_PRMSG.PAGECH_FLAG = 1
- OpenWithParm(w_publ_preview,LS_PRMSG)
- end event
|