w_report_style_edit.srw 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. $PBExportHeader$w_report_style_edit.srw
  2. forward
  3. global type w_report_style_edit from w_publ_base
  4. end type
  5. type sle_name from singlelineedit within w_report_style_edit
  6. end type
  7. type st_1 from statictext within w_report_style_edit
  8. end type
  9. type cbx_ifshare from checkbox within w_report_style_edit
  10. end type
  11. type cb_1 from uo_imflatbutton within w_report_style_edit
  12. end type
  13. end forward
  14. global type w_report_style_edit from w_publ_base
  15. integer width = 1710
  16. integer height = 516
  17. string title = "报表解决方案"
  18. boolean minbox = false
  19. windowtype windowtype = response!
  20. sle_name sle_name
  21. st_1 st_1
  22. cbx_ifshare cbx_ifshare
  23. cb_1 cb_1
  24. end type
  25. global w_report_style_edit w_report_style_edit
  26. type variables
  27. long ins_empid
  28. string ins_dwname,ins_stylename
  29. long ins_ifshare
  30. long ins_edittype = 0 // 0 - 新建 1 - 修改
  31. string ins_dwnSyntax_sort,ins_dwnSyntax_filter
  32. string ins_dwnSyntax_layout_column_visible
  33. string ins_dwnSyntax_layout_column_width
  34. string ins_dwnSyntax_layout_column_x
  35. end variables
  36. on w_report_style_edit.create
  37. int iCurrent
  38. call super::create
  39. this.sle_name=create sle_name
  40. this.st_1=create st_1
  41. this.cbx_ifshare=create cbx_ifshare
  42. this.cb_1=create cb_1
  43. iCurrent=UpperBound(this.Control)
  44. this.Control[iCurrent+1]=this.sle_name
  45. this.Control[iCurrent+2]=this.st_1
  46. this.Control[iCurrent+3]=this.cbx_ifshare
  47. this.Control[iCurrent+4]=this.cb_1
  48. end on
  49. on w_report_style_edit.destroy
  50. call super::destroy
  51. destroy(this.sle_name)
  52. destroy(this.st_1)
  53. destroy(this.cbx_ifshare)
  54. destroy(this.cb_1)
  55. end on
  56. event open;call super::open;s_user_report_style s_style
  57. s_style = Message.PowerObjectParm
  58. ins_empid = s_style.empid
  59. ins_dwname = s_style.dwname
  60. ins_stylename = s_style.stylename
  61. ins_ifshare = s_style.ifshare
  62. ins_edittype = s_style.edittype
  63. ins_dwnSyntax_sort = s_style.sort
  64. ins_dwnSyntax_filter = s_style.filter
  65. ins_dwnSyntax_layout_column_visible = s_style.visible
  66. ins_dwnSyntax_layout_column_width = s_style.width
  67. ins_dwnSyntax_layout_column_x = s_style.column_x
  68. IF ins_edittype = 1 THEN
  69. sle_name.Text = ins_stylename
  70. IF ins_ifshare = 0 THEN
  71. cbx_ifshare.Checked = FALSE
  72. ELSE
  73. cbx_ifshare.Checked = TRUE
  74. END IF
  75. END IF
  76. end event
  77. type cb_func from w_publ_base`cb_func within w_report_style_edit
  78. boolean visible = false
  79. integer taborder = 30
  80. end type
  81. type cb_exit from w_publ_base`cb_exit within w_report_style_edit
  82. integer x = 1065
  83. integer y = 256
  84. integer taborder = 50
  85. end type
  86. type sle_name from singlelineedit within w_report_style_edit
  87. integer x = 375
  88. integer y = 48
  89. integer width = 1285
  90. integer height = 84
  91. integer taborder = 10
  92. boolean bringtotop = true
  93. integer textsize = -9
  94. integer weight = 400
  95. fontcharset fontcharset = gb2312charset!
  96. fontpitch fontpitch = variable!
  97. string facename = "宋体"
  98. long textcolor = 33554432
  99. borderstyle borderstyle = stylelowered!
  100. end type
  101. type st_1 from statictext within w_report_style_edit
  102. integer x = 23
  103. integer y = 68
  104. integer width = 334
  105. integer height = 48
  106. boolean bringtotop = true
  107. integer textsize = -9
  108. integer weight = 400
  109. fontcharset fontcharset = gb2312charset!
  110. fontpitch fontpitch = variable!
  111. string facename = "宋体"
  112. long textcolor = 33554432
  113. long backcolor = 134217739
  114. string text = "查询方案名称"
  115. alignment alignment = right!
  116. boolean focusrectangle = false
  117. end type
  118. type cbx_ifshare from checkbox within w_report_style_edit
  119. integer x = 229
  120. integer y = 160
  121. integer width = 201
  122. integer height = 60
  123. integer taborder = 20
  124. boolean bringtotop = true
  125. integer textsize = -9
  126. integer weight = 400
  127. fontcharset fontcharset = gb2312charset!
  128. fontpitch fontpitch = variable!
  129. string facename = "宋体"
  130. long textcolor = 33554432
  131. long backcolor = 134217739
  132. string text = "公共"
  133. boolean lefttext = true
  134. end type
  135. type cb_1 from uo_imflatbutton within w_report_style_edit
  136. integer x = 361
  137. integer y = 256
  138. integer width = 311
  139. integer height = 96
  140. integer taborder = 40
  141. boolean bringtotop = true
  142. end type
  143. event clicked;call super::clicked;String ls_stylename
  144. Int li_ifshare
  145. Long cnt
  146. ls_stylename = Trim(sle_name.Text)
  147. IF ls_stylename = '' THEN
  148. MessageBox('系统提示','请先填写查询方案名称')
  149. sle_name.SetFocus()
  150. RETURN
  151. END IF
  152. IF cbx_ifshare.Checked THEN
  153. li_ifshare = 1
  154. ELSE
  155. li_ifshare = 0
  156. END IF
  157. SELECT count(*) INTO :cnt
  158. FROM u_user_report_style
  159. WHERE empid = :ins_empid
  160. AND dwname = :ins_dwname
  161. AND stylename = :ls_stylename;
  162. IF sqlca.SQLCode <> 0 THEN
  163. MessageBox('Error','查询操作失败,'+sqlca.SQLErrText)
  164. RETURN
  165. END IF
  166. IF cnt > 0 THEN
  167. IF ls_stylename <> ins_stylename THEN
  168. IF MessageBox('询问','查询方案:'+ls_stylename+' 已存在,是否确认要覆盖原有的方案?',question!,yesno!) = 2 THEN RETURN
  169. END IF
  170. END IF
  171. IF ins_edittype = 1 THEN
  172. IF cnt > 0 THEN
  173. DELETE FROM u_user_report_style
  174. WHERE empid = :ins_empid
  175. AND dwname = :ins_dwname
  176. AND stylename = :ls_stylename;
  177. IF sqlca.SQLCode <> 0 THEN
  178. ROLLBACK;
  179. MessageBox('Error','删除原方案操作失败,'+sqlca.SQLErrText)
  180. RETURN
  181. END IF
  182. UPDATE u_user_report_style
  183. SET stylename = :ls_stylename,
  184. ifshare = :li_ifshare
  185. WHERE empid = :ins_empid
  186. AND dwname = :ins_dwname
  187. AND stylename = :ins_stylename;
  188. IF sqlca.SQLCode <> 0 THEN
  189. ROLLBACK;
  190. MessageBox('Error','更新操作失败,'+sqlca.SQLErrText)
  191. RETURN
  192. END IF
  193. ELSE
  194. UPDATE u_user_report_style
  195. SET stylename = :ls_stylename,
  196. ifshare = :li_ifshare
  197. WHERE empid = :ins_empid
  198. AND dwname = :ins_dwname
  199. AND stylename = :ins_stylename;
  200. IF sqlca.SQLCode <> 0 THEN
  201. ROLLBACK;
  202. MessageBox('Error','更新操作失败,'+sqlca.SQLErrText)
  203. RETURN
  204. END IF
  205. END IF
  206. ELSE
  207. IF cnt > 0 THEN
  208. UPDATE u_user_report_style
  209. SET ifshare = :li_ifshare,
  210. dwnSyntax_filter = :ins_dwnSyntax_filter,
  211. dwnSyntax_sort = :ins_dwnSyntax_sort,
  212. dwnSyntax_layout_column_visible = :ins_dwnSyntax_layout_column_visible,
  213. dwnSyntax_layout_column_width = :ins_dwnSyntax_layout_column_width,
  214. dwnSyntax_layout_column_x = :ins_dwnSyntax_layout_column_x
  215. WHERE empid = :ins_empid
  216. AND dwname = :ins_dwname
  217. AND stylename = :ls_stylename;
  218. IF sqlca.SQLCode <> 0 THEN
  219. ROLLBACK;
  220. MessageBox('Error','更新操作失败,'+sqlca.SQLErrText)
  221. RETURN
  222. END IF
  223. ELSE
  224. INSERT INTO u_user_report_style
  225. (empid,
  226. dwname,
  227. stylename,
  228. ifshare,
  229. dwnSyntax_filter,
  230. dwnSyntax_sort,
  231. dwnSyntax_layout_column_visible,
  232. dwnSyntax_layout_column_width,
  233. dwnSyntax_layout_column_x)
  234. VALUES
  235. (:ins_empid,
  236. :ins_dwname,
  237. :ls_stylename,
  238. :li_ifshare,
  239. :ins_dwnSyntax_filter,
  240. :ins_dwnSyntax_sort,
  241. :ins_dwnSyntax_layout_column_visible,
  242. :ins_dwnSyntax_layout_column_width,
  243. :ins_dwnSyntax_layout_column_x);
  244. IF sqlca.SQLCode <> 0 THEN
  245. ROLLBACK;
  246. MessageBox('Error','插入操作失败,'+sqlca.SQLErrText)
  247. RETURN
  248. END IF
  249. END IF
  250. END IF
  251. COMMIT;
  252. MessageBox('系统提示','操作成功!')
  253. Close(PARENT)
  254. end event