w_zxmtrlmode_def.srw 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. $PBExportHeader$w_zxmtrlmode_def.srw
  2. forward
  3. global type w_zxmtrlmode_def from w_publ_edit_choice
  4. end type
  5. end forward
  6. global type w_zxmtrlmode_def from w_publ_edit_choice
  7. integer width = 1623
  8. integer height = 1584
  9. string title = "自定义2"
  10. end type
  11. global w_zxmtrlmode_def w_zxmtrlmode_def
  12. type variables
  13. string ins_return
  14. end variables
  15. on w_zxmtrlmode_def.create
  16. call super::create
  17. end on
  18. on w_zxmtrlmode_def.destroy
  19. call super::destroy
  20. end on
  21. event open;call super::open;this.title = sys_option_change_zxmtrlmode
  22. end event
  23. event close;call super::close;CLOSEWITHRETURN(THIS,ins_return)
  24. end event
  25. type cb_func from w_publ_edit_choice`cb_func within w_zxmtrlmode_def
  26. boolean visible = false
  27. integer x = 960
  28. integer width = 165
  29. boolean enabled = false
  30. end type
  31. type cb_exit from w_publ_edit_choice`cb_exit within w_zxmtrlmode_def
  32. integer x = 1029
  33. end type
  34. type cb_add from w_publ_edit_choice`cb_add within w_zxmtrlmode_def
  35. integer x = 151
  36. integer y = 4
  37. integer height = 160
  38. end type
  39. event cb_add::clicked;call super::clicked;IF NOT f_power_ind(2337,sys_msg_pow) THEN
  40. MessageBox(publ_operator,sys_msg_pow)
  41. RETURN
  42. END IF
  43. Long ll_newid,i
  44. String errmsg
  45. IF dw_edit_mode THEN
  46. dw_uc.AcceptText()
  47. IF dw_uc.GetNextModified(0, Primary!) = 0 THEN
  48. MessageBox(publ_operator,'没有任何修改,不可以保存!')
  49. RETURN
  50. END IF
  51. dw_uc.Object.zxmtrlmode[dw_uc.GetRow()] = Trim(dw_uc.Object.zxmtrlmode[dw_uc.GetRow()])
  52. IF dw_uc.Object.zxmtrlmode[dw_uc.GetRow()] = '' THEN
  53. MessageBox(publ_operator,'请输入内容!')
  54. RETURN
  55. END IF
  56. IF dw_uc.Object.zxmtrlmodeid[dw_uc.GetRow()] = 0 THEN
  57. ll_newid = f_sys_scidentity(0,"u_zxmtrlmode","zxmtrlmodeid",errmsg,TRUE,id_sqlca)
  58. IF ll_newid <= 0 THEN
  59. MessageBox(publ_operator,errmsg)
  60. RETURN
  61. ELSE
  62. dw_uc.Object.zxmtrlmodeid[dw_uc.GetRow()] = ll_newid
  63. END IF
  64. END IF
  65. END IF
  66. IF dw_edit_mode THEN
  67. String ls_errmsg
  68. IF dw_uc.Update() = -1 THEN
  69. IF Pos(ins_sqlerrtext,"Cannot insert duplicate key row") > 0 THEN
  70. ls_errmsg = "关键内容重复"
  71. ELSE
  72. ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext
  73. END IF
  74. ROLLBACK;
  75. MessageBox (publ_operator,ls_errmsg+",保存操作失败!",Exclamation!,OK!)
  76. LS_UPDATE_FLAG = FALSE
  77. RETURN
  78. ELSE
  79. COMMIT;
  80. FOR i = 1 TO 2
  81. dw_uc.SetTabOrder ( i, 0 )
  82. NEXT
  83. LS_UPDATE_FLAG = TRUE
  84. END IF
  85. ins_sqlerrtext = ""
  86. ELSE
  87. Long li_row, li_cur_row
  88. li_cur_row = dw_uc.GetRow()
  89. li_row = dw_uc.InsertRow (0)
  90. FOR i = 1 TO 2
  91. dw_uc.SetTabOrder ( i, i*10 )
  92. NEXT
  93. dw_uc.SelectRow(0,FALSE)
  94. dw_uc.ScrollToRow (li_row)
  95. dw_uc.SelectRow(li_row,TRUE)
  96. dw_uc.SetFocus()
  97. modifyrow_no = li_row
  98. END IF
  99. dw_edit_mode = NOT dw_edit_mode
  100. WF_FACE_CHANGE()
  101. end event
  102. type cb_edit from w_publ_edit_choice`cb_edit within w_zxmtrlmode_def
  103. integer x = 343
  104. end type
  105. event cb_edit::clicked;call super::clicked;if not f_power_ind(2337,sys_msg_pow) THEN
  106. MessageBox(publ_operator,sys_msg_pow)
  107. RETURN
  108. END IF
  109. Long i
  110. IF dw_edit_mode THEN
  111. IF dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = NewModified! OR dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = New! THEN
  112. dw_uc.DeleteRow(dw_uc.GetRow())
  113. ELSE
  114. dw_uc.ReselectRow(dw_uc.GetRow())
  115. END IF
  116. FOR i = 1 TO 2
  117. dw_uc.SetTabOrder ( i, 0 )
  118. NEXT
  119. modifyrow_no = 0
  120. ELSE
  121. modifyrow_no = dw_uc.GetRow()
  122. FOR i = 1 TO 2
  123. dw_uc.SetTabOrder ( i, i*10 )
  124. NEXT
  125. dw_uc.SetFocus()
  126. dw_uc.SelectRow(0,FALSE)
  127. dw_uc.ScrollToRow (modifyrow_no)
  128. dw_uc.SelectRow(modifyrow_no,TRUE)
  129. END IF
  130. dw_edit_mode = NOT dw_edit_mode
  131. WF_FACE_CHANGE()
  132. end event
  133. type cb_delet from w_publ_edit_choice`cb_delet within w_zxmtrlmode_def
  134. integer x = 535
  135. end type
  136. event cb_delet::clicked;call super::clicked;IF NOT f_power_ind(2337,sys_msg_pow) THEN
  137. MessageBox(publ_operator,sys_msg_pow)
  138. RETURN
  139. END IF
  140. IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  141. RETURN
  142. END IF
  143. String arg_msg
  144. IF DW_UC.GetRow() <= 0 THEN
  145. MessageBox('','没有操作目标记录!')
  146. RETURN
  147. END IF
  148. DW_UC.SetRedraw (FALSE)
  149. DW_UC.DeleteRow (0)
  150. DW_UC.TriggerEvent (RowFocusChanged!)
  151. IF DW_UC.Update() = -1 THEN
  152. ROLLBACK;
  153. MessageBox (publ_operator,"删除记录操作失败!",Exclamation!,OK!)
  154. ELSE
  155. COMMIT;
  156. END IF
  157. DW_UC.SetRedraw (TRUE)
  158. end event
  159. type cb_choice from w_publ_edit_choice`cb_choice within w_zxmtrlmode_def
  160. integer x = 699
  161. integer width = 165
  162. end type
  163. event cb_choice::clicked;call super::clicked;Long LS_ROW
  164. LS_ROW = dw_uc.GetRow()
  165. IF LS_ROW <= 0 THEN
  166. MessageBox('系统提示','请先选择目标行!',StopSign!)
  167. RETURN
  168. END IF
  169. ins_return = dw_uc.Object.zxmtrlmode[LS_ROW]
  170. Close(PARENT)
  171. end event
  172. type dw_uc from w_publ_edit_choice`dw_uc within w_zxmtrlmode_def
  173. integer width = 1600
  174. string dataobject = "dw_zxmtrlmode_edit"
  175. end type
  176. event dw_uc::dwnkey;call super::dwnkey;IF Key = keyenter! THEN
  177. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  178. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  179. RETURN 1
  180. END IF
  181. end event
  182. event dw_uc::doubleclicked;call super::doubleclicked;cb_CHOICE.PostEvent(Clicked!)
  183. end event
  184. type cb_rtr from w_publ_edit_choice`cb_rtr within w_zxmtrlmode_def
  185. end type
  186. type cb_help from w_publ_edit_choice`cb_help within w_zxmtrlmode_def
  187. integer x = 878
  188. end type
  189. type ln_bar from w_publ_edit_choice`ln_bar within w_zxmtrlmode_def
  190. end type
  191. type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_zxmtrlmode_def
  192. end type
  193. type r_bar from w_publ_edit_choice`r_bar within w_zxmtrlmode_def
  194. end type