w_currency_edit.srw 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. $PBExportHeader$w_currency_edit.srw
  2. forward
  3. global type w_currency_edit from w_publ_edit_choice
  4. end type
  5. type cb_view from uo_imflatbutton within w_currency_edit
  6. end type
  7. end forward
  8. global type w_currency_edit from w_publ_edit_choice
  9. integer width = 1819
  10. integer height = 1640
  11. string title = "币种"
  12. boolean minbox = true
  13. windowtype windowtype = popup!
  14. boolean if_ue_retr = true
  15. boolean if_ue_filter = true
  16. boolean if_ue_sort = true
  17. boolean if_ue_sentdataout = true
  18. cb_view cb_view
  19. end type
  20. global w_currency_edit w_currency_edit
  21. type variables
  22. s_currency INS_RT_STRU
  23. end variables
  24. on w_currency_edit.create
  25. int iCurrent
  26. call super::create
  27. this.cb_view=create cb_view
  28. iCurrent=UpperBound(this.Control)
  29. this.Control[iCurrent+1]=this.cb_view
  30. end on
  31. on w_currency_edit.destroy
  32. call super::destroy
  33. destroy(this.cb_view)
  34. end on
  35. event close;call super::close;CloseWithReturn(This,INS_RT_STRU)
  36. end event
  37. type cb_func from w_publ_edit_choice`cb_func within w_currency_edit
  38. end type
  39. type cb_exit from w_publ_edit_choice`cb_exit within w_currency_edit
  40. integer x = 987
  41. end type
  42. type cb_add from w_publ_edit_choice`cb_add within w_currency_edit
  43. end type
  44. event cb_add::clicked;call super::clicked;IF NOT f_power_ind(247) THEN
  45. MessageBox('提示','你没有使用权限!', Information!, OK! )
  46. RETURN
  47. END IF
  48. Long ll_newid,i
  49. String errmsg
  50. IF dw_edit_mode THEN
  51. dw_uc.AcceptText()
  52. IF dw_uc.GetNextModified(0, Primary!) = 0 THEN
  53. MessageBox('提示','没有任何修改,不可以保存!', Information!, OK! )
  54. RETURN
  55. END IF
  56. dw_uc.Object.code[dw_uc.GetRow()] = Trim(dw_uc.Object.code[dw_uc.GetRow()])
  57. dw_uc.Object.name[dw_uc.GetRow()] = Trim(dw_uc.Object.name[dw_uc.GetRow()])
  58. IF dw_uc.Object.code[dw_uc.GetRow()] = '' THEN
  59. MessageBox('提示','请输入代号!', Information!, OK! )
  60. RETURN
  61. END IF
  62. IF dw_uc.Object.name[dw_uc.GetRow()] = '' THEN
  63. MessageBox('提示','请输入币种名称!', Information!, OK! )
  64. RETURN
  65. END IF
  66. IF dw_uc.Object.rate[dw_uc.GetRow()] = 0 THEN
  67. MessageBox('提示','请输入币种对人民币汇率!', Information!, OK! )
  68. RETURN
  69. END IF
  70. IF dw_uc.Object.moneyid[dw_uc.GetRow()] = 0 THEN
  71. ll_newid = f_sys_scidentity(0,"cw_currency","moneyid",errmsg,FALSE,sqlca)
  72. IF ll_newid <= 0 THEN
  73. MessageBox('提示',errmsg, Information!, OK! )
  74. RETURN
  75. ELSE
  76. dw_uc.Object.moneyid[dw_uc.GetRow()] = ll_newid
  77. END IF
  78. END IF
  79. if dw_uc.object.cmp[1]>1 then
  80. Messagebox('','本位币已存在,不能设定多个.', Information!, OK! )
  81. return
  82. end if
  83. END IF
  84. IF dw_edit_mode THEN
  85. String ls_errmsg
  86. IF dw_uc.Update() = -1 THEN
  87. IF Pos(ins_sqlerrtext,"Cannot insert duplicate key row") > 0 THEN
  88. ls_errmsg = "关键内容重复"
  89. ELSE
  90. ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext
  91. END IF
  92. ROLLBACK;
  93. MessageBox ('提示',ls_errmsg+",保存操作失败!", Information!, OK! )
  94. LS_UPDATE_FLAG = FALSE
  95. RETURN
  96. ELSE
  97. COMMIT;
  98. FOR i = 1 TO 5
  99. dw_uc.SetTabOrder ( i, 0 )
  100. NEXT
  101. LS_UPDATE_FLAG = TRUE
  102. END IF
  103. ins_sqlerrtext = ""
  104. ELSE
  105. Long li_row, li_cur_row
  106. li_cur_row = dw_uc.GetRow()
  107. li_row = dw_uc.InsertRow (0)
  108. FOR i = 1 TO 5
  109. dw_uc.SetTabOrder ( i, i*10 )
  110. NEXT
  111. dw_uc.SelectRow(0,FALSE)
  112. dw_uc.ScrollToRow (li_row)
  113. dw_uc.SelectRow(li_row,TRUE)
  114. dw_uc.SetFocus()
  115. modifyrow_no = li_row
  116. END IF
  117. dw_edit_mode = NOT dw_edit_mode
  118. WF_FACE_CHANGE()
  119. end event
  120. type cb_edit from w_publ_edit_choice`cb_edit within w_currency_edit
  121. end type
  122. event cb_edit::clicked;call super::clicked;if not f_power_ind(247) then
  123. messagebox('提示','你没有使用权限!', Information!, OK! )
  124. return
  125. end if
  126. Long i
  127. IF dw_edit_mode THEN
  128. IF dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = NewModified! OR dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = New! THEN
  129. dw_uc.DeleteRow(dw_uc.GetRow())
  130. ELSE
  131. dw_uc.ReselectRow(dw_uc.GetRow())
  132. END IF
  133. FOR i = 1 TO 5
  134. dw_uc.SetTabOrder ( i, 0 )
  135. NEXT
  136. modifyrow_no = 0
  137. ELSE
  138. modifyrow_no = dw_uc.GetRow()
  139. FOR i = 1 TO 5
  140. dw_uc.SetTabOrder ( i, i*10 )
  141. NEXT
  142. dw_uc.SetFocus()
  143. dw_uc.SelectRow(0,FALSE)
  144. dw_uc.ScrollToRow (modifyrow_no)
  145. dw_uc.SelectRow(modifyrow_no,TRUE)
  146. END IF
  147. dw_edit_mode = NOT dw_edit_mode
  148. WF_FACE_CHANGE()
  149. end event
  150. type cb_delet from w_publ_edit_choice`cb_delet within w_currency_edit
  151. end type
  152. event cb_delet::clicked;call super::clicked;if not f_power_ind(24) then
  153. messagebox('提示','你没有使用权限!', Information!, OK! )
  154. return
  155. end if
  156. IF MessageBox ('询问',"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  157. RETURN
  158. END IF
  159. string arg_msg
  160. long LS_id,LS_LONG
  161. IF DW_UC.GETROW()<=0 THEN
  162. MESSAGEBOX('提示','没有操作目标记录!', Information!, OK! )
  163. RETURN
  164. END IF
  165. LS_id = DW_UC.object.moneyid[DW_UC.GETROW()]
  166. LS_LONG = 0
  167. select COUNT(*) into :LS_LONG from u_saletask where u_saletask.moneyid=:LS_id ;
  168. if SQLCA.SQLCode<>0 and sqlca.sqlcode<>100 then
  169. rollback;
  170. MessageBox ("错误","数据查询操作失败!(请重试!)",Exclamation!,OK!)
  171. return
  172. end if
  173. IF LS_LONG>0 THEN
  174. MessageBox ("提示","该资料已经使用于销售订单,不可以删除!", Information!, OK! )
  175. RETURN
  176. END IF
  177. LS_LONG = 0
  178. select COUNT(*) into :LS_LONG from u_outware
  179. where u_outware.relint_2=:LS_id
  180. and u_outware.billtype = 1;
  181. if SQLCA.SQLCode<>0 and sqlca.sqlcode<>100 then
  182. rollback;
  183. MessageBox ("错误","数据查询操作失败!(请重试!)",Exclamation!,OK!)
  184. return
  185. end if
  186. IF LS_LONG>0 THEN
  187. MessageBox ("提示","该资料已经使用于销售单,不可以删除!", Information!, OK! )
  188. RETURN
  189. END IF
  190. dw_uc.SetRedraw (false)
  191. dw_UC.DeleteRow (0)
  192. dw_UC.TriggerEvent (rowfocuschanged!)
  193. if dw_UC.Update() = -1 then
  194. rollback;
  195. MessageBox ('提示',"删除记录操作失败!", Information!, OK! )
  196. else
  197. commit;
  198. end if
  199. dw_uc.SetRedraw (true)
  200. end event
  201. type cb_choice from w_publ_edit_choice`cb_choice within w_currency_edit
  202. boolean enabled = false
  203. end type
  204. event cb_choice::clicked;call super::clicked;Long ll_row
  205. ll_row = dw_uc.GetRow()
  206. IF ll_row <= 0 THEN
  207. messagebox('提示','请先选择目标行!', Information!, OK! )
  208. RETURN
  209. END IF
  210. INS_RT_STRU.moneyid = dw_uc.Object.moneyid[ll_row]
  211. INS_RT_STRU.rate = dw_uc.Object.rate[ll_row]
  212. INS_RT_STRU.name = dw_uc.Object.name[ll_row]
  213. Close(Parent)
  214. end event
  215. type dw_uc from w_publ_edit_choice`dw_uc within w_currency_edit
  216. integer width = 1792
  217. integer height = 1360
  218. string dataobject = "dw_currency_index"
  219. end type
  220. event dw_uc::doubleclicked;call super::doubleclicked;if cb_choice.Enabled then
  221. IF row <= 0 then return
  222. cb_choice.triggerevent(clicked!)
  223. end if
  224. end event
  225. type cb_rtr from w_publ_edit_choice`cb_rtr within w_currency_edit
  226. end type
  227. type cb_help from w_publ_edit_choice`cb_help within w_currency_edit
  228. boolean visible = false
  229. end type
  230. type ln_bar from w_publ_edit_choice`ln_bar within w_currency_edit
  231. integer endx = 1792
  232. end type
  233. type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_currency_edit
  234. integer endx = 1792
  235. end type
  236. type r_bar from w_publ_edit_choice`r_bar within w_currency_edit
  237. end type
  238. type cb_view from uo_imflatbutton within w_currency_edit
  239. boolean visible = false
  240. integer x = 837
  241. integer width = 151
  242. integer height = 164
  243. integer taborder = 30
  244. boolean bringtotop = true
  245. string text = "预览"
  246. string normalpicname = "preview.bmp"
  247. integer picsize = 16
  248. toolbaralignment pic_align = alignattop!
  249. boolean border = false
  250. end type
  251. event clicked;call super::clicked;S_print_MSG LS_PRMSG
  252. LS_PRMSG.obj_dwNAME = 'dw_rp_currency_index'
  253. LS_PRMSG.SHARE_DW = DW_UC
  254. LS_PRMSG.TAG_TEXT = parent.title
  255. LS_PRMSG.SETUP_FLAG = 0
  256. LS_PRMSG.PAGECH_FLAG = 1
  257. OpenWithParm(w_publ_preview,LS_PRMSG)
  258. end event