w_fileclass_def.srw 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. $PBExportHeader$w_fileclass_def.srw
  2. forward
  3. global type w_fileclass_def from w_publ_edit_choice
  4. end type
  5. type dw_bill_list from u_dw_rbtnfilter within w_fileclass_def
  6. end type
  7. type cb_imexport from uo_imflatbutton within w_fileclass_def
  8. end type
  9. end forward
  10. global type w_fileclass_def from w_publ_edit_choice
  11. integer width = 3611
  12. integer height = 2380
  13. string title = "单据附件分类定义"
  14. boolean minbox = true
  15. windowtype windowtype = popup!
  16. dw_bill_list dw_bill_list
  17. cb_imexport cb_imexport
  18. end type
  19. global w_fileclass_def w_fileclass_def
  20. on w_fileclass_def.create
  21. int iCurrent
  22. call super::create
  23. this.dw_bill_list=create dw_bill_list
  24. this.cb_imexport=create cb_imexport
  25. iCurrent=UpperBound(this.Control)
  26. this.Control[iCurrent+1]=this.dw_bill_list
  27. this.Control[iCurrent+2]=this.cb_imexport
  28. end on
  29. on w_fileclass_def.destroy
  30. call super::destroy
  31. destroy(this.dw_bill_list)
  32. destroy(this.cb_imexport)
  33. end on
  34. event retrieve_uc;long lrow
  35. lrow=dw_bill_list.getrow()
  36. if lrow<=0 then
  37. dw_uc.reset()
  38. else
  39. dw_uc.retrieve(dw_bill_list.Object.billtype[lrow] )
  40. end if
  41. end event
  42. type cb_func from w_publ_edit_choice`cb_func within w_fileclass_def
  43. end type
  44. type cb_exit from w_publ_edit_choice`cb_exit within w_fileclass_def
  45. integer x = 1266
  46. end type
  47. type cb_add from w_publ_edit_choice`cb_add within w_fileclass_def
  48. end type
  49. event cb_add::clicked;call super::clicked;IF Not f_power_ind(952) THEN
  50. MessageBox('提示','你没有使用权限!',information!,OK!)
  51. RETURN
  52. END IF
  53. Long ll_newid,i
  54. String errmsg
  55. IF dw_edit_mode THEN
  56. dw_uc.AcceptText()
  57. IF dw_uc.GetNextModified(0, Primary!) = 0 THEN
  58. MessageBox('提示','没有任何修改,不可以保存!',information!,OK!)
  59. RETURN
  60. END IF
  61. dw_uc.Object.ClassName[dw_uc.GetRow()] = Trim(dw_uc.Object.ClassName[dw_uc.GetRow()])
  62. IF dw_uc.Object.ClassName[dw_uc.GetRow()] = '' THEN
  63. MessageBox('提示','请输入类型名称!',information!,OK!)
  64. RETURN
  65. END IF
  66. IF dw_uc.Object.billtype[dw_uc.GetRow()] = 0 THEN
  67. MessageBox('提示','没有指定单据类型!',information!,OK!)
  68. RETURN
  69. END IF
  70. IF dw_uc.Object.classid[dw_uc.GetRow()] = 0 THEN
  71. ll_newid = f_sys_scidentity(0,"U_FileClass","classid",errmsg,False,sqlca)
  72. IF ll_newid <= 0 THEN
  73. MessageBox(publ_operator,errmsg)
  74. RETURN
  75. ELSE
  76. dw_uc.Object.classid[dw_uc.GetRow()] = ll_newid
  77. END IF
  78. END IF
  79. dw_uc.AcceptText()
  80. END IF
  81. IF dw_edit_mode THEN
  82. String ls_errmsg
  83. IF dw_uc.Update() = -1 THEN
  84. IF Pos(ins_sqlerrtext,"Cannot insert duplicate key row") > 0 THEN
  85. ls_errmsg = "关键内容重复"
  86. ELSE
  87. ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext
  88. END IF
  89. ROLLBACK;
  90. MessageBox ('错误',ls_errmsg+",保存操作失败!",stopsign!,OK!)
  91. LS_UPDATE_FLAG = False
  92. RETURN
  93. ELSE
  94. COMMIT;
  95. FOR i = 1 To 3
  96. dw_uc.SetTabOrder ( i, 0 )
  97. NEXT
  98. LS_UPDATE_FLAG = True
  99. END IF
  100. ins_sqlerrtext = ""
  101. ELSE
  102. Long li_row, li_cur_row,blrow
  103. blrow = dw_bill_list.GetRow()
  104. IF blrow <= 0 THEN
  105. MessageBox('错误','没有指定当前单据类型',stopsign!,OK!)
  106. RETURN
  107. END IF
  108. li_cur_row = dw_uc.GetRow()
  109. li_row = dw_uc.InsertRow (0)
  110. FOR i = 1 To 3
  111. dw_uc.SetTabOrder ( i, i*10 )
  112. NEXT
  113. dw_uc.SelectRow(0,False)
  114. dw_uc.ScrollToRow (li_row)
  115. dw_uc.SelectRow(li_row,True)
  116. dw_uc.SetFocus()
  117. dw_uc.Object.billtype[li_row] = dw_bill_list.Object.billtype[blrow]
  118. modifyrow_no = li_row
  119. END IF
  120. dw_edit_mode = Not dw_edit_mode
  121. WF_FACE_CHANGE()
  122. end event
  123. type cb_edit from w_publ_edit_choice`cb_edit within w_fileclass_def
  124. end type
  125. event cb_edit::clicked;call super::clicked;if not f_power_ind(952) then
  126. messagebox('提示','你没有使用权限!',information!,OK!)
  127. return
  128. end if
  129. Long i
  130. IF dw_edit_mode THEN
  131. IF dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = NewModified! OR dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = New! THEN
  132. dw_uc.DeleteRow(dw_uc.GetRow())
  133. ELSE
  134. dw_uc.ReselectRow(dw_uc.GetRow())
  135. END IF
  136. FOR i = 1 TO 3
  137. dw_uc.SetTabOrder ( i, 0 )
  138. NEXT
  139. modifyrow_no = 0
  140. ELSE
  141. modifyrow_no = dw_uc.GetRow()
  142. FOR i = 1 TO 3
  143. dw_uc.SetTabOrder ( i, i*10 )
  144. NEXT
  145. dw_uc.SetFocus()
  146. dw_uc.SelectRow(0,FALSE)
  147. dw_uc.ScrollToRow (modifyrow_no)
  148. dw_uc.SelectRow(modifyrow_no,TRUE)
  149. END IF
  150. dw_edit_mode = NOT dw_edit_mode
  151. WF_FACE_CHANGE()
  152. end event
  153. type cb_delet from w_publ_edit_choice`cb_delet within w_fileclass_def
  154. end type
  155. event cb_delet::clicked;call super::clicked;IF NOT f_power_ind(952) THEN
  156. MessageBox('提示','你没有使用权限!',information!,OK!)
  157. RETURN
  158. END IF
  159. IF MessageBox ('询问',"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  160. RETURN
  161. END IF
  162. Long LS_id
  163. Long LS_LONG = 0
  164. String ls_code,arg_msg
  165. IF DW_UC.GetRow() <= 0 THEN
  166. MessageBox('提示','没有操作目标记录!',information!,OK!)
  167. RETURN
  168. END IF
  169. LS_id = DW_UC.Object.classid[DW_UC.GetRow()]
  170. SELECT COUNT(*) INTO :LS_LONG FROM U_File
  171. Where U_File.classid = :LS_id using sys_fileDB_sqlca;
  172. IF SQLCA.SQLCode <> 0 THEN
  173. MessageBox ('错误',"数据查询操作失败!(请重试!)",stopsign!,OK!)
  174. RETURN
  175. END IF
  176. IF LS_LONG > 0 THEN
  177. MessageBox ('错误',"该资料已经使用于档案资料,不可以删除!",stopsign!,OK!)
  178. RETURN
  179. END IF
  180. DW_UC.SetRedraw (FALSE)
  181. DW_UC.DeleteRow (0)
  182. DW_UC.TriggerEvent (RowFocusChanged!)
  183. IF DW_UC.Update() = -1 THEN
  184. ROLLBACK;
  185. MessageBox ('错误',"删除记录操作失败!",stopsign!,OK!)
  186. ELSE
  187. COMMIT;
  188. END IF
  189. DW_UC.SetRedraw (TRUE)
  190. end event
  191. type cb_choice from w_publ_edit_choice`cb_choice within w_fileclass_def
  192. integer x = 0
  193. string text = "刷新"
  194. string normalpicname = "refresh.BMP"
  195. end type
  196. event cb_choice::clicked;call super::clicked;parent.triggerevent('retrieve_uc')
  197. end event
  198. type dw_uc from w_publ_edit_choice`dw_uc within w_fileclass_def
  199. integer x = 1257
  200. integer y = 180
  201. integer width = 2290
  202. integer height = 2044
  203. string dataobject = "dw_fileclass"
  204. end type
  205. type cb_rtr from w_publ_edit_choice`cb_rtr within w_fileclass_def
  206. boolean visible = false
  207. integer x = 151
  208. end type
  209. type cb_help from w_publ_edit_choice`cb_help within w_fileclass_def
  210. integer x = 1115
  211. end type
  212. type ln_bar from w_publ_edit_choice`ln_bar within w_fileclass_def
  213. integer beginx = -37
  214. integer endx = 1966
  215. end type
  216. type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_fileclass_def
  217. integer beginx = -37
  218. integer endx = 1966
  219. end type
  220. type r_bar from w_publ_edit_choice`r_bar within w_fileclass_def
  221. integer x = 2592
  222. end type
  223. type dw_bill_list from u_dw_rbtnfilter within w_fileclass_def
  224. integer x = 5
  225. integer y = 180
  226. integer width = 1253
  227. integer height = 2044
  228. integer taborder = 20
  229. boolean bringtotop = true
  230. string dataobject = "dw_fj_bill_data"
  231. boolean hscrollbar = true
  232. boolean vscrollbar = true
  233. boolean rbutton_filter_use = true
  234. boolean titleclick_sort_use = true
  235. end type
  236. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 and not dw_edit_mode THEN
  237. this.SelectRow( 0, FALSE)
  238. this.SelectRow( currentrow, TRUE)
  239. this.ScrollToRow( currentrow)
  240. parent.triggerevent( 'retrieve_uc')
  241. END IF
  242. end event
  243. type cb_imexport from uo_imflatbutton within w_fileclass_def
  244. event ue_f7 ( )
  245. integer x = 837
  246. integer width = 279
  247. integer height = 164
  248. integer taborder = 20
  249. boolean bringtotop = true
  250. string text = "导入/导出"
  251. string normalpicname = "imexport.BMP"
  252. integer picsize = 16
  253. toolbaralignment pic_align = alignattop!
  254. boolean border = false
  255. end type
  256. event clicked;call super::clicked;open(w_fj_bill_mng_imexport)
  257. parent.triggerevent('retrieve_uc')
  258. end event