w_publ_input_datetime.srw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. $PBExportHeader$w_publ_input_datetime.srw
  2. forward
  3. global type w_publ_input_datetime from w_publ_base
  4. end type
  5. type cbx_else from checkbox within w_publ_input_datetime
  6. end type
  7. type ddlb_op from dropdownlistbox within w_publ_input_datetime
  8. end type
  9. type sle_nr from editmask within w_publ_input_datetime
  10. end type
  11. type cbx_timeinuse from checkbox within w_publ_input_datetime
  12. end type
  13. type sle_time from editmask within w_publ_input_datetime
  14. end type
  15. type cb_add from uo_imflatbutton within w_publ_input_datetime
  16. end type
  17. type cb_repl from uo_imflatbutton within w_publ_input_datetime
  18. end type
  19. type sle_nr_end from editmask within w_publ_input_datetime
  20. end type
  21. type sle_time_end from editmask within w_publ_input_datetime
  22. end type
  23. type st_1 from statictext within w_publ_input_datetime
  24. end type
  25. type st_2 from statictext within w_publ_input_datetime
  26. end type
  27. type cbx_area from checkbox within w_publ_input_datetime
  28. end type
  29. type gb_1 from groupbox within w_publ_input_datetime
  30. end type
  31. type cbx_timeinuse_end from checkbox within w_publ_input_datetime
  32. end type
  33. type ddlb_date from dropdownlistbox within w_publ_input_datetime
  34. end type
  35. type gb_2 from groupbox within w_publ_input_datetime
  36. end type
  37. end forward
  38. global type w_publ_input_datetime from w_publ_base
  39. integer x = 407
  40. integer y = 224
  41. integer width = 1865
  42. integer height = 520
  43. string title = "请填入补充内容"
  44. boolean minbox = false
  45. windowtype windowtype = response!
  46. cbx_else cbx_else
  47. ddlb_op ddlb_op
  48. sle_nr sle_nr
  49. cbx_timeinuse cbx_timeinuse
  50. sle_time sle_time
  51. cb_add cb_add
  52. cb_repl cb_repl
  53. sle_nr_end sle_nr_end
  54. sle_time_end sle_time_end
  55. st_1 st_1
  56. st_2 st_2
  57. cbx_area cbx_area
  58. gb_1 gb_1
  59. cbx_timeinuse_end cbx_timeinuse_end
  60. ddlb_date ddlb_date
  61. gb_2 gb_2
  62. end type
  63. global w_publ_input_datetime w_publ_input_datetime
  64. type variables
  65. string cur_filter_expr
  66. //当前FILTER表达式
  67. string cur_filter_expr_INCHA
  68. //当前FILTER表达式中文表示
  69. s_esq_tran ls_esq_tran
  70. //返回结构
  71. INT SHORTHEIGHT=336,LONGHEIGHT=1000
  72. end variables
  73. forward prototypes
  74. public function integer days_in_month (integer month, integer year)
  75. end prototypes
  76. public function integer days_in_month (integer month, integer year);//Most cases are straight forward in that there are a fixed number of
  77. //days in 11 of the 12 months. February is, of course, the problem.
  78. //In a leap year February has 29 days, otherwise 28.
  79. Integer li_DaysInMonth, li_Days[12] = {31,28,31,30,31,30,31,31,30,31,30,31}
  80. // Get the number of days per month for a non leap year.
  81. li_DaysInMonth = li_Days[Month]
  82. // Check for a leap year.
  83. If Month = 2 Then
  84. // If the year is a leap year, change the number of days.
  85. // Leap Year Calculation:
  86. // Year divisible by 4, but not by 100, unless it is also divisible by 400
  87. If ( (Mod(Year,4) = 0 And Mod(Year,100) <> 0) Or (Mod(Year,400) = 0) ) Then
  88. li_DaysInMonth = 29
  89. End If
  90. End If
  91. //Return the number of days in the relevant month
  92. Return li_DaysInMonth
  93. end function
  94. on w_publ_input_datetime.create
  95. int iCurrent
  96. call super::create
  97. this.cbx_else=create cbx_else
  98. this.ddlb_op=create ddlb_op
  99. this.sle_nr=create sle_nr
  100. this.cbx_timeinuse=create cbx_timeinuse
  101. this.sle_time=create sle_time
  102. this.cb_add=create cb_add
  103. this.cb_repl=create cb_repl
  104. this.sle_nr_end=create sle_nr_end
  105. this.sle_time_end=create sle_time_end
  106. this.st_1=create st_1
  107. this.st_2=create st_2
  108. this.cbx_area=create cbx_area
  109. this.gb_1=create gb_1
  110. this.cbx_timeinuse_end=create cbx_timeinuse_end
  111. this.ddlb_date=create ddlb_date
  112. this.gb_2=create gb_2
  113. iCurrent=UpperBound(this.Control)
  114. this.Control[iCurrent+1]=this.cbx_else
  115. this.Control[iCurrent+2]=this.ddlb_op
  116. this.Control[iCurrent+3]=this.sle_nr
  117. this.Control[iCurrent+4]=this.cbx_timeinuse
  118. this.Control[iCurrent+5]=this.sle_time
  119. this.Control[iCurrent+6]=this.cb_add
  120. this.Control[iCurrent+7]=this.cb_repl
  121. this.Control[iCurrent+8]=this.sle_nr_end
  122. this.Control[iCurrent+9]=this.sle_time_end
  123. this.Control[iCurrent+10]=this.st_1
  124. this.Control[iCurrent+11]=this.st_2
  125. this.Control[iCurrent+12]=this.cbx_area
  126. this.Control[iCurrent+13]=this.gb_1
  127. this.Control[iCurrent+14]=this.cbx_timeinuse_end
  128. this.Control[iCurrent+15]=this.ddlb_date
  129. this.Control[iCurrent+16]=this.gb_2
  130. end on
  131. on w_publ_input_datetime.destroy
  132. call super::destroy
  133. destroy(this.cbx_else)
  134. destroy(this.ddlb_op)
  135. destroy(this.sle_nr)
  136. destroy(this.cbx_timeinuse)
  137. destroy(this.sle_time)
  138. destroy(this.cb_add)
  139. destroy(this.cb_repl)
  140. destroy(this.sle_nr_end)
  141. destroy(this.sle_time_end)
  142. destroy(this.st_1)
  143. destroy(this.st_2)
  144. destroy(this.cbx_area)
  145. destroy(this.gb_1)
  146. destroy(this.cbx_timeinuse_end)
  147. destroy(this.ddlb_date)
  148. destroy(this.gb_2)
  149. end on
  150. event open;call super::open;string ls_datetime
  151. ls_esq_tran=Message.PowerObjectParm
  152. this.title='查询项目: '+ls_esq_tran.title
  153. ls_datetime=string(ls_esq_tran.dt_data)
  154. sle_nr.text=left(ls_datetime,10)
  155. //sle_time.text=string(time(''))
  156. cur_filter_expr=ls_esq_tran.cur_filter_expr
  157. cur_filter_expr_INCHA=ls_esq_tran.cur_filter_expr_INCHA
  158. //THIS.HEIGHT=SHORTHEIGHT
  159. sle_nr_end.text=left(ls_datetime,10)
  160. environment exerun_env
  161. GetEnvironment(exerun_env )
  162. this.x=ls_esq_tran.x - 200
  163. this.y=ls_esq_tran.y - 130
  164. if this.x < 0 then this.x=0
  165. if this.y < 0 then this.y=0
  166. if this.x > PixelsToUnits(exerun_env.screenwidth, XPixelsToUnits!) - this.Width then this.x = PixelsToUnits(exerun_env.screenwidth, XPixelsToUnits!) - this.Width
  167. if this.y > PixelsToUnits(exerun_env.screenheight, yPixelsToUnits!) - this.HeighT then this.y = PixelsToUnits(exerun_env.screenheight, yPixelsToUnits!) - this.HeighT
  168. ls_esq_tran.return_flag=0
  169. sle_nr.text=left(ls_datetime,10)
  170. this.Height = 460
  171. end event
  172. event rbuttondown;cb_exit.postevent(clicked!)
  173. end event
  174. event close;CloseWithReturn(THIS,ls_esq_tran)
  175. end event
  176. type cb_func from w_publ_base`cb_func within w_publ_input_datetime
  177. boolean visible = false
  178. integer x = 1449
  179. integer y = 192
  180. integer taborder = 40
  181. boolean enabled = false
  182. end type
  183. type cb_exit from w_publ_base`cb_exit within w_publ_input_datetime
  184. integer x = 1170
  185. integer y = 192
  186. integer width = 325
  187. integer taborder = 30
  188. string text = "取消"
  189. end type
  190. type cbx_else from checkbox within w_publ_input_datetime
  191. integer x = 1518
  192. integer y = 16
  193. integer width = 206
  194. integer height = 76
  195. boolean bringtotop = true
  196. integer textsize = -9
  197. integer weight = 400
  198. fontcharset fontcharset = gb2312charset!
  199. fontpitch fontpitch = variable!
  200. string facename = "宋体"
  201. long textcolor = 16711680
  202. long backcolor = 134217739
  203. string text = "除外"
  204. end type
  205. type ddlb_op from dropdownlistbox within w_publ_input_datetime
  206. integer x = 37
  207. integer y = 48
  208. integer width = 178
  209. integer height = 440
  210. integer taborder = 50
  211. boolean bringtotop = true
  212. integer textsize = -9
  213. integer weight = 400
  214. fontcharset fontcharset = gb2312charset!
  215. fontpitch fontpitch = variable!
  216. string facename = "宋体"
  217. long textcolor = 33554432
  218. string text = "="
  219. boolean sorted = false
  220. boolean hscrollbar = true
  221. string item[] = {">",">=","<","<=","="}
  222. borderstyle borderstyle = stylelowered!
  223. end type
  224. type sle_nr from editmask within w_publ_input_datetime
  225. integer x = 219
  226. integer y = 44
  227. integer width = 407
  228. integer height = 88
  229. integer taborder = 10
  230. boolean bringtotop = true
  231. integer textsize = -9
  232. integer weight = 400
  233. fontcharset fontcharset = gb2312charset!
  234. fontpitch fontpitch = variable!
  235. string facename = "宋体"
  236. long textcolor = 33554432
  237. alignment alignment = center!
  238. borderstyle borderstyle = stylelowered!
  239. maskdatatype maskdatatype = datetimemask!
  240. string mask = "yyyy-mm-dd"
  241. boolean spin = true
  242. end type
  243. event rbuttondown;s_calender_arg s_calender
  244. s_calender.PointerX = THIS.PointerX()
  245. s_calender.PointerY = THIS.PointerY()
  246. s_calender.X = THIS.X
  247. s_calender.Y = THIS.Y
  248. OpenWithParm(w_calendar,s_calender)
  249. THIS.Text = String(id_date_selected)
  250. end event
  251. type cbx_timeinuse from checkbox within w_publ_input_datetime
  252. integer x = 649
  253. integer y = 52
  254. integer width = 411
  255. integer height = 76
  256. boolean bringtotop = true
  257. integer textsize = -9
  258. integer weight = 400
  259. fontcharset fontcharset = gb2312charset!
  260. fontpitch fontpitch = variable!
  261. string facename = "宋体"
  262. long textcolor = 255
  263. long backcolor = 134217739
  264. string text = "使用时间查询"
  265. end type
  266. event clicked;if cbx_timeinuse.checked then
  267. sle_time.enabled=true
  268. ls_esq_tran.b_timeinuse=1
  269. else
  270. sle_time.enabled=false
  271. ls_esq_tran.b_timeinuse=0
  272. end if
  273. end event
  274. type sle_time from editmask within w_publ_input_datetime
  275. integer x = 1129
  276. integer y = 44
  277. integer width = 347
  278. integer height = 88
  279. integer taborder = 80
  280. boolean bringtotop = true
  281. integer textsize = -9
  282. integer weight = 400
  283. fontcharset fontcharset = gb2312charset!
  284. fontpitch fontpitch = variable!
  285. string facename = "宋体"
  286. long textcolor = 33554432
  287. boolean enabled = false
  288. borderstyle borderstyle = stylelowered!
  289. maskdatatype maskdatatype = timemask!
  290. string mask = "hh:mm:ss"
  291. boolean spin = true
  292. end type
  293. type cb_add from uo_imflatbutton within w_publ_input_datetime
  294. integer x = 699
  295. integer y = 192
  296. integer width = 325
  297. integer height = 96
  298. integer taborder = 60
  299. boolean bringtotop = true
  300. string text = "增加条件"
  301. end type
  302. event clicked;call super::clicked;String ls_date
  303. String ls_time
  304. String ls_date_end
  305. String ls_time_end
  306. ls_date = sle_nr.Text
  307. ls_time = sle_time.Text
  308. IF cbx_timeinuse.Checked THEN
  309. ls_esq_tran.dt_data = DateTime(Date(ls_date),Time(ls_time))
  310. ELSE
  311. ls_esq_tran.dt_data = DateTime(Date(ls_date),Time(0))
  312. END IF
  313. ls_esq_tran.comp_op = ddlb_op.Text
  314. ls_esq_tran.else_boolean = cbx_else.Checked
  315. ls_esq_tran.return_flag = 1
  316. ls_date_end = sle_nr_end.Text
  317. ls_time_end = sle_time_end.Text
  318. IF cbx_timeinuse_end.Checked THEN
  319. ls_esq_tran.dt_date_end = DateTime(Date(ls_date_end),Time(ls_time_end))
  320. ELSE
  321. ls_esq_tran.dt_date_end = DateTime(Date(ls_date_end),Time(0))
  322. END IF
  323. ls_esq_tran.if_area = cbx_area.Checked
  324. Close(PARENT)
  325. end event
  326. type cb_repl from uo_imflatbutton within w_publ_input_datetime
  327. integer x = 229
  328. integer y = 192
  329. integer width = 325
  330. integer taborder = 20
  331. boolean bringtotop = true
  332. string text = "重新查询"
  333. boolean default = true
  334. end type
  335. event clicked;call super::clicked;String ls_date
  336. String ls_time
  337. String ls_date_end
  338. String ls_time_end
  339. ls_date = sle_nr.Text
  340. ls_time = sle_time.Text
  341. IF cbx_timeinuse.Checked THEN
  342. ls_esq_tran.dt_data = DateTime(Date(ls_date),Time(ls_time))
  343. ELSE
  344. ls_esq_tran.dt_data = DateTime(Date(ls_date),Time(0))
  345. END IF
  346. ls_esq_tran.comp_op = ddlb_op.Text
  347. ls_esq_tran.else_boolean = cbx_else.Checked
  348. ls_esq_tran.return_flag = 2
  349. ls_date_end = sle_nr_end.Text
  350. ls_time_end = sle_time_end.Text
  351. IF cbx_timeinuse_end.Checked THEN
  352. ls_esq_tran.dt_date_end = DateTime(Date(ls_date_end),Time(ls_time_end))
  353. ELSE
  354. ls_esq_tran.dt_date_end = DateTime(Date(ls_date_end),Time(0))
  355. END IF
  356. ls_esq_tran.if_area = cbx_area.Checked
  357. Close(PARENT)
  358. end event
  359. type sle_nr_end from editmask within w_publ_input_datetime
  360. boolean visible = false
  361. integer x = 219
  362. integer y = 192
  363. integer width = 407
  364. integer height = 88
  365. integer taborder = 80
  366. boolean bringtotop = true
  367. integer textsize = -9
  368. integer weight = 400
  369. fontcharset fontcharset = gb2312charset!
  370. fontpitch fontpitch = variable!
  371. string facename = "宋体"
  372. long textcolor = 33554432
  373. alignment alignment = center!
  374. borderstyle borderstyle = stylelowered!
  375. maskdatatype maskdatatype = datetimemask!
  376. string mask = "yyyy-mm-dd"
  377. boolean spin = true
  378. end type
  379. event rbuttondown;s_calender_arg s_calender
  380. s_calender.PointerX = THIS.PointerX()
  381. s_calender.PointerY = THIS.PointerY()
  382. s_calender.X = THIS.X
  383. s_calender.Y = THIS.Y
  384. OpenWithParm(w_calendar,s_calender)
  385. THIS.Text = String(id_date_selected)
  386. end event
  387. type sle_time_end from editmask within w_publ_input_datetime
  388. boolean visible = false
  389. integer x = 1129
  390. integer y = 192
  391. integer width = 347
  392. integer height = 88
  393. integer taborder = 20
  394. boolean bringtotop = true
  395. integer textsize = -9
  396. integer weight = 400
  397. fontcharset fontcharset = gb2312charset!
  398. fontpitch fontpitch = variable!
  399. string facename = "宋体"
  400. long textcolor = 33554432
  401. boolean enabled = false
  402. borderstyle borderstyle = stylelowered!
  403. maskdatatype maskdatatype = timemask!
  404. string mask = "hh:mm:ss"
  405. boolean spin = true
  406. end type
  407. type st_1 from statictext within w_publ_input_datetime
  408. boolean visible = false
  409. integer x = 110
  410. integer y = 212
  411. integer width = 91
  412. integer height = 48
  413. boolean bringtotop = true
  414. integer textsize = -9
  415. integer weight = 400
  416. fontcharset fontcharset = gb2312charset!
  417. fontpitch fontpitch = variable!
  418. string facename = "宋体"
  419. long backcolor = 134217739
  420. string text = "到"
  421. alignment alignment = center!
  422. boolean focusrectangle = false
  423. end type
  424. type st_2 from statictext within w_publ_input_datetime
  425. boolean visible = false
  426. integer x = 110
  427. integer y = 60
  428. integer width = 91
  429. integer height = 48
  430. boolean bringtotop = true
  431. integer textsize = -9
  432. integer weight = 400
  433. fontcharset fontcharset = gb2312charset!
  434. fontpitch fontpitch = variable!
  435. string facename = "宋体"
  436. long backcolor = 134217739
  437. string text = "从"
  438. alignment alignment = center!
  439. boolean focusrectangle = false
  440. end type
  441. type cbx_area from checkbox within w_publ_input_datetime
  442. integer x = 1518
  443. integer y = 96
  444. integer width = 402
  445. integer height = 60
  446. boolean bringtotop = true
  447. integer textsize = -9
  448. integer weight = 400
  449. fontcharset fontcharset = gb2312charset!
  450. fontpitch fontpitch = variable!
  451. string facename = "宋体"
  452. long textcolor = 16711680
  453. long backcolor = 134217739
  454. string text = "范围选择"
  455. end type
  456. event clicked;IF THIS.Checked THEN
  457. PARENT.Height = 570
  458. cb_repl.Y = 332
  459. cb_add.Y = 332
  460. cb_exit.Y = 332
  461. st_2.Visible = TRUE
  462. st_1.Visible = TRUE
  463. gb_2.Visible = TRUE
  464. sle_nr_end.Visible = TRUE
  465. cbx_timeinuse_end.Visible = TRUE
  466. sle_time_end.Visible = TRUE
  467. ddlb_op.Visible = FALSE
  468. ddlb_date.Visible = TRUE
  469. ELSE
  470. PARENT.Height = 460
  471. cb_repl.Y = 192
  472. cb_add.Y = 192
  473. cb_exit.Y = 192
  474. st_2.Visible = FALSE
  475. st_1.Visible = FALSE
  476. gb_2.Visible = FALSE
  477. sle_nr_end.Visible = FALSE
  478. cbx_timeinuse_end.Visible = FALSE
  479. sle_time_end.Visible = FALSE
  480. ddlb_op.Visible = TRUE
  481. ddlb_date.Visible = FALSE
  482. END IF
  483. end event
  484. type gb_1 from groupbox within w_publ_input_datetime
  485. integer x = 800
  486. integer y = 4
  487. integer width = 695
  488. integer height = 148
  489. integer taborder = 70
  490. integer textsize = -9
  491. integer weight = 400
  492. fontcharset fontcharset = gb2312charset!
  493. fontpitch fontpitch = variable!
  494. string facename = "宋体"
  495. long textcolor = 33554432
  496. long backcolor = 134217739
  497. end type
  498. type cbx_timeinuse_end from checkbox within w_publ_input_datetime
  499. boolean visible = false
  500. integer x = 645
  501. integer y = 196
  502. integer width = 411
  503. integer height = 76
  504. boolean bringtotop = true
  505. integer textsize = -9
  506. integer weight = 400
  507. fontcharset fontcharset = gb2312charset!
  508. fontpitch fontpitch = variable!
  509. string facename = "宋体"
  510. long textcolor = 255
  511. long backcolor = 134217739
  512. string text = "使用时间查询"
  513. end type
  514. event clicked;if this.checked then
  515. sle_time_end.enabled=true
  516. ls_esq_tran.b_timeinuse_end=1
  517. else
  518. sle_time_end.enabled=false
  519. ls_esq_tran.b_timeinuse_end=0
  520. end if
  521. end event
  522. type ddlb_date from dropdownlistbox within w_publ_input_datetime
  523. boolean visible = false
  524. integer x = 1509
  525. integer y = 172
  526. integer width = 338
  527. integer height = 300
  528. integer taborder = 50
  529. boolean bringtotop = true
  530. integer textsize = -9
  531. integer weight = 400
  532. fontcharset fontcharset = gb2312charset!
  533. fontpitch fontpitch = variable!
  534. string facename = "宋体"
  535. long textcolor = 33554432
  536. string text = "自设"
  537. boolean sorted = false
  538. string item[] = {"自设","本日","本周","本月"}
  539. borderstyle borderstyle = stylelowered!
  540. end type
  541. event selectionchanged;IF THIS.Text = "本日" THEN
  542. sle_nr.text = string(today(),"yyyy-mm-dd")
  543. sle_nr_end.text = string(today(),"yyyy-mm-dd")
  544. ELSEIF THIS.Text = "本周" THEN
  545. int li_DayNum
  546. li_DayNum = DayNumber(today())
  547. sle_nr.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
  548. sle_nr_end.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
  549. ELSEIF THIS.Text = "本月" THEN
  550. int li_Month, li_Year, li_Days
  551. li_Month = Month(today())
  552. li_Year = Year(today())
  553. li_Days = days_in_month(li_Month, li_Year)
  554. sle_nr.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
  555. sle_nr_end.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
  556. END IF
  557. end event
  558. type gb_2 from groupbox within w_publ_input_datetime
  559. boolean visible = false
  560. integer x = 800
  561. integer y = 148
  562. integer width = 695
  563. integer height = 148
  564. integer taborder = 10
  565. integer textsize = -9
  566. integer weight = 400
  567. fontcharset fontcharset = gb2312charset!
  568. fontpitch fontpitch = variable!
  569. string facename = "宋体"
  570. long textcolor = 33554432
  571. long backcolor = 134217739
  572. end type