w_billemp.srw 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. $PBExportHeader$w_billemp.srw
  2. forward
  3. global type w_billemp from w_publ_edit_choice
  4. end type
  5. end forward
  6. global type w_billemp from w_publ_edit_choice
  7. integer width = 1737
  8. integer height = 1880
  9. string title = "单据消息发送人预置"
  10. boolean minbox = true
  11. windowtype windowtype = popup!
  12. event ue_f8 ( )
  13. end type
  14. global w_billemp w_billemp
  15. event ue_f8();if not dw_edit_mode then return
  16. long uc_row,ins_mtrlid = 0
  17. s_empselect s_select
  18. string tmp_empcode
  19. uc_row = dw_uc.getrow()
  20. if uc_row <= 0 then return
  21. dw_uc.setredraw(false)
  22. if dw_uc.getcolumnname() = 'u_rs_empinfo_empcode' then
  23. tmp_empcode = trim(dw_uc.object.u_rs_empinfo_empcode[dw_uc.getrow()])
  24. if not isvalid(w_empinfo_choice) then
  25. openwithparm(w_empinfo_choice,tmp_empcode)
  26. s_select = message.powerobjectparm //接受返回结构
  27. if s_select.empid > 0 then
  28. dw_uc.object.empid[dw_uc.getrow()] = s_select.empid
  29. dw_uc.object.u_rs_empinfo_empcode[dw_uc.getrow()] = s_select.empcode
  30. dw_uc.object.u_rs_empinfo_empname[dw_uc.getrow()] = s_select.empname
  31. end if
  32. end if
  33. end if
  34. dw_uc.setredraw(true)
  35. dw_uc.setfocus()
  36. end event
  37. on w_billemp.create
  38. call super::create
  39. end on
  40. on w_billemp.destroy
  41. call super::destroy
  42. end on
  43. type cb_func from w_publ_edit_choice`cb_func within w_billemp
  44. end type
  45. type cb_exit from w_publ_edit_choice`cb_exit within w_billemp
  46. integer x = 987
  47. end type
  48. type cb_add from w_publ_edit_choice`cb_add within w_billemp
  49. end type
  50. event cb_add::clicked;call super::clicked;long ll_newid,i
  51. string errmsg
  52. IF dw_edit_mode THEN
  53. dw_uc.accepttext()
  54. if dw_uc.GetNextModified(0, Primary!)=0 then
  55. MESSAGEBOX(publ_operator,'没有任何修改,不可以保存!')
  56. RETURN
  57. end if
  58. DW_UC.OBJECT.billcode[DW_UC.GETROW()]=TRIM(DW_UC.OBJECT.billcode[DW_UC.GETROW()])
  59. DW_UC.OBJECT.empid[DW_UC.GETROW()]=DW_UC.OBJECT.empid[DW_UC.GETROW()]
  60. IF DW_UC.OBJECT.billcode[DW_UC.GETROW()]='' THEN
  61. MESSAGEBOX(publ_operator,'请选择单据!')
  62. RETURN
  63. END IF
  64. end if
  65. IF dw_edit_mode THEN
  66. string ls_errmsg
  67. if dw_UC.Update() = -1 then
  68. if pos(ins_sqlerrtext,"Cannot insert duplicate key row")>0 then
  69. ls_errmsg="关键内容重复"
  70. else
  71. ls_errmsg="因为网络或其他原因>"+ins_sqlerrtext
  72. end if
  73. rollback;
  74. MessageBox (publ_operator,ls_errmsg+",保存操作失败!",Exclamation!,OK!)
  75. LS_UPDATE_FLAG=FALSE
  76. RETURN
  77. else
  78. commit;
  79. for i=1 to 2
  80. dw_UC.SetTabOrder ( i, 0 )
  81. next
  82. LS_UPDATE_FLAG=TRUE
  83. end if
  84. ins_sqlerrtext=""
  85. ELSE
  86. long li_row, li_cur_row
  87. li_cur_row = dw_UC.GetRow()
  88. li_row = dw_UC.InsertRow (0)
  89. for i=1 to 2
  90. dw_UC.SetTabOrder ( i, i*10 )
  91. next
  92. dw_uc.selectrow(0,false)
  93. dw_UC.ScrollToRow (li_row)
  94. dw_uc.selectrow(li_row,true)
  95. dw_UC.SetFocus()
  96. modifyrow_no= li_row
  97. END IF
  98. dw_edit_mode= NOT dw_edit_mode
  99. WF_FACE_CHANGE()
  100. end event
  101. type cb_edit from w_publ_edit_choice`cb_edit within w_billemp
  102. end type
  103. event cb_edit::clicked;call super::clicked;long i
  104. IF dw_edit_mode THEN
  105. if dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=NewModified! or dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=New! then
  106. dw_UC.deleterow(dw_UC.getrow())
  107. else
  108. dw_UC.ReselectRow(dw_UC.getrow())
  109. end if
  110. for i=1 to 2
  111. dw_UC.SetTabOrder ( i, 0 )
  112. next
  113. modifyrow_no = 0
  114. ELSE
  115. modifyrow_no = dw_UC.getrow()
  116. for i=1 to 2
  117. dw_UC.SetTabOrder ( i, i*10 )
  118. next
  119. dw_UC.SetFocus()
  120. dw_UC.selectrow(0,false)
  121. dw_UC.ScrollToRow (modifyrow_no)
  122. dw_uc.selectrow(modifyrow_no,true)
  123. END IF
  124. dw_edit_mode= NOT dw_edit_mode
  125. WF_FACE_CHANGE()
  126. end event
  127. type cb_delet from w_publ_edit_choice`cb_delet within w_billemp
  128. end type
  129. event cb_delet::clicked;call super::clicked;IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  130. RETURN
  131. END IF
  132. long LS_id
  133. LONG LS_LONG=0
  134. string ls_code,arg_msg
  135. IF DW_UC.GETROW()<=0 THEN
  136. MESSAGEBOX('','没有操作目标记录!')
  137. RETURN
  138. END IF
  139. dw_uc.SetRedraw (false)
  140. dw_UC.DeleteRow (0)
  141. dw_UC.TriggerEvent (rowfocuschanged!)
  142. if dw_UC.Update() = -1 then
  143. rollback;
  144. MessageBox (publ_operator,"删除记录操作失败!",Exclamation!,OK!)
  145. else
  146. commit;
  147. end if
  148. dw_uc.SetRedraw (true)
  149. end event
  150. type cb_choice from w_publ_edit_choice`cb_choice within w_billemp
  151. boolean visible = false
  152. integer x = 1472
  153. integer width = 165
  154. boolean enabled = false
  155. end type
  156. type dw_uc from w_publ_edit_choice`dw_uc within w_billemp
  157. integer width = 1669
  158. integer height = 1576
  159. string dataobject = "dw_billemp_edit"
  160. end type
  161. event dw_uc::dwnkey;call super::dwnkey;PARENT.TriggerEvent('user_key')
  162. Long uc_row
  163. String ls_empcode,ls_empname
  164. Long ls_empid
  165. IF dw_edit_mode THEN
  166. IF KeyDown(Keydownarrow!) THEN
  167. Long li_row
  168. IF this.GetRow() = this.RowCount() THEN
  169. PARENT.TriggerEvent("insert_childrow")
  170. END IF
  171. ELSE
  172. If (KeyDown(KeyEnter!) OR KeyDown(KeyTab!)) AND NOT KeyDown(KeyControl!) AND NOT KeyDown(KeyShift!) THEN
  173. IF this.GetColumnName() = 'u_rs_empinfo_empcode' THEN
  174. this.AcceptText()
  175. uc_row = this.GetRow()
  176. ls_empcode = this.Object.u_rs_empinfo_empcode[uc_row]
  177. SELECT empid,empname INTO :ls_empid,:ls_empname
  178. FROM u_rs_empinfo
  179. Where empcode = :ls_empcode;
  180. IF sqlca.SQLCode <> 0 THEN
  181. PARENT.TriggerEvent('ue_f8')
  182. RETURN 1
  183. END IF
  184. this.Object.empid[uc_row] = ls_empid
  185. this.Object.u_rs_empinfo_empname[uc_row] = ls_empname
  186. IF Key = KeyEnter! THEN
  187. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  188. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  189. RETURN 1
  190. END IF
  191. ELSE
  192. IF Key = KeyEnter! THEN
  193. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  194. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  195. RETURN 1
  196. END IF
  197. END IF
  198. END IF
  199. END IF
  200. END IF
  201. end event
  202. event dw_uc::doubleclicked;call super::doubleclicked;IF dw_edit_mode THEN
  203. PARENT.TriggerEvent('ue_f8')
  204. END IF
  205. end event
  206. type cb_rtr from w_publ_edit_choice`cb_rtr within w_billemp
  207. end type
  208. type cb_help from w_publ_edit_choice`cb_help within w_billemp
  209. integer x = 837
  210. end type
  211. type ln_bar from w_publ_edit_choice`ln_bar within w_billemp
  212. end type
  213. type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_billemp
  214. end type
  215. type r_bar from w_publ_edit_choice`r_bar within w_billemp
  216. end type