w_cus_ecomm_cus_rep_edit.srw 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293
  1. $PBExportHeader$w_cus_ecomm_cus_rep_edit.srw
  2. forward
  3. global type w_cus_ecomm_cus_rep_edit from w_publ_base
  4. end type
  5. type dw_cus_user from u_dw_rbtnfilter within w_cus_ecomm_cus_rep_edit
  6. end type
  7. type tab_1 from tab within w_cus_ecomm_cus_rep_edit
  8. end type
  9. type tabpage_1 from userobject within tab_1
  10. end type
  11. type tv_2 from uo_ljfieb_tv_pwr within tabpage_1
  12. end type
  13. type tabpage_1 from userobject within tab_1
  14. tv_2 tv_2
  15. end type
  16. type tabpage_2 from userobject within tab_1
  17. end type
  18. type dw_cm from u_dw_rbtnfilter within tabpage_2
  19. end type
  20. type cb_add_cm from uo_imflatbutton within tabpage_2
  21. end type
  22. type cb_del_cm from uo_imflatbutton within tabpage_2
  23. end type
  24. type cb_undo_cm from uo_imflatbutton within tabpage_2
  25. end type
  26. type cb_new_cm from uo_imflatbutton within tabpage_2
  27. end type
  28. type r_bar_cm from rectangle within tabpage_2
  29. end type
  30. type ln_3 from line within tabpage_2
  31. end type
  32. type ln_4 from line within tabpage_2
  33. end type
  34. type tabpage_2 from userobject within tab_1
  35. dw_cm dw_cm
  36. cb_add_cm cb_add_cm
  37. cb_del_cm cb_del_cm
  38. cb_undo_cm cb_undo_cm
  39. cb_new_cm cb_new_cm
  40. r_bar_cm r_bar_cm
  41. ln_3 ln_3
  42. ln_4 ln_4
  43. end type
  44. type tab_1 from tab within w_cus_ecomm_cus_rep_edit
  45. tabpage_1 tabpage_1
  46. tabpage_2 tabpage_2
  47. end type
  48. type cb_retrievemx from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  49. end type
  50. type cb_add from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  51. end type
  52. type cb_edit from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  53. end type
  54. type cb_del from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  55. end type
  56. type cb_copy from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  57. end type
  58. type cb_copy_p from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  59. end type
  60. type cb_reset from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  61. end type
  62. type cb_help from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  63. end type
  64. type cb_view_all from commandbutton within w_cus_ecomm_cus_rep_edit
  65. end type
  66. type ln_bar from line within w_cus_ecomm_cus_rep_edit
  67. end type
  68. type ln_bar2 from line within w_cus_ecomm_cus_rep_edit
  69. end type
  70. type r_bar from rectangle within w_cus_ecomm_cus_rep_edit
  71. end type
  72. end forward
  73. global type w_cus_ecomm_cus_rep_edit from w_publ_base
  74. integer width = 3611
  75. integer height = 2380
  76. string title = "客户协同用户资料"
  77. windowstate windowstate = maximized!
  78. event ue_help ( )
  79. event ue_send_cust ( )
  80. event ue_send_cust_rep ( )
  81. event ue_send_funcpwreb ( )
  82. event retrieve_cus_rep_pwr ( )
  83. dw_cus_user dw_cus_user
  84. tab_1 tab_1
  85. cb_retrievemx cb_retrievemx
  86. cb_add cb_add
  87. cb_edit cb_edit
  88. cb_del cb_del
  89. cb_copy cb_copy
  90. cb_copy_p cb_copy_p
  91. cb_reset cb_reset
  92. cb_help cb_help
  93. cb_view_all cb_view_all
  94. ln_bar ln_bar
  95. ln_bar2 ln_bar2
  96. r_bar r_bar
  97. end type
  98. global w_cus_ecomm_cus_rep_edit w_cus_ecomm_cus_rep_edit
  99. type variables
  100. long ins_cusid = -1
  101. long copy_repid
  102. uo_ljfieb_tv_pwr tv_2
  103. datawindow dw_cm
  104. end variables
  105. forward prototypes
  106. public function integer wf_save (ref string arg_msg)
  107. public subroutine wf_facecm ()
  108. public subroutine wf_retrievecm ()
  109. end prototypes
  110. event ue_help();htmlhelpA(Handle(THIS), sys_help_chm, 0, THIS.Title+".htm")
  111. end event
  112. event ue_send_cust();uo_ljfieb uo_fieb
  113. uo_fieb = Create uo_ljfieb
  114. uo_fieb.commit_transaction = sys_email_sqlca
  115. Long ll_cusid_arr[]
  116. String arg_msg
  117. Integer rslt = 1
  118. Long ll_row
  119. ll_row = dw_cus_user.GetRow()
  120. IF ll_row <= 0 THEN
  121. rslt = 0
  122. arg_msg = '选择要发送的客户'
  123. GOTO ext
  124. END IF
  125. ll_cusid_arr[1] = dw_cus_user.Object.cusid[ll_row]
  126. IF uo_fieb.send_cust(0, ll_cusid_arr, '', '', '', arg_msg, True) = 0 THEN
  127. rslt = 0
  128. GOTO ext
  129. END IF
  130. ext:
  131. Destroy uo_fieb
  132. IF rslt = 0 THEN
  133. MessageBox('系统提示',arg_msg)
  134. ELSE
  135. MessageBox('系统提示',"发送电子商务客户成功")
  136. END IF
  137. RETURN
  138. end event
  139. event ue_send_cust_rep();uo_ljfieb uo_fieb
  140. uo_fieb = Create uo_ljfieb
  141. uo_fieb.commit_transaction = sys_email_sqlca
  142. Long ll_repid_arr[]
  143. String arg_msg
  144. Integer rslt = 1
  145. Long ll_row
  146. ll_row = dw_cus_user.GetRow()
  147. IF ll_row <= 0 THEN
  148. rslt = 0
  149. arg_msg = '请选择用户'
  150. GOTO ext
  151. END IF
  152. ll_repid_arr[1] = dw_cus_user.Object.repid[ll_row]
  153. IF uo_fieb.send_cust_rep(0, ll_repid_arr, '', '', '',False, arg_msg, True) = 0 THEN
  154. rslt = 0
  155. GOTO ext
  156. END IF
  157. ext:
  158. Destroy uo_fieb
  159. IF rslt = 0 THEN
  160. MessageBox('系统提示',arg_msg)
  161. ELSE
  162. MessageBox('系统提示',"发送电子商务用户成功")
  163. END IF
  164. RETURN
  165. end event
  166. event ue_send_funcpwreb();Int rslt = 1
  167. String arg_msg
  168. uo_ljfieb uo_fieb
  169. uo_fieb = Create uo_ljfieb
  170. uo_fieb.commit_transaction = sys_email_sqlca
  171. IF uo_fieb.send_funcpwreb(0, 0, '', '', '', arg_msg, True) = 0 THEN
  172. rslt = 0
  173. GOTO ext
  174. END IF
  175. ext:
  176. Destroy uo_fieb
  177. IF rslt = 0 THEN
  178. MessageBox('系统提示',arg_msg)
  179. ELSE
  180. MessageBox('系统提示',"发送权限树成功")
  181. END IF
  182. RETURN
  183. end event
  184. event retrieve_cus_rep_pwr();long ll_row
  185. ll_row = dw_cus_user.GetRow()
  186. if ll_row <= 0 then return
  187. Long ll_repid
  188. ll_repid = dw_cus_user.Object.repid[ll_row]
  189. SetPointer(HourGlass!)
  190. string ls_Permissions
  191. IF ll_repid > 0 THEN
  192. SELECT Permissions
  193. INTO :ls_Permissions
  194. FROM ros_cust_rep
  195. Where repid = :ll_repid;
  196. IF sqlca.SQLCode <> 0 THEN
  197. ls_Permissions = ''
  198. END IF
  199. ELSE
  200. ls_Permissions = ''
  201. END IF
  202. //刷新权限
  203. Long ll_handl
  204. ll_handl = tv_2.FindItem(RootTreeItem!,0)
  205. IF ll_handl > 0 THEN tv_2.pf_refresh_value(ll_handl,ls_Permissions)
  206. //刷新联系用户
  207. wf_retrievecm()
  208. SetPointer(Arrow!)
  209. end event
  210. public function integer wf_save (ref string arg_msg);Int rslt = 1
  211. Long ll_repid
  212. Long i, cnt
  213. String ls_ljemail_arr[]
  214. s_cus_rep_cm_ljfieb s_mx
  215. uo_ljfieb_cus uo_ljc
  216. uo_ljc = Create uo_ljfieb_cus
  217. uo_ljfieb uo_fieb
  218. uo_fieb = Create uo_ljfieb
  219. uo_fieb.commit_transaction = sys_email_sqlca
  220. Long ll_row
  221. ll_row = dw_cus_user.GetRow()
  222. IF ll_row <= 0 THEN
  223. rslt = 0
  224. arg_msg = '没有选中用户'
  225. GOTO ext
  226. END IF
  227. ll_repid = dw_cus_user.Object.repid[ll_row]
  228. FOR i = 1 To dw_cm.RowCount()
  229. s_mx.repid = ll_repid
  230. s_mx.ljemail = dw_cm.Object.ljemail[i]
  231. s_mx.username = dw_cm.Object.username[i]
  232. s_mx.cmtype = dw_cm.Object.cmtype[i]
  233. s_mx.dscrp = ''
  234. IF uo_ljc.uof_add_cust_rep_cm(s_mx, arg_msg, False) = 0 THEN
  235. arg_msg = '行:'+String(i)+','+arg_msg
  236. rslt = 0
  237. GOTO ext
  238. END IF
  239. cnt++
  240. ls_ljemail_arr[cnt] = dw_cm.Object.ljemail[i]
  241. NEXT
  242. IF uo_fieb.send_cust_rep_cm(0, ll_repid, ls_ljemail_arr, '', '', '', arg_msg, False) = 0 THEN
  243. arg_msg = '发送数据失败,'+arg_msg
  244. rslt = 0
  245. GOTO ext
  246. END IF
  247. ext:
  248. Destroy uo_ljc
  249. Destroy uo_fieb
  250. IF rslt = 0 THEN
  251. ROLLBACK Using sqlca;
  252. ROLLBACK Using sys_email_sqlca;
  253. ELSE
  254. COMMIT Using sqlca;
  255. COMMIT Using sys_email_sqlca;
  256. END IF
  257. RETURN rslt
  258. end function
  259. public subroutine wf_facecm ();tab_1.tabpage_2.cb_new_cm.Enabled = (dw_cus_user.GetRow() > 0)
  260. tab_1.tabpage_2.cb_undo_cm.Enabled = dw_edit_mode AND (dw_cus_user.GetRow() > 0)
  261. tab_1.tabpage_2.cb_add_cm.Enabled = dw_edit_mode AND (dw_cus_user.GetRow() > 0)
  262. tab_1.tabpage_2.cb_del_cm.Enabled = Not dw_edit_mode AND (dw_cus_user.GetRow() > 0)
  263. IF dw_edit_mode THEN
  264. tab_1.tabpage_2.cb_new_cm.Text = '保存'
  265. tab_1.tabpage_2.cb_new_cm.normalpicname = 'save.bmp'
  266. ELSE
  267. tab_1.tabpage_2.cb_new_cm.Text = '修改'
  268. tab_1.tabpage_2.cb_new_cm.normalpicname = 'open.bmp'
  269. END IF
  270. tab_1.tabpage_2.cb_new_cm.of_init_draw()
  271. tab_1.tabpage_2.cb_new_cm.of_paint()
  272. tab_1.tabpage_2.cb_new_cm.TriggerEvent('ue_textchange')
  273. end subroutine
  274. public subroutine wf_retrievecm ();Long ll_row
  275. ll_row = dw_cus_user.GetRow()
  276. IF ll_row <= 0 THEN
  277. dw_cm.Reset()
  278. RETURN
  279. END IF
  280. Long ll_repid
  281. ll_repid = dw_cus_user.Object.repid[ll_row]
  282. dw_cm.Retrieve(ll_repid)
  283. end subroutine
  284. on w_cus_ecomm_cus_rep_edit.create
  285. int iCurrent
  286. call super::create
  287. this.dw_cus_user=create dw_cus_user
  288. this.tab_1=create tab_1
  289. this.cb_retrievemx=create cb_retrievemx
  290. this.cb_add=create cb_add
  291. this.cb_edit=create cb_edit
  292. this.cb_del=create cb_del
  293. this.cb_copy=create cb_copy
  294. this.cb_copy_p=create cb_copy_p
  295. this.cb_reset=create cb_reset
  296. this.cb_help=create cb_help
  297. this.cb_view_all=create cb_view_all
  298. this.ln_bar=create ln_bar
  299. this.ln_bar2=create ln_bar2
  300. this.r_bar=create r_bar
  301. iCurrent=UpperBound(this.Control)
  302. this.Control[iCurrent+1]=this.dw_cus_user
  303. this.Control[iCurrent+2]=this.tab_1
  304. this.Control[iCurrent+3]=this.cb_retrievemx
  305. this.Control[iCurrent+4]=this.cb_add
  306. this.Control[iCurrent+5]=this.cb_edit
  307. this.Control[iCurrent+6]=this.cb_del
  308. this.Control[iCurrent+7]=this.cb_copy
  309. this.Control[iCurrent+8]=this.cb_copy_p
  310. this.Control[iCurrent+9]=this.cb_reset
  311. this.Control[iCurrent+10]=this.cb_help
  312. this.Control[iCurrent+11]=this.cb_view_all
  313. this.Control[iCurrent+12]=this.ln_bar
  314. this.Control[iCurrent+13]=this.ln_bar2
  315. this.Control[iCurrent+14]=this.r_bar
  316. end on
  317. on w_cus_ecomm_cus_rep_edit.destroy
  318. call super::destroy
  319. destroy(this.dw_cus_user)
  320. destroy(this.tab_1)
  321. destroy(this.cb_retrievemx)
  322. destroy(this.cb_add)
  323. destroy(this.cb_edit)
  324. destroy(this.cb_del)
  325. destroy(this.cb_copy)
  326. destroy(this.cb_copy_p)
  327. destroy(this.cb_reset)
  328. destroy(this.cb_help)
  329. destroy(this.cb_view_all)
  330. destroy(this.ln_bar)
  331. destroy(this.ln_bar2)
  332. destroy(this.r_bar)
  333. end on
  334. event resize;call super::resize;Long w_width,w_height
  335. w_width = 3600
  336. w_height = 2300
  337. IF newwidth < w_width THEN This.Width = w_width
  338. IF newheight < w_height THEN This.Height = w_height
  339. r_bar.Width = This.Width
  340. ln_bar.EndX = This.Width
  341. ln_bar2.EndX = This.Width
  342. dw_cus_user.Width = This.WorkSpaceWidth() - dw_cus_user.X - tab_1.Width
  343. tab_1.X = dw_cus_user.Width + dw_cus_user.X
  344. dw_cus_user.Height = This.WorkSpaceHeight() - dw_cus_user.Y
  345. tab_1.Height = This.WorkSpaceHeight() - tab_1.Y
  346. tv_2.Width = tab_1.Width - 37
  347. tv_2.Height = tab_1.Height - 112
  348. tab_1.tabpage_2.ln_3.EndX = tab_1.Width
  349. tab_1.tabpage_2.ln_4.EndX = tab_1.Width
  350. tab_1.tabpage_2.r_bar_cm.width = tab_1.width
  351. dw_cm.Width = tv_2.Width
  352. dw_cm.Height = tv_2.Height - dw_cm.Y
  353. end event
  354. event open;call super::open;s_edit_index_tran s_tran
  355. s_tran = Message.PowerObjectParm
  356. IF Not IsNull(s_tran) And IsValid(s_tran) THEN
  357. ins_cusid = s_tran.b_long
  358. END IF
  359. if ins_cusid > 0 then
  360. cb_view_all.Visible = true
  361. else
  362. ins_cusid = -1
  363. cb_view_all.Visible = false
  364. end if
  365. tv_2 = tab_1.tabpage_1.tv_2
  366. dw_cm = tab_1.tabpage_2.dw_cm
  367. dw_cus_user.SetTransObject(sqlca)
  368. dw_cm.SetTransObject(sqlca)
  369. cb_retrievemx.TriggerEvent(Clicked!)
  370. end event
  371. type cb_func from w_publ_base`cb_func within w_cus_ecomm_cus_rep_edit
  372. integer x = 1248
  373. integer width = 151
  374. integer height = 164
  375. end type
  376. event cb_func::clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  377. String menustr
  378. menustr = "Text=发送电子商务权限树~tEvent=ue_send_FuncPwrEB"
  379. menustr = menustr + "|" + "Text=发送电子商务客户~tEvent=ue_Send_cust"
  380. menustr = menustr + "|" + "Text=发送电子商务用户~tEvent=ue_Send_cust_rep"
  381. IF Len(Trim(menustr)) <> 0 THEN
  382. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  383. dmPopupMenu.mf_BuildMenu(This, menustr)
  384. dmPopupMenu.mf_PopMenu()
  385. Destroy dmPopupMenu
  386. END IF
  387. end event
  388. type cb_exit from w_publ_base`cb_exit within w_cus_ecomm_cus_rep_edit
  389. integer x = 1550
  390. integer width = 151
  391. integer height = 164
  392. integer picsize = 16
  393. toolbaralignment pic_align = alignattop!
  394. boolean border = false
  395. end type
  396. type dw_cus_user from u_dw_rbtnfilter within w_cus_ecomm_cus_rep_edit
  397. integer y = 184
  398. integer width = 2427
  399. integer height = 644
  400. integer taborder = 40
  401. boolean bringtotop = true
  402. boolean titlebar = true
  403. string title = "客户协同用户资料"
  404. string dataobject = "dw_cust_ecomm_cus_rep"
  405. boolean maxbox = true
  406. boolean hscrollbar = true
  407. boolean vscrollbar = true
  408. boolean resizable = true
  409. boolean hsplitscroll = true
  410. borderstyle borderstyle = stylebox!
  411. boolean rbutton_filter_use = true
  412. boolean titleclick_sort_use = true
  413. end type
  414. event clicked;IF row > 0 THEN
  415. This.SetRow(row)
  416. This.SelectRow(0,False)
  417. This.SelectRow(row,True)
  418. END IF
  419. end event
  420. event rowfocuschanged;IF currentrow <= 0 THEN RETURN
  421. This.SelectRow(0,False)
  422. This.SelectRow(currentrow,True)
  423. Parent.TriggerEvent("retrieve_cus_rep_pwr")
  424. wf_facecm()
  425. end event
  426. event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode then return 1
  427. end event
  428. type tab_1 from tab within w_cus_ecomm_cus_rep_edit
  429. integer x = 2441
  430. integer y = 184
  431. integer width = 1166
  432. integer height = 1200
  433. integer taborder = 50
  434. boolean bringtotop = true
  435. integer textsize = -9
  436. integer weight = 400
  437. fontcharset fontcharset = gb2312charset!
  438. fontpitch fontpitch = variable!
  439. string facename = "宋体"
  440. long backcolor = 134217739
  441. boolean raggedright = true
  442. boolean focusonbuttondown = true
  443. integer selectedtab = 1
  444. tabpage_1 tabpage_1
  445. tabpage_2 tabpage_2
  446. end type
  447. on tab_1.create
  448. this.tabpage_1=create tabpage_1
  449. this.tabpage_2=create tabpage_2
  450. this.Control[]={this.tabpage_1,&
  451. this.tabpage_2}
  452. end on
  453. on tab_1.destroy
  454. destroy(this.tabpage_1)
  455. destroy(this.tabpage_2)
  456. end on
  457. type tabpage_1 from userobject within tab_1
  458. integer x = 18
  459. integer y = 96
  460. integer width = 1129
  461. integer height = 1088
  462. long backcolor = 16777215
  463. string text = "权限"
  464. long tabbackcolor = 134217739
  465. long picturemaskcolor = 553648127
  466. tv_2 tv_2
  467. end type
  468. on tabpage_1.create
  469. this.tv_2=create tv_2
  470. this.Control[]={this.tv_2}
  471. end on
  472. on tabpage_1.destroy
  473. destroy(this.tv_2)
  474. end on
  475. type tv_2 from uo_ljfieb_tv_pwr within tabpage_1
  476. integer width = 1129
  477. integer height = 1088
  478. integer taborder = 50
  479. end type
  480. type tabpage_2 from userobject within tab_1
  481. event create ( )
  482. event destroy ( )
  483. integer x = 18
  484. integer y = 96
  485. integer width = 1129
  486. integer height = 1088
  487. long backcolor = 16777215
  488. string text = "用户联系"
  489. long tabbackcolor = 134217739
  490. long picturemaskcolor = 536870912
  491. dw_cm dw_cm
  492. cb_add_cm cb_add_cm
  493. cb_del_cm cb_del_cm
  494. cb_undo_cm cb_undo_cm
  495. cb_new_cm cb_new_cm
  496. r_bar_cm r_bar_cm
  497. ln_3 ln_3
  498. ln_4 ln_4
  499. end type
  500. on tabpage_2.create
  501. this.dw_cm=create dw_cm
  502. this.cb_add_cm=create cb_add_cm
  503. this.cb_del_cm=create cb_del_cm
  504. this.cb_undo_cm=create cb_undo_cm
  505. this.cb_new_cm=create cb_new_cm
  506. this.r_bar_cm=create r_bar_cm
  507. this.ln_3=create ln_3
  508. this.ln_4=create ln_4
  509. this.Control[]={this.dw_cm,&
  510. this.cb_add_cm,&
  511. this.cb_del_cm,&
  512. this.cb_undo_cm,&
  513. this.cb_new_cm,&
  514. this.r_bar_cm,&
  515. this.ln_3,&
  516. this.ln_4}
  517. end on
  518. on tabpage_2.destroy
  519. destroy(this.dw_cm)
  520. destroy(this.cb_add_cm)
  521. destroy(this.cb_del_cm)
  522. destroy(this.cb_undo_cm)
  523. destroy(this.cb_new_cm)
  524. destroy(this.r_bar_cm)
  525. destroy(this.ln_3)
  526. destroy(this.ln_4)
  527. end on
  528. type dw_cm from u_dw_rbtnfilter within tabpage_2
  529. integer y = 184
  530. integer width = 1605
  531. integer height = 644
  532. integer taborder = 100
  533. boolean bringtotop = true
  534. string title = "用户联系表"
  535. string dataobject = "dw_cust_ecomm_cus_rep_cm"
  536. boolean hscrollbar = true
  537. boolean vscrollbar = true
  538. boolean hsplitscroll = true
  539. borderstyle borderstyle = stylebox!
  540. boolean titleclick_sort_use = true
  541. end type
  542. event clicked;IF row > 0 THEN
  543. This.SetRow(row)
  544. This.SelectRow(0,False)
  545. This.SelectRow(row,True)
  546. IF dwo.Name = 'ch' THEN
  547. This.SetTabOrder('ch',10)
  548. ELSE
  549. This.SetTabOrder('ch',0)
  550. END IF
  551. END IF
  552. end event
  553. event constructor;call super::constructor;
  554. RBUTTON_FILTER_USE=true //右键查询功能开关
  555. end event
  556. event rowfocuschanged;IF currentrow <=0 THEN RETURN
  557. this.selectrow(0,false)
  558. this.selectrow(currentrow,true)
  559. end event
  560. event dwnkey;call super::dwnkey;parent.triggerevent('user_key')
  561. end event
  562. type cb_add_cm from uo_imflatbutton within tabpage_2
  563. integer x = 302
  564. integer width = 151
  565. integer height = 164
  566. integer taborder = 80
  567. boolean bringtotop = true
  568. boolean enabled = false
  569. string text = "增加"
  570. string normalpicname = "mx.bmp"
  571. integer picsize = 16
  572. toolbaralignment pic_align = alignattop!
  573. boolean border = false
  574. end type
  575. event clicked;call super::clicked;IF Not dw_edit_mode THEN RETURN
  576. Long i, ll_row
  577. Long ll_repid
  578. ll_row = dw_cus_user.GetRow()
  579. ll_repid = dw_cus_user.Object.repid[ll_row]
  580. OpenWithParm(w_cus_ecomm_rep_cm_ch, ll_repid)
  581. s_cus_rep_cm_ljfieb_arr s_mx_arr
  582. s_mx_arr = Message.PowerObjectParm
  583. FOR i = 1 To UpperBound(s_mx_arr.ljemail)
  584. ll_row = dw_cm.Find("ljemail = '"+s_mx_arr.ljemail[i]+"'", 1, dw_cm.RowCount())
  585. IF ll_row > 0 THEN CONTINUE
  586. ll_row = dw_cm.InsertRow(0)
  587. dw_cm.Object.ljemail[ll_row] = s_mx_arr.ljemail[i]
  588. dw_cm.Object.username[ll_row] = s_mx_arr.username[i]
  589. dw_cm.Object.cmtype[ll_row] = s_mx_arr.cmtype[i]
  590. NEXT
  591. dw_cm.AcceptText()
  592. end event
  593. type cb_del_cm from uo_imflatbutton within tabpage_2
  594. integer x = 453
  595. integer width = 151
  596. integer height = 164
  597. integer taborder = 80
  598. boolean bringtotop = true
  599. string text = "删除"
  600. string normalpicname = "delete.bmp"
  601. integer picsize = 16
  602. toolbaralignment pic_align = alignattop!
  603. boolean border = false
  604. end type
  605. event clicked;call super::clicked;Long ll_row
  606. ll_row = dw_cus_user.GetRow()
  607. IF ll_row <= 0 THEN
  608. RETURN
  609. END IF
  610. dw_cm.AcceptText()
  611. IF sys_email_sqlca.DBHandle() = 0 THEN
  612. MessageBox('Error','电子商务数据库连接未设置或失败,请检查')
  613. RETURN
  614. END IF
  615. Long ll_rows[]
  616. Long i,j = 0
  617. FOR i = 1 To dw_cm.RowCount()
  618. IF dw_cm.Object.ch[i] = 1 THEN
  619. j++
  620. ll_rows[j] = i
  621. END IF
  622. NEXT
  623. IF j <= 0 THEN
  624. i = dw_cm.GetRow()
  625. IF i <= 0 THEN
  626. MessageBox('Error','请选择要删除的用户联系人')
  627. RETURN
  628. END IF
  629. j++
  630. ll_rows[j] = i
  631. END IF
  632. IF MessageBox('确定','是否确定删除当前勾选的用户联系人?',Question!, YesNo!) = 2 THEN
  633. RETURN
  634. END IF
  635. Int rslt = 1
  636. String arg_msg
  637. Long ll_cnt
  638. Long ll_repid
  639. String ls_ljemail
  640. String ls_ljemail_arr[]
  641. ll_repid = dw_cus_user.Object.repid[ll_row]
  642. uo_ljfieb_cus uo_ljc
  643. uo_ljc = Create uo_ljfieb_cus
  644. uo_ljfieb uo_fieb
  645. uo_fieb = Create uo_ljfieb
  646. uo_fieb.commit_transaction = sys_email_sqlca
  647. FOR i = 1 To UpperBound(ll_rows)
  648. ls_ljemail = dw_cm.Object.ljemail[ll_rows[i]]
  649. IF uo_ljc.uof_del_cust_rep_cm(ll_repid, ls_ljemail, arg_msg, False) = 0 THEN
  650. arg_msg = '行:'+String(ll_rows[i])+','+arg_msg
  651. rslt = 0
  652. GOTO ext
  653. END IF
  654. NEXT
  655. j = 0
  656. FOR i = 1 To UpperBound(ll_rows)
  657. j++
  658. ls_ljemail_arr[j] = dw_cm.Object.ljemail[ll_rows[i]]
  659. NEXT
  660. IF uo_fieb.send_cust_rep_cm(0, ll_repid, ls_ljemail_arr, '', '', '', arg_msg, False) = 0 THEN
  661. arg_msg = '发送数据失败,'+arg_msg
  662. rslt = 0
  663. GOTO ext
  664. END IF
  665. dw_cm.Retrieve(ll_repid)
  666. ext:
  667. Destroy uo_ljc
  668. Destroy uo_fieb
  669. IF rslt = 0 THEN
  670. ROLLBACK Using sqlca;
  671. ROLLBACK Using sys_email_sqlca;
  672. MessageBox('错误',arg_msg)
  673. RETURN
  674. ELSE
  675. COMMIT Using sqlca;
  676. COMMIT Using sys_email_sqlca;
  677. MessageBox('系统提示','删除联系人成功')
  678. END IF
  679. end event
  680. type cb_undo_cm from uo_imflatbutton within tabpage_2
  681. integer x = 151
  682. integer width = 151
  683. integer height = 164
  684. integer taborder = 20
  685. boolean bringtotop = true
  686. boolean enabled = false
  687. string text = "取消"
  688. string normalpicname = "undo.bmp"
  689. integer picsize = 16
  690. toolbaralignment pic_align = alignattop!
  691. boolean border = false
  692. end type
  693. event clicked;call super::clicked;//IF sys_email_sqlca.DBHandle() = 0 THEN
  694. // MessageBox('Error','电子商务数据库连接失败,请检查')
  695. // RETURN
  696. //END IF
  697. IF MessageBox('确定','是否确定放弃保存?',Question!, YesNo!) = 2 THEN
  698. RETURN
  699. END IF
  700. dw_edit_mode = not dw_edit_mode
  701. wf_facecm()
  702. wf_retrievecm()
  703. end event
  704. type cb_new_cm from uo_imflatbutton within tabpage_2
  705. integer width = 151
  706. integer height = 164
  707. integer taborder = 20
  708. boolean bringtotop = true
  709. string text = "修改"
  710. string normalpicname = "open.bmp"
  711. integer picsize = 16
  712. toolbaralignment pic_align = alignattop!
  713. boolean border = false
  714. end type
  715. event clicked;call super::clicked;Long ll_row
  716. ll_row = dw_cus_user.GetRow()
  717. IF ll_row <= 0 THEN
  718. RETURN
  719. END IF
  720. IF sys_email_sqlca.DBHandle() = 0 THEN
  721. MessageBox('Error','电子商务数据库连接失败,请检查')
  722. RETURN
  723. END IF
  724. String ls_msg
  725. IF dw_edit_mode THEN
  726. IF wf_save(ls_msg) <> 1 THEN
  727. MessageBox('Error', ls_msg)
  728. RETURN
  729. END IF
  730. END IF
  731. dw_edit_mode = Not dw_edit_mode
  732. wf_facecm()
  733. wf_retrievecm()
  734. end event
  735. type r_bar_cm from rectangle within tabpage_2
  736. long linecolor = 16777215
  737. integer linethickness = 4
  738. long fillcolor = 1073741824
  739. integer x = 581
  740. integer width = 146
  741. integer height = 68
  742. end type
  743. event constructor;this.fillcolor = 14215660
  744. this.linecolor = 14215660
  745. this.x = -1
  746. this.y = -1
  747. this.height = ln_4.beginy - 5
  748. end event
  749. type ln_3 from line within tabpage_2
  750. long linecolor = 16777215
  751. integer linethickness = 4
  752. integer beginy = 176
  753. integer endx = 2039
  754. integer endy = 176
  755. end type
  756. type ln_4 from line within tabpage_2
  757. long linecolor = 268435456
  758. integer linethickness = 4
  759. integer beginy = 172
  760. integer endx = 2007
  761. integer endy = 172
  762. end type
  763. type cb_retrievemx from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  764. integer width = 151
  765. integer height = 164
  766. integer taborder = 30
  767. boolean bringtotop = true
  768. string text = "刷新"
  769. string normalpicname = "refresh.bmp"
  770. integer picsize = 16
  771. toolbaralignment pic_align = alignattop!
  772. boolean border = false
  773. end type
  774. event clicked;call super::clicked;dw_cus_user.Retrieve(ins_cusid)
  775. end event
  776. type cb_add from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  777. integer x = 151
  778. integer width = 151
  779. integer height = 164
  780. integer taborder = 40
  781. boolean bringtotop = true
  782. string text = "新建"
  783. string normalpicname = "new.bmp"
  784. integer picsize = 16
  785. toolbaralignment pic_align = alignattop!
  786. boolean border = false
  787. end type
  788. event clicked;call super::clicked;IF Not f_power_ind(1561) THEN
  789. MessageBox(publ_operator,'没有使用权限!')
  790. RETURN
  791. END IF
  792. s_edit_index_tran s_tran
  793. Long ll_cusid, ll_repid
  794. ll_cusid = ins_cusid
  795. ll_repid = 0
  796. IF ll_cusid <= 0 THEN
  797. // TODO: 选择客户协同的客户
  798. END IF
  799. s_tran.b_long = ll_cusid
  800. s_tran.c_long = ll_repid
  801. s_tran.d_long = copy_repid
  802. OpenWithParm(w_cus_ecomm_edit_add, s_tran)
  803. cb_retrievemx.TriggerEvent(Clicked!)
  804. end event
  805. type cb_edit from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  806. integer x = 302
  807. integer width = 151
  808. integer height = 164
  809. integer taborder = 50
  810. boolean bringtotop = true
  811. string text = "修改"
  812. string normalpicname = "open.bmp"
  813. integer picsize = 16
  814. toolbaralignment pic_align = alignattop!
  815. boolean border = false
  816. end type
  817. event clicked;call super::clicked;IF Not f_power_ind(1561) THEN
  818. MessageBox(publ_operator,'没有使用权限!')
  819. RETURN
  820. END IF
  821. s_edit_index_tran s_tran
  822. Long ll_cusid, ll_repid
  823. long ll_row
  824. ll_row = dw_cus_user.GetRow()
  825. if ll_row <= 0 then
  826. MessageBox("系统提示","请选择要修改的用户")
  827. RETURN
  828. end if
  829. ll_cusid = dw_cus_user.Object.cusid[ll_row]
  830. ll_repid = dw_cus_user.object.repid[ll_row]
  831. s_tran.b_long = ll_cusid
  832. s_tran.c_long = ll_repid
  833. s_tran.d_long = copy_repid
  834. OpenWithParm(w_cus_ecomm_edit_add, s_tran)
  835. cb_retrievemx.triggerevent(clicked!)
  836. end event
  837. type cb_del from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  838. integer x = 453
  839. integer width = 151
  840. integer height = 164
  841. integer taborder = 60
  842. boolean bringtotop = true
  843. string text = "删除"
  844. string normalpicname = "delete.bmp"
  845. integer picsize = 16
  846. toolbaralignment pic_align = alignattop!
  847. boolean border = false
  848. end type
  849. event clicked;call super::clicked;IF Not f_power_ind(1561) THEN
  850. MessageBox(publ_operator,'没有使用权限!')
  851. RETURN
  852. END IF
  853. IF MessageBox("系统提示","是否确定要删除当前用户?", Question!, YesNo!) = 2 THEN RETURN
  854. Int rslt = 1
  855. String arg_msg = ''
  856. uo_ljfieb_cus uo_ljc
  857. uo_ljc = Create uo_ljfieb_cus
  858. Long ll_row
  859. ll_row = dw_cus_user.GetRow()
  860. IF ll_row <= 0 THEN
  861. rslt = 0
  862. arg_msg = '请选择要删除的用户'
  863. GOTO ext
  864. END IF
  865. Long ll_repid
  866. ll_repid = dw_cus_user.Object.repid[ll_row]
  867. IF uo_ljc.uof_del_cust_rep(ll_repid,arg_msg,True) <> 1 THEN
  868. rslt = 0
  869. GOTO ext
  870. END IF
  871. ext:
  872. Destroy uo_ljc
  873. IF rslt = 1 THEN
  874. cb_retrievemx.TriggerEvent(Clicked!)
  875. MessageBox('系统提示',"删除成功")
  876. ELSE
  877. MessageBox("系统提示", arg_msg)
  878. END IF
  879. end event
  880. type cb_copy from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  881. integer x = 603
  882. integer width = 151
  883. integer height = 164
  884. integer taborder = 70
  885. boolean bringtotop = true
  886. string text = "复制"
  887. string normalpicname = "copy.bmp"
  888. integer picsize = 16
  889. toolbaralignment pic_align = alignattop!
  890. boolean border = false
  891. end type
  892. event clicked;call super::clicked;IF Not f_power_ind(1561) THEN
  893. MessageBox(publ_operator,'没有使用权限!')
  894. RETURN
  895. END IF
  896. Long ll_row
  897. ll_row = dw_cus_user.GetRow()
  898. IF ll_row <= 0 THEN
  899. MessageBox('系统提示',"请选择要复制的用户")
  900. RETURN
  901. END IF
  902. copy_repid = dw_cus_user.Object.repid[ll_row]
  903. String ls_loginname
  904. ls_loginname = dw_cus_user.Object.loginname[ll_row]
  905. MessageBox('系统提示',"复制用户["+String(ls_loginname)+"]权限成功")
  906. end event
  907. type cb_copy_p from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  908. integer x = 754
  909. integer width = 219
  910. integer height = 164
  911. integer taborder = 80
  912. boolean bringtotop = true
  913. string text = "批复制"
  914. string normalpicname = "paste.bmp"
  915. integer picsize = 16
  916. toolbaralignment pic_align = alignattop!
  917. boolean border = false
  918. end type
  919. event clicked;call super::clicked;IF Not f_power_ind(1561) THEN
  920. MessageBox(publ_operator,'没有使用权限!')
  921. RETURN
  922. END IF
  923. long ll_row
  924. ll_row = dw_cus_user.GetRow()
  925. if ll_row <= 0 then
  926. MessageBox("系统提示","当前客户没有可复制的用户")
  927. RETURN 0
  928. end if
  929. Long ll_cusid
  930. ll_cusid = dw_cus_user.Object.cusid[ll_row]
  931. openwithparm(w_cus_ecomm_edit_add_p, ll_cusid)
  932. end event
  933. type cb_reset from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  934. integer x = 974
  935. integer width = 274
  936. integer height = 164
  937. integer taborder = 90
  938. boolean bringtotop = true
  939. string text = "恢复密码"
  940. string normalpicname = "key.bmp"
  941. integer picsize = 16
  942. toolbaralignment pic_align = alignattop!
  943. boolean border = false
  944. end type
  945. event clicked;call super::clicked;IF Not f_power_ind(1561) THEN
  946. MessageBox(publ_operator,'没有使用权限!')
  947. RETURN
  948. END IF
  949. IF MessageBox("系统提示","是否确定要恢复当前用户密码?", Question!, YesNo!) = 2 THEN RETURN
  950. long ll_row
  951. ll_row = dw_cus_user.GetRow()
  952. if ll_row <= 0 then
  953. MessageBox("系统提示","请选择用户")
  954. RETURN
  955. end if
  956. int rslt = 1
  957. Long ll_repid
  958. String arg_msg
  959. uo_ljfieb_cus uo_ljc
  960. uo_ljc = Create uo_ljfieb_cus
  961. uo_ljfieb uo_fieb
  962. uo_fieb = Create uo_ljfieb
  963. uo_fieb.commit_transaction = sys_email_sqlca
  964. ll_repid = dw_cus_user.Object.repid[ll_row]
  965. IF uo_ljc.uof_reset_pwd(ll_repid,arg_msg,False) = 0 THEN
  966. rslt = 0
  967. goto ext
  968. END IF
  969. //发送电商数据库
  970. boolean lb_SetPwd = true
  971. Long ll_repid_arr[]
  972. ll_repid_arr[1] = ll_repid
  973. IF uo_fieb.send_cust_rep(0, ll_repid_arr, '', '', '', lb_SetPwd, arg_msg, False) = 0 THEN
  974. rslt = 0
  975. GOTO ext
  976. END IF
  977. ext:
  978. Destroy uo_ljc
  979. Destroy uo_fieb
  980. IF rslt = 0 THEN
  981. ROLLBACK Using sqlca;
  982. ROLLBACK Using sys_email_sqlca;
  983. MessageBox('系统提示',arg_msg)
  984. ELSE
  985. COMMIT Using sqlca;
  986. COMMIT Using sys_email_sqlca;
  987. MessageBox('系统提示',"恢复密码成功")
  988. END IF
  989. end event
  990. type cb_help from uo_imflatbutton within w_cus_ecomm_cus_rep_edit
  991. integer x = 1399
  992. integer width = 151
  993. integer height = 164
  994. integer taborder = 30
  995. boolean bringtotop = true
  996. string text = "帮助"
  997. string normalpicname = "help.bmp"
  998. integer picsize = 16
  999. toolbaralignment pic_align = alignattop!
  1000. boolean border = false
  1001. end type
  1002. event clicked;call super::clicked;PARENT.TriggerEvent('ue_help')
  1003. end event
  1004. type cb_view_all from commandbutton within w_cus_ecomm_cus_rep_edit
  1005. boolean visible = false
  1006. integer x = 1755
  1007. integer y = 80
  1008. integer width = 302
  1009. integer height = 84
  1010. integer taborder = 20
  1011. boolean bringtotop = true
  1012. integer textsize = -9
  1013. integer weight = 400
  1014. fontcharset fontcharset = gb2312charset!
  1015. fontpitch fontpitch = variable!
  1016. string facename = "宋体"
  1017. string text = "查看全部"
  1018. end type
  1019. event clicked;ins_cusid = -1
  1020. cb_view_all.Visible = false
  1021. cb_retrievemx.triggerevent(clicked!)
  1022. end event
  1023. type ln_bar from line within w_cus_ecomm_cus_rep_edit
  1024. long linecolor = 268435456
  1025. integer linethickness = 4
  1026. integer beginy = 172
  1027. integer endx = 2007
  1028. integer endy = 172
  1029. end type
  1030. type ln_bar2 from line within w_cus_ecomm_cus_rep_edit
  1031. long linecolor = 16777215
  1032. integer linethickness = 4
  1033. integer beginy = 176
  1034. integer endx = 2039
  1035. integer endy = 176
  1036. end type
  1037. type r_bar from rectangle within w_cus_ecomm_cus_rep_edit
  1038. long linecolor = 16777215
  1039. integer linethickness = 4
  1040. long fillcolor = 1073741824
  1041. integer x = 1147
  1042. integer y = 24
  1043. integer width = 146
  1044. integer height = 68
  1045. end type
  1046. event constructor;this.fillcolor = 14215660
  1047. this.linecolor = 14215660
  1048. this.x = -1
  1049. this.y = -1
  1050. this.height = ln_bar.beginy - 5
  1051. end event