w_rp_post_propel_index.srw 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. $PBExportHeader$w_rp_post_propel_index.srw
  2. forward
  3. global type w_rp_post_propel_index from w_publ_easyq
  4. end type
  5. type dw_mx from u_dw_rbtnfilter within w_rp_post_propel_index
  6. end type
  7. type cb_edit from uo_imflatbutton within w_rp_post_propel_index
  8. end type
  9. type cb_del from uo_imflatbutton within w_rp_post_propel_index
  10. end type
  11. type cb_post from uo_imflatbutton within w_rp_post_propel_index
  12. end type
  13. end forward
  14. global type w_rp_post_propel_index from w_publ_easyq
  15. string title = "公告推送列表"
  16. event ue_retrieve_mx ( )
  17. dw_mx dw_mx
  18. cb_edit cb_edit
  19. cb_del cb_del
  20. cb_post cb_post
  21. end type
  22. global w_rp_post_propel_index w_rp_post_propel_index
  23. type variables
  24. uo_ljfieb uo_fieb
  25. Transaction tr_eb_sqlca
  26. end variables
  27. event ue_retrieve_mx();long ll_row
  28. ll_row = dw_1.getrow()
  29. if ll_row <= 0 then
  30. dw_mx.reset()
  31. return
  32. end if
  33. long ll_postid
  34. ll_postid = dw_1.object.postid[ll_row]
  35. dw_mx.retrieve(ll_postid)
  36. end event
  37. on w_rp_post_propel_index.create
  38. int iCurrent
  39. call super::create
  40. this.dw_mx=create dw_mx
  41. this.cb_edit=create cb_edit
  42. this.cb_del=create cb_del
  43. this.cb_post=create cb_post
  44. iCurrent=UpperBound(this.Control)
  45. this.Control[iCurrent+1]=this.dw_mx
  46. this.Control[iCurrent+2]=this.cb_edit
  47. this.Control[iCurrent+3]=this.cb_del
  48. this.Control[iCurrent+4]=this.cb_post
  49. end on
  50. on w_rp_post_propel_index.destroy
  51. call super::destroy
  52. destroy(this.dw_mx)
  53. destroy(this.cb_edit)
  54. destroy(this.cb_del)
  55. destroy(this.cb_post)
  56. end on
  57. event ue_before_open;call super::ue_before_open;
  58. tr_eb_sqlca = sys_email_sqlca // 电子商务连接
  59. uo_fieb = create uo_ljfieb
  60. uo_fieb.commit_transaction = tr_eb_sqlca
  61. dw_mx.settransobject(sqlca)
  62. end event
  63. event resize;ln_bar.endx = this.width
  64. ln_bar2.endx = this.width
  65. ln_1.endx = this.width
  66. ln_2.endx = this.width
  67. ln_3.endx = this.width
  68. ln_4.endx = this.width
  69. r_bar.width = this.width
  70. dw_1.width=this.width - dw_1.x - 40 - dw_mx.width - 5
  71. dw_1.height=this.height - dw_1.y - 150
  72. dw_mx.x = dw_1.x + dw_1.width + 5
  73. dw_mx.height = dw_1.height
  74. end event
  75. event open;call super::open;cb_1.TriggerEvent(Clicked!)
  76. end event
  77. type cb_func from w_publ_easyq`cb_func within w_rp_post_propel_index
  78. boolean visible = false
  79. end type
  80. type cb_exit from w_publ_easyq`cb_exit within w_rp_post_propel_index
  81. integer x = 750
  82. end type
  83. type cb_2 from w_publ_easyq`cb_2 within w_rp_post_propel_index
  84. boolean visible = false
  85. end type
  86. type cb_psetup from w_publ_easyq`cb_psetup within w_rp_post_propel_index
  87. boolean visible = false
  88. end type
  89. type cb_1 from w_publ_easyq`cb_1 within w_rp_post_propel_index
  90. end type
  91. event cb_1::clicked;call super::clicked;DateTime first_date,end_date
  92. first_date = DateTime(Date(em_1.Text),Time(0))
  93. end_date = DateTime(Date(em_2.Text),Time('23:59:59'))
  94. dw_1.retrieve(first_date,end_date)
  95. parent.triggerevent('ue_retrieve_mx')
  96. end event
  97. type st_3 from w_publ_easyq`st_3 within w_rp_post_propel_index
  98. integer width = 315
  99. string text = "开始日期从:"
  100. end type
  101. type st_4 from w_publ_easyq`st_4 within w_rp_post_propel_index
  102. integer x = 855
  103. end type
  104. type em_1 from w_publ_easyq`em_1 within w_rp_post_propel_index
  105. integer x = 347
  106. end type
  107. type em_2 from w_publ_easyq`em_2 within w_rp_post_propel_index
  108. integer x = 960
  109. end type
  110. type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_post_propel_index
  111. boolean visible = false
  112. end type
  113. type cbx_yl from w_publ_easyq`cbx_yl within w_rp_post_propel_index
  114. boolean visible = false
  115. end type
  116. type dw_1 from w_publ_easyq`dw_1 within w_rp_post_propel_index
  117. integer y = 308
  118. integer width = 2322
  119. string dataobject = "dw_rp_post_propel_index"
  120. end type
  121. event dw_1::rowfocuschanged;call super::rowfocuschanged;parent.triggerevent('ue_retrieve_mx')
  122. end event
  123. event dw_1::doubleclicked;call super::doubleclicked;cb_edit.triggerevent(clicked!)
  124. end event
  125. type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_post_propel_index
  126. end type
  127. type sle_cust from w_publ_easyq`sle_cust within w_rp_post_propel_index
  128. end type
  129. type st_mtrl from w_publ_easyq`st_mtrl within w_rp_post_propel_index
  130. end type
  131. type st_cust from w_publ_easyq`st_cust within w_rp_post_propel_index
  132. end type
  133. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_post_propel_index
  134. end type
  135. type pb_em1 from w_publ_easyq`pb_em1 within w_rp_post_propel_index
  136. integer x = 763
  137. end type
  138. type pb_em2 from w_publ_easyq`pb_em2 within w_rp_post_propel_index
  139. integer x = 1376
  140. end type
  141. type pb_2 from w_publ_easyq`pb_2 within w_rp_post_propel_index
  142. integer x = 1486
  143. end type
  144. type cb_help from w_publ_easyq`cb_help within w_rp_post_propel_index
  145. boolean visible = false
  146. end type
  147. type cb_copyself from w_publ_easyq`cb_copyself within w_rp_post_propel_index
  148. boolean visible = false
  149. end type
  150. type gb_1 from w_publ_easyq`gb_1 within w_rp_post_propel_index
  151. end type
  152. type ln_bar from w_publ_easyq`ln_bar within w_rp_post_propel_index
  153. end type
  154. type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_post_propel_index
  155. end type
  156. type r_bar from w_publ_easyq`r_bar within w_rp_post_propel_index
  157. end type
  158. type ln_1 from w_publ_easyq`ln_1 within w_rp_post_propel_index
  159. end type
  160. type ln_2 from w_publ_easyq`ln_2 within w_rp_post_propel_index
  161. end type
  162. type ln_3 from w_publ_easyq`ln_3 within w_rp_post_propel_index
  163. boolean visible = false
  164. end type
  165. type ln_4 from w_publ_easyq`ln_4 within w_rp_post_propel_index
  166. boolean visible = false
  167. end type
  168. type dw_mx from u_dw_rbtnfilter within w_rp_post_propel_index
  169. integer x = 2327
  170. integer y = 308
  171. integer width = 1257
  172. integer height = 1820
  173. integer taborder = 20
  174. boolean bringtotop = true
  175. string dataobject = "dw_rp_post_propel_mx"
  176. boolean hscrollbar = true
  177. boolean vscrollbar = true
  178. end type
  179. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  180. THIS.SelectRow(0,FALSE)
  181. THIS.SelectRow(currentrow,TRUE)
  182. END IF
  183. end event
  184. type cb_edit from uo_imflatbutton within w_rp_post_propel_index
  185. integer x = 425
  186. integer width = 151
  187. integer height = 164
  188. integer taborder = 30
  189. boolean bringtotop = true
  190. string text = "编辑"
  191. string normalpicname = "OPEN.BMP"
  192. integer picsize = 16
  193. toolbaralignment pic_align = alignattop!
  194. boolean border = false
  195. end type
  196. event clicked;call super::clicked;IF Not f_power_ind(3400) THEN
  197. MessageBox(publ_operator,sys_msg_pow)
  198. RETURN
  199. END IF
  200. long ll_row
  201. long ll_postid
  202. ll_row = dw_1.getrow()
  203. if ll_row <= 0 then
  204. messagebox('系统提示','请先选择要编辑的公告')
  205. return
  206. end if
  207. ll_postid = dw_1.object.postid[ll_row]
  208. openwithparm(w_post_propel_edit_ljfieb,ll_postid)
  209. cb_1.triggerevent(clicked!)
  210. end event
  211. type cb_del from uo_imflatbutton within w_rp_post_propel_index
  212. integer x = 581
  213. integer width = 165
  214. integer height = 164
  215. integer taborder = 50
  216. boolean bringtotop = true
  217. string text = "删除"
  218. string normalpicname = "DELETE.BMP"
  219. integer picsize = 16
  220. toolbaralignment pic_align = alignattop!
  221. boolean border = false
  222. end type
  223. event clicked;call super::clicked;If Not f_power_ind(3401) Then
  224. MessageBox(publ_operator,sys_msg_pow)
  225. Return
  226. End If
  227. Long ll_row,ll_i
  228. Long ll_postid
  229. ll_row = dw_1.GetRow()
  230. If ll_row <= 0 Then
  231. MessageBox('系统提示','请先选择要删除的公告')
  232. Return
  233. End If
  234. If MessageBox('询问','是否确定要删除选中的公告?',question!,yesno!) = 2 Then Return
  235. ll_postid = dw_1.Object.postid[ll_row]
  236. dw_mx.Retrieve(ll_postid)
  237. Long ll_sendcuscommid,ll_receivecuscommid
  238. String arg_msg_err,arg_msg_tmp
  239. String ls_commcode, ls_commsccode, ls_commname
  240. String ls_RelatedCode
  241. String ls_SerialNum
  242. Long ll_suc,ll_fail
  243. Select CusCommID
  244. Into :ll_sendcuscommid
  245. From LJFIEB_CusComm
  246. Where CusType = 0 Using tr_eb_sqlca;
  247. If tr_eb_sqlca.SQLCode <> 0 Then
  248. MessageBox('Error','查询本公司企业编号失败,'+tr_eb_sqlca.SQLErrText)
  249. Return
  250. End If
  251. ls_RelatedCode = String(ll_sendcuscommid) + '_' + String(ll_postid)
  252. For ll_i = 1 To dw_mx.RowCount()
  253. ls_commcode = dw_mx.Object.commcode[ll_i]
  254. ls_commsccode = dw_mx.Object.commsccode[ll_i]
  255. ls_commname = dw_mx.Object.commname[ll_i]
  256. Select TOP 1 NEWID() Into :ls_SerialNum
  257. From u_user Using sqlca;
  258. If sqlca.SQLCode <> 0 Then
  259. Rollback Using sqlca;
  260. MessageBox('Error', '第'+String(ll_i)+'行明细,生成序列号失败,'+sqlca.SQLErrText)
  261. Return
  262. End If
  263. Select CusCommID
  264. Into :ll_receivecuscommid
  265. From LJFIEB_CusComm
  266. Where cuscode = :ls_commcode Using tr_eb_sqlca;
  267. If tr_eb_sqlca.SQLCode <> 0 Then
  268. ll_receivecuscommid = 0
  269. End If
  270. If ll_receivecuscommid = 0 Then
  271. arg_msg_err = arg_msg_err + '第'+String(ll_i)+'行明细,'+ls_commname+',找不到对应的企业编号,请检查' + '~r~n'
  272. Continue
  273. End If
  274. If uo_fieb.add_packet(ls_SerialNum,'',ll_sendcuscommid,'',ll_receivecuscommid,ls_commsccode,20,'','','','',ls_RelatedCode,0,arg_msg_tmp,True) = 0 Then
  275. arg_msg_err = arg_msg_err + '第'+String(ll_i)+'行明细,'+ls_commname+',发送删除公告指令失败,'+arg_msg_tmp + '~r~n'
  276. ll_fail++
  277. Continue
  278. End If
  279. Next
  280. Delete From u_post_propel
  281. Where postid = :ll_postid Using sqlca;
  282. If sqlca.SQLCode <> 0 Then
  283. Rollback Using sqlca;
  284. MessageBox('error','删除公告失败,'+sqlca.SQLErrText)
  285. Return
  286. End If
  287. Delete From u_post_propel_mx
  288. Where postid = :ll_postid Using sqlca;
  289. If sqlca.SQLCode <> 0 Then
  290. Rollback Using sqlca;
  291. MessageBox('error','删除公告推送列表失败,'+sqlca.SQLErrText)
  292. Return
  293. End If
  294. Commit Using sqlca;
  295. If ll_fail > 0 Then
  296. OpenWithParm(w_message_err,arg_msg_err)
  297. End If
  298. cb_1.TriggerEvent(Clicked!)
  299. end event
  300. type cb_post from uo_imflatbutton within w_rp_post_propel_index
  301. integer x = 151
  302. integer width = 274
  303. integer height = 164
  304. integer taborder = 40
  305. boolean bringtotop = true
  306. string text = "发布公告"
  307. string normalpicname = "new.BMP"
  308. integer picsize = 16
  309. toolbaralignment pic_align = alignattop!
  310. boolean border = false
  311. end type
  312. event clicked;call super::clicked;IF Not f_power_ind(3400) THEN
  313. MessageBox(publ_operator,sys_msg_pow)
  314. RETURN
  315. END IF
  316. openwithparm(w_post_propel_edit_ljfieb,0)
  317. cb_1.triggerevent(clicked!)
  318. end event