w_billpic_fileclass_edit.srw 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. $PBExportHeader$w_billpic_fileclass_edit.srw
  2. forward
  3. global type w_billpic_fileclass_edit from w_publ_edit_choice
  4. end type
  5. end forward
  6. global type w_billpic_fileclass_edit from w_publ_edit_choice
  7. integer width = 1490
  8. integer height = 1836
  9. string title = "单据打印图片类别"
  10. boolean minbox = true
  11. windowtype windowtype = popup!
  12. end type
  13. global w_billpic_fileclass_edit w_billpic_fileclass_edit
  14. on w_billpic_fileclass_edit.create
  15. call super::create
  16. end on
  17. on w_billpic_fileclass_edit.destroy
  18. call super::destroy
  19. end on
  20. event retrieve_uc;dw_UC.retrieve()
  21. end event
  22. type cb_func from w_publ_edit_choice`cb_func within w_billpic_fileclass_edit
  23. end type
  24. type cb_exit from w_publ_edit_choice`cb_exit within w_billpic_fileclass_edit
  25. integer x = 987
  26. end type
  27. type cb_add from w_publ_edit_choice`cb_add within w_billpic_fileclass_edit
  28. end type
  29. event cb_add::clicked;call super::clicked;IF NOT f_power_ind(1353) THEN
  30. MessageBox('提示','你没有使用权限!', Information!, OK! )
  31. RETURN
  32. END IF
  33. Long ll_newid,i
  34. String errmsg
  35. IF dw_edit_mode THEN
  36. dw_uc.AcceptText()
  37. IF dw_uc.GetNextModified(0, Primary!) = 0 THEN
  38. MessageBox('提示','没有任何修改,不可以保存!', Information!, OK! )
  39. RETURN
  40. END IF
  41. IF dw_uc.Object.billtype[dw_uc.GetRow()] = 0 THEN
  42. MessageBox('提示','请选择单据!', Information!, OK! )
  43. RETURN
  44. END IF
  45. IF dw_uc.Object.classid[dw_uc.GetRow()] = 0 THEN
  46. MessageBox('提示','请选择附件分类!', Information!, OK! )
  47. RETURN
  48. END IF
  49. END IF
  50. IF dw_edit_mode THEN
  51. String ls_errmsg
  52. IF dw_uc.Update() = -1 THEN
  53. IF Pos(ins_sqlerrtext,"Cannot insert duplicate key row") > 0 THEN
  54. ls_errmsg = "关键内容重复"
  55. elseif Pos(ins_sqlerrtext,'PK_u_billpic_fileclass') > 0 then
  56. ls_errmsg = '一种单据只能指定一种附件分类'
  57. ELSE
  58. ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext
  59. END IF
  60. ROLLBACK;
  61. MessageBox ('提示',ls_errmsg+",保存操作失败!",Exclamation!,OK!)
  62. LS_UPDATE_FLAG = FALSE
  63. RETURN
  64. ELSE
  65. COMMIT;
  66. FOR i = 1 TO 1
  67. dw_uc.SetTabOrder ( i, 0 )
  68. NEXT
  69. LS_UPDATE_FLAG = TRUE
  70. END IF
  71. ins_sqlerrtext = ""
  72. ELSE
  73. Long li_row, li_cur_row
  74. li_cur_row = dw_uc.GetRow()
  75. li_row = dw_uc.InsertRow (0)
  76. FOR i = 1 TO 1
  77. dw_uc.SetTabOrder ( i, i*10 )
  78. NEXT
  79. dw_uc.SelectRow(0,FALSE)
  80. dw_uc.ScrollToRow (li_row)
  81. dw_uc.SelectRow(li_row,TRUE)
  82. dw_uc.SetFocus()
  83. modifyrow_no = li_row
  84. END IF
  85. dw_edit_mode = NOT dw_edit_mode
  86. WF_FACE_CHANGE()
  87. end event
  88. type cb_edit from w_publ_edit_choice`cb_edit within w_billpic_fileclass_edit
  89. end type
  90. event cb_edit::clicked;call super::clicked;IF NOT f_power_ind(1353) THEN
  91. MessageBox(publ_operator,'你没有使用权限!')
  92. RETURN
  93. END IF
  94. Long i
  95. IF dw_edit_mode THEN
  96. IF dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = NewModified! OR dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = New! THEN
  97. dw_uc.DeleteRow(dw_uc.GetRow())
  98. ELSE
  99. dw_uc.ReselectRow(dw_uc.GetRow())
  100. END IF
  101. FOR i = 1 TO 1
  102. dw_uc.SetTabOrder ( i, 0 )
  103. NEXT
  104. modifyrow_no = 0
  105. ELSE
  106. modifyrow_no = dw_uc.GetRow()
  107. FOR i = 1 TO 1
  108. dw_uc.SetTabOrder ( i, i*10 )
  109. NEXT
  110. dw_uc.SetFocus()
  111. dw_uc.SelectRow(0,FALSE)
  112. dw_uc.ScrollToRow (modifyrow_no)
  113. dw_uc.SelectRow(modifyrow_no,TRUE)
  114. END IF
  115. dw_edit_mode = NOT dw_edit_mode
  116. WF_FACE_CHANGE()
  117. end event
  118. type cb_delet from w_publ_edit_choice`cb_delet within w_billpic_fileclass_edit
  119. end type
  120. event cb_delet::clicked;call super::clicked;IF NOT f_power_ind(1353) THEN
  121. MessageBox('提示','你没有使用权限!', Information!, OK! )
  122. RETURN
  123. END IF
  124. IF MessageBox ('询问',"是否确定要删除当前记录?(选择确定后记录将不可恢复)",question!,yesno! ) = 2 THEN
  125. RETURN
  126. END IF
  127. Long ls_id
  128. Long ls_long = 0
  129. String ls_code,arg_msg
  130. IF dw_uc.GetRow() <= 0 THEN
  131. MessageBox('提示','没有操作目标记录!', Information!, OK! )
  132. RETURN
  133. END IF
  134. ls_id = dw_uc.Object.billtype[dw_uc.GetRow()]
  135. dw_uc.SetRedraw (FALSE)
  136. dw_uc.DeleteRow (0)
  137. dw_uc.TriggerEvent (RowFocusChanged!)
  138. IF dw_uc.Update() = -1 THEN
  139. ROLLBACK;
  140. MessageBox ('提示',"删除记录操作失败!", Information!, OK! )
  141. ELSE
  142. COMMIT;
  143. END IF
  144. dw_uc.SetRedraw (TRUE)
  145. end event
  146. type cb_choice from w_publ_edit_choice`cb_choice within w_billpic_fileclass_edit
  147. boolean visible = false
  148. boolean enabled = false
  149. end type
  150. type dw_uc from w_publ_edit_choice`dw_uc within w_billpic_fileclass_edit
  151. event ue_dwndropdown pbm_dwndropdown
  152. integer width = 1422
  153. integer height = 1516
  154. string dataobject = "dw_billpic_fileclass_edit"
  155. boolean rbutton_filter_use = true
  156. boolean titleclick_sort_use = true
  157. end type
  158. event dw_uc::ue_dwndropdown;//long ll_billtype
  159. //long ll_x,ll_y,ll_height
  160. //long ll_row
  161. //ll_row = this.getrow()
  162. //if ll_row <= 0 then return
  163. //IF THIS.GetColumnName() = 'classid' THEN
  164. // IF NOT IsValid(w_fileclass_ch) THEN
  165. // Openwithparm(w_fileclass_ch,ll_billtype)
  166. // ll_x = Long(this.Describe('classid.x'))
  167. // ll_y = long(this.describe('classid.y'))
  168. // ll_height = long(this.describe('classid.height'))
  169. // ll_y = ll_y + (ll_row + 1 ) * ll_height
  170. // w_fileclass_ch.x = parent.x + this.x + ll_x
  171. // w_fileclass_ch.y = parent.y + this.y + ll_y + 76
  172. // ELSE
  173. // Close(w_fileclass_ch)
  174. // END IF
  175. //END IF
  176. //
  177. //
  178. //
  179. //RETURN 0
  180. //
  181. end event
  182. event dw_uc::rowfocuschanged;call super::rowfocuschanged;if currentrow>0 then
  183. this.selectrow(0,false)
  184. this.selectrow(currentrow,true)
  185. end if
  186. end event
  187. event dw_uc::dwnkey;call super::dwnkey;IF Key = KeyEnter! THEN //
  188. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  189. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  190. RETURN 1
  191. END IF
  192. end event
  193. event dw_uc::doubleclicked;call super::doubleclicked;IF dw_edit_mode THEN
  194. IF dwo.Name = 'classid' THEN
  195. Long ll_billtype,ll_row
  196. ll_row = dw_uc.GetRow()
  197. IF ll_row <= 0 THEN RETURN
  198. // ll_billtype = dw_uc.Object.billtype[ll_row]
  199. //
  200. // IF ll_billtype = 0 THEN
  201. // MessageBox('系统提示','请先选择单据名称')
  202. // RETURN
  203. // END IF
  204. ll_billtype = 201
  205. OpenWithParm(w_fileclass_ch,ll_billtype)
  206. Long ll_classid
  207. ll_classid = Message.DoubleParm
  208. IF ll_classid > 0 THEN
  209. dw_uc.Object.classid[ll_row] = ll_classid
  210. END IF
  211. END IF
  212. END IF
  213. end event
  214. event dw_uc::itemchanged;call super::itemchanged;IF row > 0 THEN
  215. IF dwo.Name = 'billtype' THEN
  216. dw_uc.Object.classid[row] = 0
  217. END IF
  218. END IF
  219. end event
  220. type cb_rtr from w_publ_edit_choice`cb_rtr within w_billpic_fileclass_edit
  221. end type
  222. type cb_help from w_publ_edit_choice`cb_help within w_billpic_fileclass_edit
  223. integer x = 837
  224. end type
  225. type ln_bar from w_publ_edit_choice`ln_bar within w_billpic_fileclass_edit
  226. end type
  227. type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_billpic_fileclass_edit
  228. end type
  229. type r_bar from w_publ_edit_choice`r_bar within w_billpic_fileclass_edit
  230. integer x = 1394
  231. end type