123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- $PBExportHeader$w_billemp.srw
- forward
- global type w_billemp from w_publ_edit_choice
- end type
- end forward
- global type w_billemp from w_publ_edit_choice
- integer width = 1737
- integer height = 1880
- string title = "单据消息发送人预置"
- boolean minbox = true
- windowtype windowtype = popup!
- event ue_f8 ( )
- end type
- global w_billemp w_billemp
- event ue_f8();if not dw_edit_mode then return
- long uc_row,ins_mtrlid = 0
- s_empselect s_select
- string tmp_empcode
- uc_row = dw_uc.getrow()
- if uc_row <= 0 then return
- dw_uc.setredraw(false)
- if dw_uc.getcolumnname() = 'u_rs_empinfo_empcode' then
- tmp_empcode = trim(dw_uc.object.u_rs_empinfo_empcode[dw_uc.getrow()])
- if not isvalid(w_empinfo_choice) then
- openwithparm(w_empinfo_choice,tmp_empcode)
-
- s_select = message.powerobjectparm //接受返回结构
- if s_select.empid > 0 then
- dw_uc.object.empid[dw_uc.getrow()] = s_select.empid
- dw_uc.object.u_rs_empinfo_empcode[dw_uc.getrow()] = s_select.empcode
- dw_uc.object.u_rs_empinfo_empname[dw_uc.getrow()] = s_select.empname
-
- end if
- end if
- end if
- dw_uc.setredraw(true)
- dw_uc.setfocus()
- end event
- on w_billemp.create
- call super::create
- end on
- on w_billemp.destroy
- call super::destroy
- end on
- type cb_func from w_publ_edit_choice`cb_func within w_billemp
- end type
- type cb_exit from w_publ_edit_choice`cb_exit within w_billemp
- integer x = 987
- end type
- type cb_add from w_publ_edit_choice`cb_add within w_billemp
- end type
- event cb_add::clicked;call super::clicked;long ll_newid,i
- string errmsg
- IF dw_edit_mode THEN
- dw_uc.accepttext()
- if dw_uc.GetNextModified(0, Primary!)=0 then
- MESSAGEBOX(publ_operator,'没有任何修改,不可以保存!')
- RETURN
- end if
- DW_UC.OBJECT.billcode[DW_UC.GETROW()]=TRIM(DW_UC.OBJECT.billcode[DW_UC.GETROW()])
- DW_UC.OBJECT.empid[DW_UC.GETROW()]=DW_UC.OBJECT.empid[DW_UC.GETROW()]
-
- IF DW_UC.OBJECT.billcode[DW_UC.GETROW()]='' THEN
- MESSAGEBOX(publ_operator,'请选择单据!')
- RETURN
- END IF
-
- end if
- IF dw_edit_mode THEN
- 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 (publ_operator,ls_errmsg+",保存操作失败!",Exclamation!,OK!)
- LS_UPDATE_FLAG=FALSE
- RETURN
- else
- commit;
- for i=1 to 2
- dw_UC.SetTabOrder ( i, 0 )
- next
- LS_UPDATE_FLAG=TRUE
- 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 2
- dw_UC.SetTabOrder ( i, i*10 )
- next
- dw_uc.selectrow(0,false)
- dw_UC.ScrollToRow (li_row)
- dw_uc.selectrow(li_row,true)
- dw_UC.SetFocus()
- 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_billemp
- end type
- event cb_edit::clicked;call super::clicked;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 2
- dw_UC.SetTabOrder ( i, 0 )
- next
- modifyrow_no = 0
- ELSE
- modifyrow_no = dw_UC.getrow()
- for i=1 to 2
- 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_billemp
- end type
- event cb_delet::clicked;call super::clicked;IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
- RETURN
- END IF
- long LS_id
- LONG LS_LONG=0
- string ls_code,arg_msg
- IF DW_UC.GETROW()<=0 THEN
- MESSAGEBOX('','没有操作目标记录!')
- RETURN
- END IF
- dw_uc.SetRedraw (false)
- dw_UC.DeleteRow (0)
- dw_UC.TriggerEvent (rowfocuschanged!)
- if dw_UC.Update() = -1 then
- rollback;
- MessageBox (publ_operator,"删除记录操作失败!",Exclamation!,OK!)
- else
- commit;
- end if
- dw_uc.SetRedraw (true)
- end event
- type cb_choice from w_publ_edit_choice`cb_choice within w_billemp
- boolean visible = false
- integer x = 1472
- integer width = 165
- boolean enabled = false
- end type
- type dw_uc from w_publ_edit_choice`dw_uc within w_billemp
- integer width = 1669
- integer height = 1576
- string dataobject = "dw_billemp_edit"
- end type
- event dw_uc::dwnkey;call super::dwnkey;PARENT.TriggerEvent('user_key')
- Long uc_row
- String ls_empcode,ls_empname
- Long ls_empid
- IF dw_edit_mode THEN
- IF KeyDown(Keydownarrow!) THEN
- Long li_row
- IF this.GetRow() = this.RowCount() THEN
- PARENT.TriggerEvent("insert_childrow")
- END IF
- ELSE
- If (KeyDown(KeyEnter!) OR KeyDown(KeyTab!)) AND NOT KeyDown(KeyControl!) AND NOT KeyDown(KeyShift!) THEN
- IF this.GetColumnName() = 'u_rs_empinfo_empcode' THEN
-
- this.AcceptText()
- uc_row = this.GetRow()
-
- ls_empcode = this.Object.u_rs_empinfo_empcode[uc_row]
-
- SELECT empid,empname INTO :ls_empid,:ls_empname
- FROM u_rs_empinfo
- Where empcode = :ls_empcode;
- IF sqlca.SQLCode <> 0 THEN
- PARENT.TriggerEvent('ue_f8')
- RETURN 1
- END IF
-
- this.Object.empid[uc_row] = ls_empid
- this.Object.u_rs_empinfo_empname[uc_row] = ls_empname
-
-
- IF Key = KeyEnter! THEN
- keybd_event ( 9, 0, 0 , 0 ) // 按下tab
- keybd_event ( 9, 0, 2, 0 ) // 释放tab
- RETURN 1
- END IF
-
- ELSE
- IF Key = KeyEnter! THEN
- keybd_event ( 9, 0, 0 , 0 ) // 按下tab
- keybd_event ( 9, 0, 2, 0 ) // 释放tab
- RETURN 1
- END IF
- END IF
- END IF
- END IF
- END IF
- end event
- event dw_uc::doubleclicked;call super::doubleclicked;IF dw_edit_mode THEN
- PARENT.TriggerEvent('ue_f8')
- END IF
- end event
- type cb_rtr from w_publ_edit_choice`cb_rtr within w_billemp
- end type
- type cb_help from w_publ_edit_choice`cb_help within w_billemp
- integer x = 837
- end type
- type ln_bar from w_publ_edit_choice`ln_bar within w_billemp
- end type
- type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_billemp
- end type
- type r_bar from w_publ_edit_choice`r_bar within w_billemp
- end type
|