w_rep_group.srw 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. $PBExportHeader$w_rep_group.srw
  2. forward
  3. global type w_rep_group from w_publ_choice
  4. end type
  5. type cb_1 from uo_imflatbutton within w_rep_group
  6. end type
  7. type cb_2 from uo_imflatbutton within w_rep_group
  8. end type
  9. type cb_3 from uo_imflatbutton within w_rep_group
  10. end type
  11. type cb_4 from uo_imflatbutton within w_rep_group
  12. end type
  13. type dw_1 from u_dw_rbtnfilter within w_rep_group
  14. end type
  15. type dw_2 from u_dw_rbtnfilter within w_rep_group
  16. end type
  17. type cb_5 from uo_imflatbutton within w_rep_group
  18. end type
  19. type cb_7 from uo_imflatbutton within w_rep_group
  20. end type
  21. type cb_ext from uo_imflatbutton within w_rep_group
  22. end type
  23. type cb_13 from uo_imflatbutton within w_rep_group
  24. end type
  25. type cb_8 from uo_imflatbutton within w_rep_group
  26. end type
  27. type cb_9 from uo_imflatbutton within w_rep_group
  28. end type
  29. type cb_6 from uo_imflatbutton within w_rep_group
  30. end type
  31. type cb_10 from uo_imflatbutton within w_rep_group
  32. end type
  33. type dw_3 from u_dw_rbtnfilter within w_rep_group
  34. end type
  35. type cb_11 from uo_imflatbutton within w_rep_group
  36. end type
  37. type st_2 from statictext within w_rep_group
  38. end type
  39. type ln_3 from line within w_rep_group
  40. end type
  41. type s_kh from structure within w_rep_group
  42. end type
  43. type s_group_cust_spt from structure within w_rep_group
  44. end type
  45. end forward
  46. type s_kh from structure
  47. integer l_star
  48. integer l_end
  49. end type
  50. type s_group_cust_spt from structure
  51. string name
  52. string email
  53. string phone
  54. end type
  55. global type w_rep_group from w_publ_choice
  56. integer width = 4398
  57. integer height = 2956
  58. string title = "邮件短信接收人自定义分组"
  59. boolean controlmenu = true
  60. boolean minbox = true
  61. boolean maxbox = true
  62. boolean resizable = true
  63. windowtype windowtype = main!
  64. windowstate windowstate = maximized!
  65. cb_1 cb_1
  66. cb_2 cb_2
  67. cb_3 cb_3
  68. cb_4 cb_4
  69. dw_1 dw_1
  70. dw_2 dw_2
  71. cb_5 cb_5
  72. cb_7 cb_7
  73. cb_ext cb_ext
  74. cb_13 cb_13
  75. cb_8 cb_8
  76. cb_9 cb_9
  77. cb_6 cb_6
  78. cb_10 cb_10
  79. dw_3 dw_3
  80. cb_11 cb_11
  81. st_2 st_2
  82. ln_3 ln_3
  83. end type
  84. global w_rep_group w_rep_group
  85. type variables
  86. string s_col="",s_text=""
  87. integer l_row=0
  88. long groupid
  89. datastore dw_group_u_cust,dw_group_u_cust_rep,dw_group_u_spt,dw_group_u_spt_rep
  90. end variables
  91. forward prototypes
  92. public subroutine p_clearmx ()
  93. public function integer cancel (ref string arg_msg)
  94. public function integer acceptmx (long arg_rpid, integer arg_rowcode, string arg_rowname, integer arg_rowtype, integer arg_rowcmpltype, string arg_rowformula1, string arg_rowformula2)
  95. public subroutine f_bulid_rp (integer row)
  96. public function string of_globalreplace (string as_source, string as_old, string as_new)
  97. public function integer f_writefile (blob ib_file, string is_filename)
  98. public function integer f_get_rpid ()
  99. public subroutine f_readfile ()
  100. public subroutine f_create_zcfzb ()
  101. public subroutine f_creat_lrb ()
  102. public subroutine wf_face ()
  103. public function string of_globalreplace1 (string as_source, string as_old, string as_new)
  104. public function integer save ()
  105. public subroutine f_add (integer arg_i, string arg_s)
  106. public subroutine wf_init_dw ()
  107. public subroutine wf_init (integer arg_dw)
  108. public function s_group_cust_spt wf_cusorspt_name (long arg_reltype, long arg_relid, long arg_repid)
  109. end prototypes
  110. public subroutine p_clearmx ();groupid=0
  111. end subroutine
  112. public function integer cancel (ref string arg_msg);int rslt=1
  113. return rslt
  114. end function
  115. public function integer acceptmx (long arg_rpid, integer arg_rowcode, string arg_rowname, integer arg_rowtype, integer arg_rowcmpltype, string arg_rowformula1, string arg_rowformula2);Int rslt = 1
  116. p_clearmx()
  117. //
  118. //if isnull(arg_rpid) then arg_rpid=0
  119. //if isnull(arg_rowcode) then arg_rowcode=0
  120. //if isnull(arg_rowname) then arg_rowname=""
  121. //if isnull( arg_rowtype ) then arg_rowtype=0
  122. //if isnull(rowcmpltype) then rowcmpltype=0
  123. //if isnull(arg_Rowformula1) then arg_Rowformula1=""
  124. //if isnull(arg_Rowformula2) then arg_Rowformula2=""
  125. //
  126. //
  127. //rpid = arg_rpid
  128. //rowcode = arg_rowcode
  129. //rowname = arg_rowname
  130. //rowtype = arg_rowtype
  131. //rowcmpltype = arg_rowcmpltype
  132. //Rowformula1 = arg_Rowformula1
  133. //Rowformula2 = arg_Rowformula2
  134. //
  135. //IF rpid = 0 THEN
  136. // MessageBox("Error","报表id错误")
  137. // rslt = 0
  138. // GOTO ext
  139. //END IF
  140. //
  141. //
  142. //
  143. //
  144. //
  145. //
  146. //
  147. //
  148. //ext:
  149. IF rslt = 0 THEN p_clearmx()
  150. RETURN rslt
  151. end function
  152. public subroutine f_bulid_rp (integer row);
  153. end subroutine
  154. public function string of_globalreplace (string as_source, string as_old, string as_new);long ll_oldlen, ll_newlen, ll_pos
  155. ll_pos = Pos(as_source,as_old)
  156. IF ll_pos > 0 Then
  157. ll_oldlen = Len(as_old)
  158. ll_newlen = Len(as_new)
  159. as_source = Replace(as_source,ll_pos,ll_oldlen,as_new)
  160. ll_pos = Pos(as_source,as_old,ll_pos + ll_newlen)
  161. END IF
  162. RETURN as_source
  163. end function
  164. public function integer f_writefile (blob ib_file, string is_filename);uLONG ll_len,li_count,loops
  165. int li_FileNum
  166. blob lblb_b,b_x
  167. int liResult = 1
  168. ////f_readfile(b_x,is_filename)
  169. ////ib_file=blob(string(ib_file) +char(13) +char(10) + string(b_x))
  170. //////////////////////////////////////////////////////////////
  171. //ll_len=len(ib_file)
  172. //IF ll_len > 32765 THEN
  173. // IF Mod(ll_len, 32765) = 0 THEN
  174. // loops = ll_len/32765
  175. // ELSE
  176. // loops = (ll_len/32765) + 1
  177. // END IF
  178. //ELSE
  179. // loops = 1
  180. //END IF
  181. //
  182. //
  183. //li_FileNum = FileOpen(is_filename,StreamMode!, write!, shared!,Replace!)
  184. //if li_FileNum = -1 then
  185. // messagebox("系统提示","无法打开文件"+is_filename)
  186. // return 0
  187. //end if
  188. //FOR li_count = 1 to loops
  189. // lblb_b = blobmid( ib_file , ( li_count - 1) * 32765 + 1 , 32765 )
  190. // if FileWrite(li_FileNum, lblb_b) = -1 then
  191. // messagebox("系统提示","写文件" + is_filename+"失败")
  192. // liResult=0
  193. // exit
  194. // end if//8010
  195. //NEXT
  196. //Fileclose(li_FileNum)
  197. //
  198. ////if liResult=1 then
  199. //// liResult = gf_setfiletime(is_filename,idt_file_time)
  200. ////end if
  201. //
  202. return liResult
  203. end function
  204. public function integer f_get_rpid ();Long ll_row, ll_i
  205. FOR ll_i = dw_1.RowCount() To 1 Step -1
  206. IF dw_1.IsSelected(ll_i) THEN
  207. ll_row = ll_i
  208. END IF
  209. NEXT
  210. IF ll_row <= 0 THEN RETURN 0
  211. groupid = dw_1.Object.groupid[ll_row]
  212. end function
  213. public subroutine f_readfile ();
  214. end subroutine
  215. public subroutine f_create_zcfzb ();
  216. end subroutine
  217. public subroutine f_creat_lrb ();
  218. end subroutine
  219. public subroutine wf_face ();Int LS_INT
  220. IF dw_edit_mode = True THEN
  221. cb_1.Enabled = False
  222. cb_2.Enabled = False
  223. cb_3.Enabled = False
  224. cb_4.Enabled = False
  225. cb_5.Enabled = True
  226. cb_6.Enabled = True
  227. cb_7.Enabled = True
  228. cb_8.Enabled = True
  229. cb_9.Enabled = True
  230. cb_10.Enabled = True
  231. dw_1.Enabled = False
  232. FOR LS_INT = 1 To 20
  233. dw_2.SetTabOrder (LS_INT,LS_INT*0 )
  234. NEXT
  235. ELSE
  236. cb_1.Enabled = True
  237. cb_2.Enabled = True
  238. cb_3.Enabled = True
  239. cb_4.Enabled = True
  240. cb_5.Enabled = False
  241. cb_6.Enabled = False
  242. cb_7.Enabled = False
  243. cb_8.Enabled = False
  244. cb_9.Enabled = False
  245. cb_10.Enabled = False
  246. dw_1.Enabled = True
  247. FOR LS_INT = 1 To 20
  248. dw_2.SetTabOrder (LS_INT,LS_INT*0 )
  249. NEXT
  250. END IF
  251. IF dw_1.Object.if_parent[dw_1.GetRow()] = 1 THEN
  252. cb_10.Enabled = False
  253. END IF
  254. dw_2.Retrieve(groupid)
  255. wf_init(0)
  256. end subroutine
  257. public function string of_globalreplace1 (string as_source, string as_old, string as_new);long ll_oldlen, ll_newlen, ll_pos
  258. ll_pos = Pos(as_source,as_old)
  259. IF ll_pos > 0 Then
  260. ll_oldlen = Len(as_old)
  261. ll_newlen = Len(as_new)
  262. DO WHILE ll_pos > 0
  263. as_source = Replace(as_source,ll_pos,ll_oldlen,as_new)
  264. ll_pos = Pos(as_source,as_old,ll_pos + ll_newlen)
  265. LOOP
  266. END IF
  267. RETURN as_source
  268. end function
  269. public function integer save ();Integer rslt = 1
  270. string ls_errmsg
  271. dw_2.AcceptText()
  272. IF dw_2.Update() = -1 THEN
  273. ROLLBACK;
  274. rslt=0
  275. RETURN rslt
  276. ELSE
  277. COMMIT;
  278. END IF
  279. RETURN rslt
  280. end function
  281. public subroutine f_add (integer arg_i, string arg_s);
  282. end subroutine
  283. public subroutine wf_init_dw ();//datastore dw_group_u_cust,dw_group_u_cust_rep,dw_group_u_spt,dw_group_u_spt_rep
  284. open(w_sys_wait)
  285. dw_group_u_cust = Create datastore
  286. dw_group_u_cust.DataObject = 'dw_group_u_cust'
  287. dw_group_u_cust.SetTransObject(sqlca)
  288. dw_group_u_cust.Retrieve()
  289. //
  290. dw_group_u_cust_rep = Create datastore
  291. dw_group_u_cust_rep.DataObject = 'dw_group_u_cust_rep'
  292. dw_group_u_cust_rep.SetTransObject(sqlca)
  293. dw_group_u_cust_rep.Retrieve()
  294. //
  295. dw_group_u_spt = Create datastore
  296. dw_group_u_spt.DataObject = 'dw_group_u_spt'
  297. dw_group_u_spt.SetTransObject(sqlca)
  298. dw_group_u_spt.Retrieve()
  299. //
  300. dw_group_u_spt_rep = Create datastore
  301. dw_group_u_spt_rep.DataObject = 'dw_group_u_spt_rep'
  302. dw_group_u_spt_rep.SetTransObject(sqlca)
  303. dw_group_u_spt_rep.Retrieve()
  304. close(w_sys_wait)
  305. end subroutine
  306. public subroutine wf_init (integer arg_dw);Long i,reltype,relid,repid
  307. s_group_cust_spt ss_group_cust_spt
  308. IF arg_dw = 0 THEN
  309. FOR i = 1 To dw_2.RowCount()
  310. reltype = dw_2.Object.reltype[i]
  311. relid = dw_2.Object.relid[i]
  312. repid = dw_2.Object.repid[i]
  313. ss_group_cust_spt=wf_cusorspt_name( reltype, relid , repid )
  314. dw_2.Object.Name[i] = ss_group_cust_spt.name
  315. dw_2.Object.email[i] = ss_group_cust_spt.email
  316. dw_2.Object.phone[i] = ss_group_cust_spt.phone
  317. NEXT
  318. END IF
  319. IF arg_dw = 1 THEN
  320. FOR i = 1 To dw_3.RowCount()
  321. reltype = dw_3.Object.reltype[i]
  322. relid = dw_3.Object.relid[i]
  323. repid = dw_3.Object.repid[i]
  324. ss_group_cust_spt=wf_cusorspt_name( reltype, relid , repid )
  325. dw_3.Object.Name[i] = ss_group_cust_spt.name
  326. dw_3.Object.email[i] = ss_group_cust_spt.email
  327. dw_3.Object.phone[i] = ss_group_cust_spt.phone
  328. NEXT
  329. END IF
  330. //
  331. //
  332. end subroutine
  333. public function s_group_cust_spt wf_cusorspt_name (long arg_reltype, long arg_relid, long arg_repid);//datastore dw_group_u_cust,dw_group_u_cust_rep,dw_group_u_spt,dw_group_u_spt_rep
  334. String ls_name,ls_name1,ls_name2
  335. String Name,tele,email
  336. s_group_cust_spt ss_group_cust_spt
  337. Long i
  338. IF arg_reltype = 0 THEN
  339. IF arg_repid = 0 THEN
  340. FOR i = 1 To dw_group_u_cust.RowCount()
  341. IF dw_group_u_cust.Object.cusid[i] = arg_relid THEN
  342. ss_group_cust_spt.Name = dw_group_u_cust.Object.Name[i]+'_' +dw_group_u_cust.Object.rep[i]
  343. ss_group_cust_spt.phone = dw_group_u_cust.Object.tele1[i]
  344. ss_group_cust_spt.email = dw_group_u_cust.Object.email[i]
  345. EXIT
  346. END IF
  347. NEXT
  348. ELSE
  349. FOR i = 1 To dw_group_u_cust.RowCount()
  350. IF dw_group_u_cust.Object.cusid[i] = arg_relid THEN
  351. ls_name1 = dw_group_u_cust.Object.Name[i]
  352. EXIT
  353. END IF
  354. NEXT
  355. FOR i = 1 To dw_group_u_cust_rep.RowCount()
  356. IF dw_group_u_cust_rep.Object.cusid[i] = arg_relid And dw_group_u_cust_rep.Object.repid[i] = arg_repid THEN
  357. ls_name2 = dw_group_u_cust_rep.Object.repname[i]
  358. ss_group_cust_spt.Name = ls_name1+'_' +ls_name2
  359. ss_group_cust_spt.phone = dw_group_u_cust_rep.Object.handtel[i]
  360. ss_group_cust_spt.email = dw_group_u_cust_rep.Object.email[i]
  361. EXIT
  362. END IF
  363. NEXT
  364. END IF
  365. ELSEIF arg_reltype = 1 THEN
  366. IF arg_repid = 0 THEN
  367. FOR i = 1 To dw_group_u_spt.RowCount()
  368. IF dw_group_u_spt.Object.sptid[i] = arg_relid THEN
  369. ss_group_cust_spt.Name = dw_group_u_spt.Object.Name[i]+'_' +dw_group_u_spt.Object.rep[i]
  370. ss_group_cust_spt.phone = dw_group_u_spt.Object.tele1[i]
  371. ss_group_cust_spt.email = dw_group_u_spt.Object.email[i]
  372. EXIT
  373. END IF
  374. NEXT
  375. ELSE
  376. FOR i = 1 To dw_group_u_spt.RowCount()
  377. IF dw_group_u_spt.Object.sptid[i] = arg_relid THEN
  378. ls_name1 = dw_group_u_spt.Object.Name[i]
  379. EXIT
  380. END IF
  381. NEXT
  382. FOR i = 1 To dw_group_u_spt_rep.RowCount()
  383. IF dw_group_u_spt_rep.Object.sptid[i] = arg_relid And dw_group_u_spt_rep.Object.repid[i] = arg_repid THEN
  384. ls_name2 = dw_group_u_spt_rep.Object.repname[i]
  385. ss_group_cust_spt.Name = ls_name1+'_' +ls_name2
  386. ss_group_cust_spt.phone = dw_group_u_spt_rep.Object.handtel[i]
  387. ss_group_cust_spt.email = dw_group_u_spt_rep.Object.email[i]
  388. EXIT
  389. END IF
  390. NEXT
  391. END IF
  392. ELSEIF arg_reltype = 2 THEN
  393. SELECT u_rep_group.groupname Into :ls_name2 From u_rep_group Where u_rep_group.groupid = :arg_relid;
  394. ls_name = '自定义组_' +ls_name2
  395. ss_group_cust_spt.Name = ls_name
  396. ss_group_cust_spt.phone = ''
  397. ss_group_cust_spt.email = ''
  398. END IF
  399. return ss_group_cust_spt
  400. end function
  401. on w_rep_group.create
  402. int iCurrent
  403. call super::create
  404. this.cb_1=create cb_1
  405. this.cb_2=create cb_2
  406. this.cb_3=create cb_3
  407. this.cb_4=create cb_4
  408. this.dw_1=create dw_1
  409. this.dw_2=create dw_2
  410. this.cb_5=create cb_5
  411. this.cb_7=create cb_7
  412. this.cb_ext=create cb_ext
  413. this.cb_13=create cb_13
  414. this.cb_8=create cb_8
  415. this.cb_9=create cb_9
  416. this.cb_6=create cb_6
  417. this.cb_10=create cb_10
  418. this.dw_3=create dw_3
  419. this.cb_11=create cb_11
  420. this.st_2=create st_2
  421. this.ln_3=create ln_3
  422. iCurrent=UpperBound(this.Control)
  423. this.Control[iCurrent+1]=this.cb_1
  424. this.Control[iCurrent+2]=this.cb_2
  425. this.Control[iCurrent+3]=this.cb_3
  426. this.Control[iCurrent+4]=this.cb_4
  427. this.Control[iCurrent+5]=this.dw_1
  428. this.Control[iCurrent+6]=this.dw_2
  429. this.Control[iCurrent+7]=this.cb_5
  430. this.Control[iCurrent+8]=this.cb_7
  431. this.Control[iCurrent+9]=this.cb_ext
  432. this.Control[iCurrent+10]=this.cb_13
  433. this.Control[iCurrent+11]=this.cb_8
  434. this.Control[iCurrent+12]=this.cb_9
  435. this.Control[iCurrent+13]=this.cb_6
  436. this.Control[iCurrent+14]=this.cb_10
  437. this.Control[iCurrent+15]=this.dw_3
  438. this.Control[iCurrent+16]=this.cb_11
  439. this.Control[iCurrent+17]=this.st_2
  440. this.Control[iCurrent+18]=this.ln_3
  441. end on
  442. on w_rep_group.destroy
  443. call super::destroy
  444. destroy(this.cb_1)
  445. destroy(this.cb_2)
  446. destroy(this.cb_3)
  447. destroy(this.cb_4)
  448. destroy(this.dw_1)
  449. destroy(this.dw_2)
  450. destroy(this.cb_5)
  451. destroy(this.cb_7)
  452. destroy(this.cb_ext)
  453. destroy(this.cb_13)
  454. destroy(this.cb_8)
  455. destroy(this.cb_9)
  456. destroy(this.cb_6)
  457. destroy(this.cb_10)
  458. destroy(this.dw_3)
  459. destroy(this.cb_11)
  460. destroy(this.st_2)
  461. destroy(this.ln_3)
  462. end on
  463. event resize;call super::resize;dw_1.Height = This.Height -dw_1.Y - 200
  464. dw_2.Height = dw_1.Height
  465. dw_2.Width = This.Width -dw_2.X - 50
  466. dw_3.x=dw_2.x+500
  467. dw_3.Height=dw_2.Height
  468. dw_3.Width=dw_2.Width - 500
  469. //cb_ext.x=this.width - cb_ext.width
  470. st_2.y =dw_1.y + dw_1.Height + 10
  471. end event
  472. event open;call super::open;dw_1.SetTransObject (sqlca)
  473. dw_1.Retrieve()
  474. dw_2.SetTransObject (sqlca)
  475. dw_3.SetTransObject (sqlca)
  476. //rb_1.TriggerEvent(Clicked!)
  477. dw_3.Visible = False
  478. wf_init_dw()
  479. Int LS_INT
  480. FOR LS_INT = 1 To 20
  481. dw_2.SetTabOrder (LS_INT,0 )
  482. NEXT
  483. end event
  484. type cb_func from w_publ_choice`cb_func within w_rep_group
  485. boolean visible = false
  486. end type
  487. type cb_exit from w_publ_choice`cb_exit within w_rep_group
  488. boolean visible = false
  489. end type
  490. type sle_ch from w_publ_choice`sle_ch within w_rep_group
  491. boolean visible = false
  492. end type
  493. type dw_ch from w_publ_choice`dw_ch within w_rep_group
  494. boolean visible = false
  495. end type
  496. type st_1 from w_publ_choice`st_1 within w_rep_group
  497. boolean visible = false
  498. end type
  499. type cb_retrieve from w_publ_choice`cb_retrieve within w_rep_group
  500. boolean visible = false
  501. end type
  502. type cb_choice from w_publ_choice`cb_choice within w_rep_group
  503. boolean visible = false
  504. end type
  505. type ln_bar from w_publ_choice`ln_bar within w_rep_group
  506. integer beginx = 5
  507. integer endx = 2011
  508. end type
  509. type ln_bar2 from w_publ_choice`ln_bar2 within w_rep_group
  510. integer beginx = 9
  511. integer endx = 2048
  512. end type
  513. type r_bar from w_publ_choice`r_bar within w_rep_group
  514. integer x = 1595
  515. end type
  516. type ln_1 from w_publ_choice`ln_1 within w_rep_group
  517. integer beginx = 14
  518. integer beginy = 192
  519. integer endx = 2030
  520. integer endy = 192
  521. end type
  522. type ln_2 from w_publ_choice`ln_2 within w_rep_group
  523. integer beginx = 9
  524. integer beginy = 184
  525. integer endx = 2057
  526. integer endy = 184
  527. end type
  528. type cb_1 from uo_imflatbutton within w_rep_group
  529. integer width = 192
  530. integer height = 164
  531. integer taborder = 130
  532. boolean bringtotop = true
  533. string text = "刷新"
  534. string normalpicname = "refresh.bmp"
  535. integer picsize = 16
  536. toolbaralignment pic_align = alignattop!
  537. boolean border = false
  538. end type
  539. event clicked;call super::clicked;dw_1.Retrieve()
  540. end event
  541. type cb_2 from uo_imflatbutton within w_rep_group
  542. integer x = 192
  543. integer width = 192
  544. integer height = 164
  545. integer taborder = 180
  546. boolean bringtotop = true
  547. string text = "新建&S"
  548. string normalpicname = "new.bmp"
  549. integer picsize = 16
  550. toolbaralignment pic_align = alignattop!
  551. boolean border = false
  552. end type
  553. event clicked;call super::clicked;IF Not IsValid(w_rep_group_add) THEN
  554. String s
  555. s = "new"
  556. OpenWithParm(w_rep_group_add,s )
  557. cb_1.TriggerEvent(Clicked!)
  558. END IF
  559. end event
  560. type cb_3 from uo_imflatbutton within w_rep_group
  561. integer x = 384
  562. integer width = 192
  563. integer height = 164
  564. integer taborder = 190
  565. boolean bringtotop = true
  566. string text = "修改&E"
  567. string normalpicname = "open.bmp"
  568. integer picsize = 16
  569. toolbaralignment pic_align = alignattop!
  570. boolean border = false
  571. end type
  572. event clicked;call super::clicked;Long ll_row, ll_i
  573. IF Not IsValid(w_rep_group_add) THEN
  574. String s
  575. FOR ll_i = dw_1.RowCount() To 1 Step -1
  576. IF dw_1.IsSelected(ll_i) THEN
  577. ll_row = ll_i
  578. END IF
  579. NEXT
  580. IF ll_row <= 0 THEN RETURN
  581. s = String(dw_1.Object.groupid[ll_row])
  582. OpenWithParm(w_rep_group_add,s )
  583. cb_1.TriggerEvent(Clicked!)
  584. END IF
  585. end event
  586. type cb_4 from uo_imflatbutton within w_rep_group
  587. integer x = 576
  588. integer width = 197
  589. integer height = 164
  590. integer taborder = 200
  591. boolean bringtotop = true
  592. string text = "删除"
  593. string normalpicname = "delete.bmp"
  594. integer picsize = 16
  595. toolbaralignment pic_align = alignattop!
  596. boolean border = false
  597. end type
  598. event clicked;call super::clicked;Long ll_row,l_groupid,ll_i
  599. String arG_MSG
  600. //ll_row = dw_1.GetRow()
  601. FOR ll_i = dw_1.RowCount() TO 1 STEP -1
  602. IF dw_1.IsSelected(ll_i) THEN
  603. ll_row=ll_i
  604. END IF
  605. NEXT
  606. IF ll_row <= 0 THEN RETURN
  607. IF MessageBox('提示信息','确定删除当前选中组?', Question! ,YesNo! , 1 ) = 1 THEN
  608. ELSE
  609. RETURN
  610. END IF
  611. l_groupid = dw_1.Object.groupid[ll_row]
  612. DELETE From u_rep_group Where u_rep_group.groupid = :l_groupid;
  613. IF sqlca.SQLCode <> 0 THEN
  614. arG_MSG = "因网络或其它原因导致插入明细操作失败"+"~n"+sqlca.SQLErrText
  615. MessageBox("Error",arG_MSG)
  616. ROLLBACK Using sqlca;
  617. GOTO ext
  618. END IF
  619. COMMIT Using sqlca;
  620. dw_1.DeleteRow(ll_row)
  621. dw_1.SelectRow(dw_1.rowcount(),true)
  622. dw_1.SetRow(dw_1.rowcount())
  623. ext:
  624. RETURN
  625. end event
  626. type dw_1 from u_dw_rbtnfilter within w_rep_group
  627. integer x = 5
  628. integer y = 208
  629. integer width = 1403
  630. integer height = 1632
  631. integer taborder = 20
  632. boolean bringtotop = true
  633. string dataobject = "dw_rep_group"
  634. boolean hscrollbar = true
  635. boolean vscrollbar = true
  636. boolean hsplitscroll = true
  637. boolean rbutton_filter_use = true
  638. boolean rbutton_setposition_use = true
  639. boolean titleclick_sort_use = true
  640. end type
  641. event clicked;call super::clicked;long ll_groupid
  642. IF row <= 0 THEN RETURN
  643. This.SelectRow(0,False)
  644. This.SelectRow(row,True)
  645. This.SetRow(row)
  646. IF dw_1.GetRow() <= 0 THEN
  647. ll_groupid = 0
  648. ELSE
  649. ll_groupid = dw_1.Object.groupid[dw_1.GetRow()]
  650. END IF
  651. dw_2.reset()
  652. dw_2.Retrieve(ll_groupid)
  653. //dw_3.reset()
  654. //dw_3.Retrieve(ll_groupid)
  655. wf_init(0)
  656. //IF cb_8.Enabled = True THEN
  657. // IF MessageBox('提示信息','是否保存报表设计?', Question! ,YesNo! , 1 ) = 1 THEN
  658. // cb_8.TriggerEvent(Clicked!)
  659. // END IF
  660. //END IF
  661. //rp_dw_row=row
  662. //f_bulid_rp(rp_dw_row)
  663. //Int LS_INT
  664. //FOR LS_INT = 1 To 20
  665. // dw_2.SetTabOrder (LS_INT,0 )
  666. //NEXT
  667. end event
  668. type dw_2 from u_dw_rbtnfilter within w_rep_group
  669. integer x = 1422
  670. integer y = 204
  671. integer width = 1755
  672. integer height = 1640
  673. integer taborder = 30
  674. boolean bringtotop = true
  675. string dataobject = "dw_rep_groupmx"
  676. boolean hscrollbar = true
  677. boolean vscrollbar = true
  678. boolean hsplitscroll = true
  679. boolean rbutton_filter_use = true
  680. boolean rbutton_setposition_use = true
  681. boolean titleclick_sort_use = true
  682. end type
  683. event itemchanged;call super::itemchanged;
  684. //s_text=""
  685. //IF s_col = "" Or l_row = 0 THEN
  686. // s_col = dwo.Name
  687. // l_row = row
  688. // GOTO ext
  689. //END IF
  690. //
  691. //IF s_col = "sql_l1" THEN
  692. // IF rb_1.Checked = True THEN
  693. // dw_2.Object.sql_l1[l_row] = sle_1.Text
  694. // ELSE
  695. // dw_2.Object.sql_l1[l_row] = mle_1.Text
  696. // END IF
  697. //
  698. //ELSEIF dwo.Name = "sql_l2" THEN
  699. // IF rb_1.Checked = True THEN
  700. // dw_2.Object.sql_l2[l_row] = sle_1.Text
  701. // ELSE
  702. // dw_2.Object.sql_l2[l_row] = mle_1.Text
  703. // END IF
  704. //ELSEIF dwo.Name = "sql_r1" THEN
  705. // IF rb_1.Checked = True THEN
  706. // dw_2.Object.sql_r1[l_row] = sle_1.Text
  707. // ELSE
  708. // dw_2.Object.sql_r1[l_row] = mle_1.Text
  709. // END IF
  710. //ELSEIF dwo.Name = "sql_r2" THEN
  711. // IF rb_1.Checked = True THEN
  712. // dw_2.Object.sql_r2[l_row] = sle_1.Text
  713. // ELSE
  714. // dw_2.Object.sql_r2[l_row] = mle_1.Text
  715. // END IF
  716. //END IF
  717. //s_col = dwo.Name
  718. //l_row = row
  719. //ext:
  720. //RETURN
  721. //
  722. //
  723. //
  724. //
  725. //
  726. //
  727. //
  728. //
  729. //
  730. //
  731. //
  732. //
  733. end event
  734. event clicked;call super::clicked;IF row <= 0 THEN RETURN
  735. This.SelectRow(0,False)
  736. This.SelectRow(row,True)
  737. end event
  738. type cb_5 from uo_imflatbutton within w_rep_group
  739. integer x = 3383
  740. integer width = 192
  741. integer height = 164
  742. integer taborder = 210
  743. boolean bringtotop = true
  744. boolean enabled = false
  745. string text = "删行"
  746. string normalpicname = "delete.bmp"
  747. integer picsize = 16
  748. toolbaralignment pic_align = alignattop!
  749. boolean border = false
  750. end type
  751. event clicked;call super::clicked;dw_2.DeleteRow(dw_2.GetRow())
  752. end event
  753. type cb_7 from uo_imflatbutton within w_rep_group
  754. integer x = 2112
  755. integer width = 384
  756. integer height = 164
  757. integer taborder = 220
  758. boolean bringtotop = true
  759. boolean enabled = false
  760. string text = "增客户联系人"
  761. string normalpicname = "new.bmp"
  762. integer picsize = 16
  763. toolbaralignment pic_align = alignattop!
  764. boolean border = false
  765. end type
  766. event clicked;call super::clicked;s_rep_group_parm s_sendmx, s_return
  767. Long i, j,ll_row
  768. s_edit_index_tran ss_tran
  769. OpenWithParm(w_email_seach_cust_group,ss_tran)
  770. s_return = Message.PowerObjectParm
  771. IF Not IsValid(s_return) THEN RETURN
  772. FOR i = 1 To UpperBound(s_return.s_group)
  773. FOR j = 1 To dw_2.RowCount()
  774. IF dw_2.Object.reltype[j] = s_return.s_group[i].reltype And dw_2.Object.relid[j] = s_return.s_group[i].relid And dw_2.Object.repid[j] = s_return.s_group[i].repid THEN
  775. GOTO ext1
  776. END IF
  777. NEXT
  778. ll_row = dw_2.InsertRow(0)
  779. dw_2.Object.groupid[ll_row] = groupid
  780. dw_2.Object.reltype[ll_row] = s_return.s_group[i].reltype
  781. dw_2.Object.relid[ll_row] = s_return.s_group[i].relid
  782. dw_2.Object.repid[ll_row] = s_return.s_group[i].repid
  783. ext1:
  784. NEXT
  785. wf_init(0)
  786. end event
  787. type cb_ext from uo_imflatbutton within w_rep_group
  788. integer x = 777
  789. integer width = 210
  790. integer height = 164
  791. integer taborder = 220
  792. boolean bringtotop = true
  793. string text = "退出"
  794. string normalpicname = "exit.bmp"
  795. integer picsize = 16
  796. toolbaralignment pic_align = alignattop!
  797. boolean border = false
  798. end type
  799. event clicked;call super::clicked;close(parent)
  800. end event
  801. type cb_13 from uo_imflatbutton within w_rep_group
  802. integer x = 1426
  803. integer width = 192
  804. integer height = 164
  805. integer taborder = 190
  806. boolean bringtotop = true
  807. string text = "修改"
  808. string normalpicname = "audit.bmp"
  809. integer picsize = 16
  810. toolbaralignment pic_align = alignattop!
  811. boolean border = false
  812. end type
  813. event clicked;call super::clicked;groupid = 0
  814. f_get_rpid()
  815. IF groupid = 0 Or IsNull(groupid) THEN
  816. MessageBox("error","请选择组")
  817. return
  818. END IF
  819. dw_edit_mode = Not dw_edit_mode
  820. Int LS_INT
  821. FOR LS_INT = 1 To 20
  822. dw_2.SetTabOrder (LS_INT,LS_INT*10 )
  823. NEXT
  824. wf_face()
  825. end event
  826. type cb_8 from uo_imflatbutton within w_rep_group
  827. integer x = 1623
  828. integer width = 192
  829. integer height = 164
  830. integer taborder = 200
  831. boolean bringtotop = true
  832. boolean enabled = false
  833. string text = "保存"
  834. string normalpicname = "save.bmp"
  835. integer picsize = 16
  836. toolbaralignment pic_align = alignattop!
  837. boolean border = false
  838. end type
  839. event clicked;call super::clicked;if save()=0 then
  840. MessageBox (publ_operator,"保存操作失败!",Exclamation!,OK!)
  841. dw_2.reset()
  842. dw_2.Retrieve(groupid)
  843. else
  844. MessageBox (publ_operator,"保存成功!",Exclamation!,OK!)
  845. end if
  846. dw_edit_mode = Not dw_edit_mode
  847. wf_face()
  848. end event
  849. type cb_9 from uo_imflatbutton within w_rep_group
  850. integer x = 1819
  851. integer width = 192
  852. integer height = 164
  853. integer taborder = 210
  854. boolean bringtotop = true
  855. boolean enabled = false
  856. string text = "放弃"
  857. string normalpicname = "delete.bmp"
  858. integer picsize = 16
  859. toolbaralignment pic_align = alignattop!
  860. boolean border = false
  861. end type
  862. event clicked;call super::clicked;dw_edit_mode = Not dw_edit_mode
  863. wf_face()
  864. end event
  865. type cb_6 from uo_imflatbutton within w_rep_group
  866. integer x = 2505
  867. integer width = 439
  868. integer height = 164
  869. integer taborder = 230
  870. boolean bringtotop = true
  871. boolean enabled = false
  872. string text = "增供应商联系人"
  873. string normalpicname = "new.bmp"
  874. integer picsize = 16
  875. toolbaralignment pic_align = alignattop!
  876. boolean border = false
  877. end type
  878. event clicked;call super::clicked;
  879. s_rep_group_parm s_sendmx, s_return
  880. Long i,j, ll_row
  881. s_edit_index_tran ss_tran
  882. OpenWithParm(w_email_seach_spt_group,ss_tran)
  883. s_return = Message.PowerObjectParm
  884. IF Not IsValid(s_return) THEN RETURN
  885. FOR i = 1 To UpperBound(s_return.s_group)
  886. FOR j = 1 To dw_2.RowCount()
  887. IF dw_2.Object.reltype[j] = s_return.s_group[i].reltype And dw_2.Object.relid[j] = s_return.s_group[i].relid And dw_2.Object.repid[j] = s_return.s_group[i].repid THEN
  888. GOTO ext1
  889. END IF
  890. NEXT
  891. ll_row = dw_2.InsertRow(0)
  892. dw_2.Object.groupid[ll_row] = groupid
  893. dw_2.Object.reltype[ll_row] = s_return.s_group[i].reltype
  894. dw_2.Object.relid[ll_row] = s_return.s_group[i].relid
  895. dw_2.Object.repid[ll_row] = s_return.s_group[i].repid
  896. ext1:
  897. NEXT
  898. wf_init(0)
  899. end event
  900. type cb_10 from uo_imflatbutton within w_rep_group
  901. integer x = 2944
  902. integer width = 439
  903. integer height = 164
  904. integer taborder = 240
  905. boolean bringtotop = true
  906. boolean enabled = false
  907. string text = "增自定义组"
  908. string normalpicname = "new.bmp"
  909. integer picsize = 16
  910. toolbaralignment pic_align = alignattop!
  911. boolean border = false
  912. end type
  913. event clicked;call super::clicked;
  914. s_rep_group_parm s_sendmx, s_return
  915. Long i,j, ll_row
  916. s_edit_index_tran ss_tran
  917. OpenWithParm(w_email_seach_self_group,ss_tran)
  918. s_return = Message.PowerObjectParm
  919. IF Not IsValid(s_return) THEN RETURN
  920. FOR i = 1 To UpperBound(s_return.s_group)
  921. FOR j = 1 To dw_2.RowCount()
  922. IF dw_2.Object.reltype[j] = s_return.s_group[i].reltype And dw_2.Object.relid[j] = s_return.s_group[i].relid And dw_2.Object.repid[j] = s_return.s_group[i].repid THEN
  923. GOTO ext1
  924. END IF
  925. NEXT
  926. ll_row = dw_2.InsertRow(0)
  927. dw_2.Object.groupid[ll_row] = groupid
  928. dw_2.Object.reltype[ll_row] = s_return.s_group[i].reltype
  929. dw_2.Object.relid[ll_row] = s_return.s_group[i].relid
  930. dw_2.Object.repid[ll_row] = s_return.s_group[i].repid
  931. ext1:
  932. NEXT
  933. wf_init(0)
  934. end event
  935. type dw_3 from u_dw_rbtnfilter within w_rep_group
  936. integer x = 1824
  937. integer y = 208
  938. integer width = 1755
  939. integer height = 1640
  940. integer taborder = 40
  941. boolean bringtotop = true
  942. boolean titlebar = true
  943. string dataobject = "dw_rep_groupmx_copy"
  944. boolean controlmenu = true
  945. boolean minbox = true
  946. boolean maxbox = true
  947. boolean hscrollbar = true
  948. boolean vscrollbar = true
  949. boolean hsplitscroll = true
  950. boolean rbutton_filter_use = true
  951. boolean rbutton_setposition_use = true
  952. boolean titleclick_sort_use = true
  953. end type
  954. event clicked;call super::clicked;IF row <= 0 THEN RETURN
  955. This.SelectRow(0,False)
  956. This.SelectRow(row,True)
  957. end event
  958. event itemchanged;call super::itemchanged;
  959. //s_text=""
  960. //IF s_col = "" Or l_row = 0 THEN
  961. // s_col = dwo.Name
  962. // l_row = row
  963. // GOTO ext
  964. //END IF
  965. //
  966. //IF s_col = "sql_l1" THEN
  967. // IF rb_1.Checked = True THEN
  968. // dw_2.Object.sql_l1[l_row] = sle_1.Text
  969. // ELSE
  970. // dw_2.Object.sql_l1[l_row] = mle_1.Text
  971. // END IF
  972. //
  973. //ELSEIF dwo.Name = "sql_l2" THEN
  974. // IF rb_1.Checked = True THEN
  975. // dw_2.Object.sql_l2[l_row] = sle_1.Text
  976. // ELSE
  977. // dw_2.Object.sql_l2[l_row] = mle_1.Text
  978. // END IF
  979. //ELSEIF dwo.Name = "sql_r1" THEN
  980. // IF rb_1.Checked = True THEN
  981. // dw_2.Object.sql_r1[l_row] = sle_1.Text
  982. // ELSE
  983. // dw_2.Object.sql_r1[l_row] = mle_1.Text
  984. // END IF
  985. //ELSEIF dwo.Name = "sql_r2" THEN
  986. // IF rb_1.Checked = True THEN
  987. // dw_2.Object.sql_r2[l_row] = sle_1.Text
  988. // ELSE
  989. // dw_2.Object.sql_r2[l_row] = mle_1.Text
  990. // END IF
  991. //END IF
  992. //s_col = dwo.Name
  993. //l_row = row
  994. //ext:
  995. //RETURN
  996. //
  997. //
  998. //
  999. //
  1000. //
  1001. //
  1002. //
  1003. //
  1004. //
  1005. //
  1006. //
  1007. //
  1008. end event
  1009. type cb_11 from uo_imflatbutton within w_rep_group
  1010. integer x = 3808
  1011. integer width = 439
  1012. integer height = 164
  1013. integer taborder = 250
  1014. boolean bringtotop = true
  1015. string text = "展开所有分组"
  1016. string normalpicname = "new.bmp"
  1017. integer picsize = 16
  1018. toolbaralignment pic_align = alignattop!
  1019. boolean border = false
  1020. end type
  1021. event clicked;call super::clicked;datastore dw_x
  1022. Long i,j,ll_groupid
  1023. dw_x = Create datastore
  1024. dw_x.DataObject = 'dw_rep_groupmx'
  1025. dw_x.SetTransObject(sqlca)
  1026. IF dw_2.RowCount() <= 0 THEN RETURN
  1027. dw_3.Visible = Not dw_3.Visible
  1028. IF dw_3.Visible = True THEN
  1029. This.Text = "收起所有分组"
  1030. ELSE
  1031. This.Text = "展开所有分组"
  1032. END IF
  1033. IF dw_3.Visible = True THEN
  1034. dw_3.Reset()
  1035. FOR i = 1 To dw_2.RowCount()
  1036. IF dw_2.Object.reltype[i] <> 2 THEN
  1037. dw_2.RowsCopy (i,i,Primary!,dw_3,dw_3.RowCount() + 1,Primary!)
  1038. ELSE
  1039. dw_x.Reset()
  1040. ll_groupid = dw_2.Object.relid[i]
  1041. dw_x.Retrieve(ll_groupid)
  1042. dw_x.RowsCopy (1,dw_x.RowCount(),Primary!,dw_3,dw_3.RowCount() + 1,Primary!)
  1043. END IF
  1044. NEXT
  1045. wf_init(1)
  1046. END IF
  1047. end event
  1048. type st_2 from statictext within w_rep_group
  1049. integer x = 23
  1050. integer y = 2772
  1051. integer width = 2089
  1052. integer height = 72
  1053. boolean bringtotop = true
  1054. integer textsize = -9
  1055. integer weight = 700
  1056. fontcharset fontcharset = gb2312charset!
  1057. fontpitch fontpitch = variable!
  1058. string facename = "宋体"
  1059. long textcolor = 134217857
  1060. long backcolor = 67108864
  1061. string text = "提示:只有父项可添加子项,子项不能添加子项"
  1062. boolean focusrectangle = false
  1063. end type
  1064. type ln_3 from line within w_rep_group
  1065. long linecolor = 268435456
  1066. integer linethickness = 18
  1067. integer beginx = 1413
  1068. integer beginy = 4
  1069. integer endx = 1413
  1070. integer endy = 160
  1071. end type