w_aifmb_myproductcode_pics.srw 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. $PBExportHeader$w_aifmb_myproductcode_pics.srw
  2. forward
  3. global type w_aifmb_myproductcode_pics from window
  4. end type
  5. type lv_1 from uo_piclistview within w_aifmb_myproductcode_pics
  6. end type
  7. type st_3 from statictext within w_aifmb_myproductcode_pics
  8. end type
  9. type em_pageindex from editmask within w_aifmb_myproductcode_pics
  10. end type
  11. type st_2 from statictext within w_aifmb_myproductcode_pics
  12. end type
  13. type st_1 from statictext within w_aifmb_myproductcode_pics
  14. end type
  15. type em_pagesize from editmask within w_aifmb_myproductcode_pics
  16. end type
  17. type cb_reflash from uo_imflatbutton within w_aifmb_myproductcode_pics
  18. end type
  19. type cb_del from uo_imflatbutton within w_aifmb_myproductcode_pics
  20. end type
  21. type cb_add from uo_imflatbutton within w_aifmb_myproductcode_pics
  22. end type
  23. type cb_exit from uo_imflatbutton within w_aifmb_myproductcode_pics
  24. end type
  25. type r_bar from rectangle within w_aifmb_myproductcode_pics
  26. end type
  27. type ln_bar from line within w_aifmb_myproductcode_pics
  28. end type
  29. type ln_bar2 from line within w_aifmb_myproductcode_pics
  30. end type
  31. end forward
  32. global type w_aifmb_myproductcode_pics from window
  33. integer width = 3488
  34. integer height = 1848
  35. boolean titlebar = true
  36. string title = "产品图片"
  37. boolean controlmenu = true
  38. boolean minbox = true
  39. boolean maxbox = true
  40. boolean resizable = true
  41. long backcolor = 67108864
  42. string icon = "AppIcon!"
  43. boolean center = true
  44. event ue_page ( )
  45. lv_1 lv_1
  46. st_3 st_3
  47. em_pageindex em_pageindex
  48. st_2 st_2
  49. st_1 st_1
  50. em_pagesize em_pagesize
  51. cb_reflash cb_reflash
  52. cb_del cb_del
  53. cb_add cb_add
  54. cb_exit cb_exit
  55. r_bar r_bar
  56. ln_bar ln_bar
  57. ln_bar2 ln_bar2
  58. end type
  59. global w_aifmb_myproductcode_pics w_aifmb_myproductcode_pics
  60. type variables
  61. long ins_relationid
  62. string ins_mtrlname
  63. end variables
  64. event ue_page();Long ll_pageindex
  65. Long ll_pagesize
  66. uo_aifmb = Create uo_aifmb
  67. lv_1.SetRedraw(false)
  68. ll_pageindex = Long(em_pageindex.Text)
  69. ll_pagesize = Long(em_pagesize.Text)
  70. Int rslt = 1
  71. String arg_msg
  72. s_aifmb_SearchProductAnnex arr_annex[]
  73. IF uo_aifmb.uf_searchproductannexlist(ins_relationid, ll_pageindex, ll_pagesize, arr_annex, arg_msg) <> 1 THEN
  74. rslt = 0
  75. GOTO ext
  76. END IF
  77. lv_1.uf_clear()
  78. Long i
  79. s_piclistview_parm s_parm
  80. FOR i = 1 To UpperBound(arr_annex)
  81. s_parm.Label = arr_annex[i].annexname
  82. s_parm.Data = arr_annex[i].Pic
  83. s_parm.a_any = arr_annex[i].AnnexID
  84. s_parm.tmppath = sys_cur_path + 'aifmb_tmp\Annex_min_' + String(arr_annex[i].AnnexID) + '.png'
  85. IF lv_1.uf_AddItem(s_parm, arg_msg) <> 1 THEN
  86. rslt = 0
  87. GOTO ext
  88. END IF
  89. NEXT
  90. ext:
  91. lv_1.SetRedraw(true)
  92. Destroy uo_aifmb
  93. IF rslt = 0 THEN
  94. MessageBox('ERROR', arg_msg)
  95. END IF
  96. end event
  97. on w_aifmb_myproductcode_pics.create
  98. this.lv_1=create lv_1
  99. this.st_3=create st_3
  100. this.em_pageindex=create em_pageindex
  101. this.st_2=create st_2
  102. this.st_1=create st_1
  103. this.em_pagesize=create em_pagesize
  104. this.cb_reflash=create cb_reflash
  105. this.cb_del=create cb_del
  106. this.cb_add=create cb_add
  107. this.cb_exit=create cb_exit
  108. this.r_bar=create r_bar
  109. this.ln_bar=create ln_bar
  110. this.ln_bar2=create ln_bar2
  111. this.Control[]={this.lv_1,&
  112. this.st_3,&
  113. this.em_pageindex,&
  114. this.st_2,&
  115. this.st_1,&
  116. this.em_pagesize,&
  117. this.cb_reflash,&
  118. this.cb_del,&
  119. this.cb_add,&
  120. this.cb_exit,&
  121. this.r_bar,&
  122. this.ln_bar,&
  123. this.ln_bar2}
  124. end on
  125. on w_aifmb_myproductcode_pics.destroy
  126. destroy(this.lv_1)
  127. destroy(this.st_3)
  128. destroy(this.em_pageindex)
  129. destroy(this.st_2)
  130. destroy(this.st_1)
  131. destroy(this.em_pagesize)
  132. destroy(this.cb_reflash)
  133. destroy(this.cb_del)
  134. destroy(this.cb_add)
  135. destroy(this.cb_exit)
  136. destroy(this.r_bar)
  137. destroy(this.ln_bar)
  138. destroy(this.ln_bar2)
  139. end on
  140. event resize;ln_bar.EndX = THIS.Width
  141. ln_bar2.EndX = THIS.Width
  142. r_bar.Width = THIS.Width
  143. lv_1.Width = this.WorkSpaceWidth() - lv_1.X
  144. lv_1.Height = this.WorkSpaceHeight() - lv_1.Y
  145. end event
  146. event open;s_aifmb_myproductcode_pics_parm s_parm
  147. s_parm = Message.PowerObjectParm
  148. ins_relationid = s_parm.relationid
  149. ins_mtrlname = s_parm.mtrlname
  150. this.title = '产品图片-' + ins_mtrlname
  151. lv_1.uf_setsize(100, 100)
  152. triggerevent('ue_page')
  153. end event
  154. type lv_1 from uo_piclistview within w_aifmb_myproductcode_pics
  155. integer y = 188
  156. integer taborder = 40
  157. end type
  158. type st_3 from statictext within w_aifmb_myproductcode_pics
  159. integer x = 1239
  160. integer y = 92
  161. integer width = 151
  162. integer height = 48
  163. integer textsize = -9
  164. integer weight = 400
  165. fontcharset fontcharset = gb2312charset!
  166. fontpitch fontpitch = variable!
  167. string facename = "宋体"
  168. long textcolor = 33554432
  169. long backcolor = 67108864
  170. string text = "页"
  171. boolean focusrectangle = false
  172. end type
  173. event constructor;this.backcolor = 14215660
  174. end event
  175. type em_pageindex from editmask within w_aifmb_myproductcode_pics
  176. integer x = 1033
  177. integer y = 76
  178. integer width = 201
  179. integer height = 84
  180. integer taborder = 30
  181. integer textsize = -9
  182. integer weight = 400
  183. fontcharset fontcharset = gb2312charset!
  184. fontpitch fontpitch = variable!
  185. string facename = "宋体"
  186. long textcolor = 33554432
  187. string text = "1"
  188. alignment alignment = right!
  189. borderstyle borderstyle = stylelowered!
  190. string mask = "#####"
  191. boolean spin = true
  192. end type
  193. event modified;parent.TriggerEvent('ue_page')
  194. end event
  195. type st_2 from statictext within w_aifmb_myproductcode_pics
  196. integer x = 736
  197. integer y = 92
  198. integer width = 288
  199. integer height = 48
  200. integer textsize = -9
  201. integer weight = 400
  202. fontcharset fontcharset = gb2312charset!
  203. fontpitch fontpitch = variable!
  204. string facename = "宋体"
  205. long textcolor = 33554432
  206. long backcolor = 67108864
  207. string text = "第"
  208. alignment alignment = right!
  209. boolean focusrectangle = false
  210. end type
  211. event constructor;this.backcolor = 14215660
  212. end event
  213. type st_1 from statictext within w_aifmb_myproductcode_pics
  214. integer x = 736
  215. integer y = 16
  216. integer width = 288
  217. integer height = 48
  218. integer textsize = -9
  219. integer weight = 400
  220. fontcharset fontcharset = gb2312charset!
  221. fontpitch fontpitch = variable!
  222. string facename = "宋体"
  223. long textcolor = 33554432
  224. long backcolor = 67108864
  225. string text = "每页项数"
  226. alignment alignment = right!
  227. boolean focusrectangle = false
  228. end type
  229. event constructor;this.backcolor = 14215660
  230. end event
  231. type em_pagesize from editmask within w_aifmb_myproductcode_pics
  232. integer x = 1033
  233. integer width = 201
  234. integer height = 84
  235. integer taborder = 20
  236. integer textsize = -9
  237. integer weight = 400
  238. fontcharset fontcharset = gb2312charset!
  239. fontpitch fontpitch = variable!
  240. string facename = "宋体"
  241. long textcolor = 33554432
  242. string text = "100"
  243. alignment alignment = right!
  244. borderstyle borderstyle = stylelowered!
  245. string mask = "#####"
  246. end type
  247. type cb_reflash from uo_imflatbutton within w_aifmb_myproductcode_pics
  248. integer x = 302
  249. integer width = 151
  250. integer height = 164
  251. integer taborder = 40
  252. string text = "刷新"
  253. string normalpicname = "refresh.BMP"
  254. integer picsize = 16
  255. toolbaralignment pic_align = alignattop!
  256. boolean border = false
  257. end type
  258. event clicked;call super::clicked;parent.triggerevent('ue_page')
  259. end event
  260. type cb_del from uo_imflatbutton within w_aifmb_myproductcode_pics
  261. integer x = 151
  262. integer width = 151
  263. integer height = 164
  264. integer taborder = 30
  265. string text = "删除"
  266. string normalpicname = "delete.BMP"
  267. integer picsize = 16
  268. toolbaralignment pic_align = alignattop!
  269. boolean border = false
  270. end type
  271. event clicked;call super::clicked;Long i
  272. longlong arr_AnnexID[]
  273. Long k = 0
  274. ListViewItem lvi
  275. FOR i = 1 To lv_1.TotalItems()
  276. IF lv_1.GetItem(i, lvi) = 1 THEN
  277. IF lvi.Selected THEN
  278. k++
  279. arr_AnnexID[k] = lvi.Data
  280. END IF
  281. END IF
  282. NEXT
  283. Int rslt = 1
  284. String arg_msg
  285. uo_aifmb = Create uo_aifmb
  286. IF uo_aifmb.uf_delproductannex(arr_AnnexID, arg_msg) <> 1 THEN
  287. rslt = 0
  288. GOTO ext
  289. END IF
  290. ext:
  291. Destroy uo_aifmb
  292. IF rslt = 0 THEN
  293. MessageBox('ERROR', arg_msg)
  294. ELSE
  295. MessageBox('OK', '删除成功')
  296. Parent.TriggerEvent('ue_page')
  297. END IF
  298. end event
  299. type cb_add from uo_imflatbutton within w_aifmb_myproductcode_pics
  300. integer width = 151
  301. integer height = 164
  302. integer taborder = 20
  303. string text = "新建"
  304. string normalpicname = "new.BMP"
  305. integer picsize = 16
  306. toolbaralignment pic_align = alignattop!
  307. boolean border = false
  308. end type
  309. event clicked;call super::clicked;String ls_path
  310. String arr_files[]
  311. IF GetFileOpenName('上传图片', ls_path, arr_files, 'bmp', '图片 (*.bmp;*.gif;*.jpg;*.jpeg;*.png),*.bmp;*.gif;*.jpg;*.jpeg;*.png') <> 1 THEN
  312. RETURN
  313. END IF
  314. IF UpperBound(arr_files) <= 0 THEN
  315. RETURN
  316. END IF
  317. Int rslt = 1
  318. String arg_msg
  319. uo_aifmb = Create uo_aifmb
  320. IF UpperBound(arr_files) = 1 THEN
  321. ls_path = Mid(ls_path, 1, Len(ls_path) - Len(arr_files[1]))
  322. END IF
  323. IF Right(ls_path, 1) <> '\' THEN
  324. ls_path += '\'
  325. END IF
  326. Long i
  327. s_aifmb_productannexdata s_parm[]
  328. Long k = 0
  329. FOR i = 1 To UpperBound(arr_files)
  330. k++
  331. s_parm[k].Annexname = arr_files[i]
  332. IF f_filetoblob(ls_path + arr_files[i], s_parm[k].Pic, arg_msg) <> 1 THEN
  333. rslt = 0
  334. GOTO ext
  335. END IF
  336. NEXT
  337. IF uo_aifmb.uf_addproductannex(ins_relationid, s_parm, arg_msg) <> 1 THEN
  338. rslt = 0
  339. GOTO ext
  340. END IF
  341. ext:
  342. Destroy uo_aifmb
  343. IF rslt = 0 THEN
  344. MessageBox('ERROR', arg_msg)
  345. ELSE
  346. MessageBox('OK', '上传成功')
  347. parent.triggerevent('ue_page')
  348. END IF
  349. end event
  350. type cb_exit from uo_imflatbutton within w_aifmb_myproductcode_pics
  351. integer x = 453
  352. integer width = 151
  353. integer height = 164
  354. integer taborder = 10
  355. string text = "退出"
  356. boolean cancel = true
  357. string normalpicname = "exit.bmp"
  358. integer picsize = 16
  359. toolbaralignment pic_align = alignattop!
  360. boolean border = false
  361. end type
  362. event clicked;call super::clicked;Close(PARENT)
  363. end event
  364. type r_bar from rectangle within w_aifmb_myproductcode_pics
  365. long linecolor = 16777215
  366. integer linethickness = 4
  367. long fillcolor = 1073741824
  368. integer x = 2139
  369. integer width = 146
  370. integer height = 68
  371. end type
  372. event constructor;this.fillcolor = 14215660
  373. this.linecolor = 14215660
  374. this.x = -1
  375. this.y = -1
  376. this.height = ln_bar.beginy - 5
  377. end event
  378. type ln_bar from line within w_aifmb_myproductcode_pics
  379. long linecolor = 268435456
  380. integer linethickness = 4
  381. integer beginy = 172
  382. integer endx = 2007
  383. integer endy = 172
  384. end type
  385. type ln_bar2 from line within w_aifmb_myproductcode_pics
  386. long linecolor = 16777215
  387. integer linethickness = 4
  388. integer beginy = 176
  389. integer endx = 2039
  390. integer endy = 176
  391. end type