w_ctdatetime_init.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. $PBExportHeader$w_ctdatetime_init.srw
  2. forward
  3. global type w_ctdatetime_init from w_publ_base
  4. end type
  5. type dw_1 from datawindow within w_ctdatetime_init
  6. end type
  7. type dw_2 from datawindow within w_ctdatetime_init
  8. end type
  9. type mle_log from multilineedit within w_ctdatetime_init
  10. end type
  11. type em_step from editmask within w_ctdatetime_init
  12. end type
  13. type gb_2 from groupbox within w_ctdatetime_init
  14. end type
  15. type gb_1 from groupbox within w_ctdatetime_init
  16. end type
  17. type st_msg from statictext within w_ctdatetime_init
  18. end type
  19. type st_2 from statictext within w_ctdatetime_init
  20. end type
  21. type em_1 from editmask within w_ctdatetime_init
  22. end type
  23. type st_1 from statictext within w_ctdatetime_init
  24. end type
  25. type cb_refresh_2 from uo_imflatbutton within w_ctdatetime_init
  26. end type
  27. type cb_5 from uo_imflatbutton within w_ctdatetime_init
  28. end type
  29. type cb_6 from uo_imflatbutton within w_ctdatetime_init
  30. end type
  31. type cb_1 from uo_imflatbutton within w_ctdatetime_init
  32. end type
  33. end forward
  34. global type w_ctdatetime_init from w_publ_base
  35. integer width = 3602
  36. integer height = 2200
  37. string title = "截数及数据删除"
  38. boolean maxbox = true
  39. windowstate windowstate = maximized!
  40. long backcolor = 80269524
  41. dw_1 dw_1
  42. dw_2 dw_2
  43. mle_log mle_log
  44. em_step em_step
  45. gb_2 gb_2
  46. gb_1 gb_1
  47. st_msg st_msg
  48. st_2 st_2
  49. em_1 em_1
  50. st_1 st_1
  51. cb_refresh_2 cb_refresh_2
  52. cb_5 cb_5
  53. cb_6 cb_6
  54. cb_1 cb_1
  55. end type
  56. global w_ctdatetime_init w_ctdatetime_init
  57. type variables
  58. uo_yfct uo_ct
  59. end variables
  60. on w_ctdatetime_init.create
  61. int iCurrent
  62. call super::create
  63. this.dw_1=create dw_1
  64. this.dw_2=create dw_2
  65. this.mle_log=create mle_log
  66. this.em_step=create em_step
  67. this.gb_2=create gb_2
  68. this.gb_1=create gb_1
  69. this.st_msg=create st_msg
  70. this.st_2=create st_2
  71. this.em_1=create em_1
  72. this.st_1=create st_1
  73. this.cb_refresh_2=create cb_refresh_2
  74. this.cb_5=create cb_5
  75. this.cb_6=create cb_6
  76. this.cb_1=create cb_1
  77. iCurrent=UpperBound(this.Control)
  78. this.Control[iCurrent+1]=this.dw_1
  79. this.Control[iCurrent+2]=this.dw_2
  80. this.Control[iCurrent+3]=this.mle_log
  81. this.Control[iCurrent+4]=this.em_step
  82. this.Control[iCurrent+5]=this.gb_2
  83. this.Control[iCurrent+6]=this.gb_1
  84. this.Control[iCurrent+7]=this.st_msg
  85. this.Control[iCurrent+8]=this.st_2
  86. this.Control[iCurrent+9]=this.em_1
  87. this.Control[iCurrent+10]=this.st_1
  88. this.Control[iCurrent+11]=this.cb_refresh_2
  89. this.Control[iCurrent+12]=this.cb_5
  90. this.Control[iCurrent+13]=this.cb_6
  91. this.Control[iCurrent+14]=this.cb_1
  92. end on
  93. on w_ctdatetime_init.destroy
  94. call super::destroy
  95. destroy(this.dw_1)
  96. destroy(this.dw_2)
  97. destroy(this.mle_log)
  98. destroy(this.em_step)
  99. destroy(this.gb_2)
  100. destroy(this.gb_1)
  101. destroy(this.st_msg)
  102. destroy(this.st_2)
  103. destroy(this.em_1)
  104. destroy(this.st_1)
  105. destroy(this.cb_refresh_2)
  106. destroy(this.cb_5)
  107. destroy(this.cb_6)
  108. destroy(this.cb_1)
  109. end on
  110. event open;call super::open;dw_1.settransobject(sqlca)
  111. dw_2.settransobject(sqlca)
  112. dw_1.retrieve()
  113. cb_refresh_2.triggerevent(clicked!)
  114. uo_ct = create uo_yfct
  115. end event
  116. event resize;mle_log.width=newwidth - mle_log.x - 5
  117. mle_log.height=newheight - mle_log.y - 10
  118. st_msg.width=mle_log.width
  119. end event
  120. type cb_func from w_publ_base`cb_func within w_ctdatetime_init
  121. end type
  122. type cb_exit from w_publ_base`cb_exit within w_ctdatetime_init
  123. integer x = 2313
  124. integer y = 40
  125. integer width = 274
  126. end type
  127. type dw_1 from datawindow within w_ctdatetime_init
  128. integer x = 14
  129. integer y = 1004
  130. integer width = 754
  131. integer height = 1056
  132. integer taborder = 20
  133. boolean bringtotop = true
  134. string dataobject = "dw_ctdatatime_init"
  135. boolean vscrollbar = true
  136. boolean livescroll = true
  137. borderstyle borderstyle = stylelowered!
  138. end type
  139. type dw_2 from datawindow within w_ctdatetime_init
  140. integer width = 2286
  141. integer height = 800
  142. integer taborder = 50
  143. boolean bringtotop = true
  144. string dataobject = "dw_ctdatatime_mx"
  145. boolean vscrollbar = true
  146. boolean livescroll = true
  147. borderstyle borderstyle = stylelowered!
  148. end type
  149. event rowfocuschanged;if currentrow<=0 then return
  150. this.selectrow(0,false)
  151. this.selectrow(currentrow,true)
  152. end event
  153. type mle_log from multilineedit within w_ctdatetime_init
  154. integer x = 791
  155. integer y = 888
  156. integer width = 2779
  157. integer height = 1188
  158. integer taborder = 40
  159. boolean bringtotop = true
  160. integer textsize = -9
  161. integer weight = 400
  162. fontcharset fontcharset = gb2312charset!
  163. fontpitch fontpitch = variable!
  164. string facename = "宋体"
  165. long textcolor = 33554432
  166. boolean hscrollbar = true
  167. boolean vscrollbar = true
  168. boolean displayonly = true
  169. borderstyle borderstyle = stylelowered!
  170. end type
  171. type em_step from editmask within w_ctdatetime_init
  172. integer x = 2313
  173. integer y = 508
  174. integer width = 274
  175. integer height = 96
  176. integer taborder = 100
  177. boolean bringtotop = true
  178. integer textsize = -9
  179. integer weight = 400
  180. fontcharset fontcharset = gb2312charset!
  181. fontpitch fontpitch = variable!
  182. string facename = "宋体"
  183. long textcolor = 33554432
  184. string text = "100"
  185. alignment alignment = center!
  186. borderstyle borderstyle = stylelowered!
  187. string mask = "###"
  188. boolean spin = true
  189. double increment = 10
  190. string minmax = "50~~150"
  191. end type
  192. type gb_2 from groupbox within w_ctdatetime_init
  193. integer y = 780
  194. integer width = 786
  195. integer height = 1296
  196. integer taborder = 110
  197. integer textsize = -9
  198. integer weight = 400
  199. fontcharset fontcharset = gb2312charset!
  200. fontpitch fontpitch = variable!
  201. string facename = "宋体"
  202. long textcolor = 33554432
  203. long backcolor = 67108864
  204. end type
  205. type gb_1 from groupbox within w_ctdatetime_init
  206. integer x = 2295
  207. integer width = 315
  208. integer height = 800
  209. integer taborder = 120
  210. integer textsize = -9
  211. integer weight = 400
  212. fontcharset fontcharset = gb2312charset!
  213. fontpitch fontpitch = variable!
  214. string facename = "宋体"
  215. long textcolor = 33554432
  216. long backcolor = 67108864
  217. end type
  218. type st_msg from statictext within w_ctdatetime_init
  219. integer x = 791
  220. integer y = 808
  221. integer width = 2779
  222. integer height = 76
  223. boolean bringtotop = true
  224. integer textsize = -9
  225. integer weight = 400
  226. fontcharset fontcharset = gb2312charset!
  227. fontpitch fontpitch = variable!
  228. string facename = "宋体"
  229. long textcolor = 33554432
  230. long backcolor = 16776960
  231. boolean enabled = false
  232. boolean border = true
  233. boolean focusrectangle = false
  234. end type
  235. type st_2 from statictext within w_ctdatetime_init
  236. integer x = 18
  237. integer y = 840
  238. integer width = 251
  239. integer height = 60
  240. boolean bringtotop = true
  241. integer textsize = -9
  242. integer weight = 400
  243. fontcharset fontcharset = gb2312charset!
  244. fontpitch fontpitch = variable!
  245. string facename = "宋体"
  246. long textcolor = 33554432
  247. long backcolor = 67108864
  248. boolean enabled = false
  249. string text = "截数日期"
  250. boolean focusrectangle = false
  251. end type
  252. type em_1 from editmask within w_ctdatetime_init
  253. integer x = 270
  254. integer y = 824
  255. integer width = 480
  256. integer height = 92
  257. integer taborder = 90
  258. boolean bringtotop = true
  259. integer textsize = -9
  260. integer weight = 400
  261. fontcharset fontcharset = gb2312charset!
  262. fontpitch fontpitch = variable!
  263. string facename = "宋体"
  264. long textcolor = 33554432
  265. alignment alignment = center!
  266. borderstyle borderstyle = stylelowered!
  267. maskdatatype maskdatatype = datemask!
  268. string mask = "yyyy-mm-dd"
  269. boolean spin = true
  270. end type
  271. event constructor;this.text=string(today(),'yyyy-mm-dd')
  272. end event
  273. event rbuttondown;s_calender_arg s_calender
  274. s_calender.PointerX = THIS.PointerX()
  275. s_calender.PointerY = THIS.PointerY()
  276. s_calender.X = THIS.X
  277. s_calender.Y = THIS.Y
  278. OpenWithParm(w_calendar,s_calender)
  279. THIS.Text = String(id_date_selected)
  280. end event
  281. type st_1 from statictext within w_ctdatetime_init
  282. integer x = 2313
  283. integer y = 448
  284. integer width = 274
  285. integer height = 48
  286. boolean bringtotop = true
  287. integer textsize = -9
  288. integer weight = 400
  289. fontcharset fontcharset = gb2312charset!
  290. fontpitch fontpitch = variable!
  291. string facename = "宋体"
  292. long textcolor = 33554432
  293. long backcolor = 67108864
  294. string text = "提交步长:"
  295. boolean focusrectangle = false
  296. end type
  297. type cb_refresh_2 from uo_imflatbutton within w_ctdatetime_init
  298. integer x = 2313
  299. integer y = 276
  300. integer width = 274
  301. integer height = 96
  302. integer taborder = 20
  303. boolean bringtotop = true
  304. string text = "刷新"
  305. end type
  306. event clicked;call super::clicked;dw_2.retrieve()
  307. end event
  308. type cb_5 from uo_imflatbutton within w_ctdatetime_init
  309. integer x = 270
  310. integer y = 920
  311. integer width = 242
  312. integer height = 80
  313. integer taborder = 30
  314. boolean bringtotop = true
  315. string text = "检查"
  316. end type
  317. event clicked;call super::clicked;string arg_log,arg_msg
  318. datetime server_dt
  319. server_dt=datetime(date(em_1.text),time('23:59:59'))
  320. if uo_ct.check_no_finish(server_dt,arg_log,arg_msg)=0 then
  321. end if
  322. mle_log.text=arg_log
  323. end event
  324. type cb_6 from uo_imflatbutton within w_ctdatetime_init
  325. integer x = 507
  326. integer y = 920
  327. integer width = 242
  328. integer height = 80
  329. integer taborder = 40
  330. boolean bringtotop = true
  331. string text = "截数"
  332. end type
  333. event clicked;call super::clicked;datetime server_dt
  334. string arg_msg,arg_log
  335. if if_hisdb then
  336. messagebox('提示','当前数据库是历史查询数据库,不能截数',information!,OK!)
  337. return
  338. end if
  339. server_dt=datetime(date(em_1.text),time('23:59:59'))
  340. if MessageBox("询问", '是否将当前时间 '+string(server_dt,'yyyy-mm-dd hh:mm:SS')+' 设定为截数时间?', Question!, yesno!, 2)=2 then return
  341. if uo_ct.init_ct(true,server_dt,arg_msg,arg_log,false)=0 then
  342. messagebox('错误','设定截数时间失败>>'+arg_msg,stopsign!,OK!)
  343. return
  344. end if
  345. //应付帐
  346. if f_ct_mstpay(server_dt,arg_msg,arg_log,false)=0 then
  347. messagebox('错误','设定应付帐删除标记失败>>'+arg_msg,stopsign!,OK!)
  348. return
  349. end if
  350. //应收帐
  351. if f_ct_msttake(server_dt,arg_msg,arg_log,true)=0 then
  352. messagebox('错误','设定应收帐删除标记失败>>'+arg_msg,stopsign!,OK!)
  353. return
  354. end if
  355. messagebox('提示','设定截数时间成功'+arg_msg,information!,OK!)
  356. mle_log.text=arg_log
  357. dw_1.retrieve()
  358. end event
  359. type cb_1 from uo_imflatbutton within w_ctdatetime_init
  360. integer x = 2313
  361. integer y = 612
  362. integer width = 274
  363. integer height = 96
  364. integer taborder = 20
  365. boolean bringtotop = true
  366. string text = "删除数据"
  367. end type
  368. event clicked;call super::clicked;long li_row,ls_ct_errnum
  369. datetime bgdt,eddt
  370. long bg_ctmint,ed_ctmint,ls_ct_id
  371. int ls_step
  372. string arg_msg,arg_log
  373. if if_hisdb then
  374. messagebox('提示','当前数据库是历史查询数据库,不能截数',information!,OK!)
  375. return
  376. end if
  377. li_row=dw_2.getrow()
  378. if li_row <=0 then
  379. messagebox("提示",'请选择要删除数据的截数',information!,OK!)
  380. return
  381. end if
  382. bgdt=dw_2.object.ct_stdt[li_row]
  383. eddt=dw_2.object.ct_eddt[li_row]
  384. ls_ct_errnum=dw_2.object.ct_errnum[li_row]
  385. ls_ct_id=dw_2.object.ct_id[li_row]
  386. IF MessageBox ("询问","是否确定要删除截数数据吗?["+string(bgdt)+' - '+string(eddt)+']的已经截数的数据,删除时间可能要很长,系统将不能进行其它操作?',Question!,YesNo! ) = 2 THEN RETURN
  387. if ls_ct_errnum > 0 then
  388. messagebox("提示","["+string(bgdt)+' - '+string(eddt)+']的已经截数的数据在导出时有错误,不能删除',information!,OK!)
  389. return
  390. end if
  391. select ct_dateint into :bg_ctmint from sys_ct_data where ct_datetime = :bgdt;
  392. if sqlca.sqlcode <> 0 then
  393. messagebox("错误",'查询截数开始时间标记失败',stopsign!,OK!)
  394. return
  395. end if
  396. select ct_dateint into :ed_ctmint from sys_ct_data where ct_datetime = :eddt;
  397. if sqlca.sqlcode <> 0 then
  398. messagebox("错误",'查询截数结束时间标记失败',stopsign!,OK!)
  399. return
  400. end if
  401. ls_step=integer(em_step.text)
  402. if ls_step=0 then
  403. messagebox("提示",'请输入提交步长',information!,OK!)
  404. return
  405. end if
  406. uo_ct.del_ct_data(eddt,ls_ct_id,bg_ctmint,ed_ctmint,ls_step,arg_msg,arg_log,true)
  407. UPDATE sys_ct_datamx
  408. SET ct_delflag = 1
  409. Where sys_ct_datamx.ct_id = :ls_ct_id;
  410. IF sqlca.SQLCode <> 0 THEN
  411. MessageBox("错误",'更新删除标记失败',stopsign!,OK!)
  412. RETURN
  413. END IF
  414. mle_log.text=arg_log
  415. messagebox("提示",'数据删除完毕',information!,OK!)
  416. end event