w_cus_ecomm_edit_add_p.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. $PBExportHeader$w_cus_ecomm_edit_add_p.srw
  2. forward
  3. global type w_cus_ecomm_edit_add_p from w_publ_base
  4. end type
  5. type st_1 from statictext within w_cus_ecomm_edit_add_p
  6. end type
  7. type cb_save from uo_imflatbutton within w_cus_ecomm_edit_add_p
  8. end type
  9. type dw_cus from u_dw_rbtnfilter within w_cus_ecomm_edit_add_p
  10. end type
  11. type dw_add from u_dw_rbtnfilter within w_cus_ecomm_edit_add_p
  12. end type
  13. type cb_mx_ch from uo_imflatbutton within w_cus_ecomm_edit_add_p
  14. end type
  15. type cb_mx_del from uo_imflatbutton within w_cus_ecomm_edit_add_p
  16. end type
  17. type cb_1 from uo_imflatbutton within w_cus_ecomm_edit_add_p
  18. end type
  19. type cb_2 from uo_imflatbutton within w_cus_ecomm_edit_add_p
  20. end type
  21. type ln_bar from line within w_cus_ecomm_edit_add_p
  22. end type
  23. type ln_bar2 from line within w_cus_ecomm_edit_add_p
  24. end type
  25. type r_bar from rectangle within w_cus_ecomm_edit_add_p
  26. end type
  27. end forward
  28. global type w_cus_ecomm_edit_add_p from w_publ_base
  29. integer width = 3611
  30. integer height = 2380
  31. string title = "电子商务用户批复制"
  32. boolean minbox = false
  33. windowtype windowtype = response!
  34. st_1 st_1
  35. cb_save cb_save
  36. dw_cus dw_cus
  37. dw_add dw_add
  38. cb_mx_ch cb_mx_ch
  39. cb_mx_del cb_mx_del
  40. cb_1 cb_1
  41. cb_2 cb_2
  42. ln_bar ln_bar
  43. ln_bar2 ln_bar2
  44. r_bar r_bar
  45. end type
  46. global w_cus_ecomm_edit_add_p w_cus_ecomm_edit_add_p
  47. type variables
  48. long cur_repid
  49. long cur_cusid
  50. datastore ds
  51. end variables
  52. forward prototypes
  53. public function integer wf_save ()
  54. end prototypes
  55. public function integer wf_save ();Int rslt = 1
  56. Long li_row
  57. String arg_msg
  58. uo_ljfieb_cus uo_ljc
  59. uo_ljc = Create uo_ljfieb_cus
  60. uo_ljfieb uo_fieb
  61. uo_fieb = Create uo_ljfieb
  62. uo_fieb.commit_transaction = sys_email_sqlca
  63. dw_add.AcceptText()
  64. li_row = dw_add.RowCount()
  65. IF li_row <= 0 THEN
  66. arg_msg = '没有保存内容'
  67. rslt = 0
  68. GOTO ext
  69. END IF
  70. s_cus_rep_ljfieb s_rep
  71. String ls_Permissions
  72. Long ll_orirepid
  73. Long ll_repid_arr[]
  74. Long ll_cnt
  75. FOR li_row = 1 To dw_add.RowCount()
  76. IF Trim(dw_add.Object.loginname[li_row]) = "" THEN CONTINUE
  77. ll_orirepid = dw_add.Object.orirepid[li_row]
  78. SELECT Permissions
  79. INTO :ls_Permissions
  80. FROM ros_cust_rep
  81. Where repid = :ll_orirepid;
  82. IF sqlca.SQLCode <> 0 THEN
  83. arg_msg = "行:"+String(li_row)+", 查询复制用户信息失败,"+sqlca.SQLErrText
  84. rslt = 0
  85. GOTO ext
  86. END IF
  87. s_rep.repid = dw_add.Object.repid[li_row]
  88. s_rep.cusid = dw_add.Object.cusid[li_row]
  89. s_rep.loginname = Trim(dw_add.Object.loginname[li_row])
  90. s_rep.repname = Trim(dw_add.Object.repname[li_row])
  91. s_rep.deptname = Trim(dw_add.Object.deptname[li_row])
  92. s_rep.duty = Trim(dw_add.Object.duty[li_row])
  93. s_rep.sex = Trim(dw_add.Object.sex[li_row])
  94. s_rep.officetel = Trim(dw_add.Object.officetel[li_row])
  95. s_rep.handtel = Trim(dw_add.Object.handtel[li_row])
  96. s_rep.faxno = Trim(dw_add.Object.faxno[li_row])
  97. s_rep.email = Trim(dw_add.Object.email[li_row])
  98. s_rep.interest = Trim(dw_add.Object.interest[li_row])
  99. s_rep.mainproduct = Trim(dw_add.Object.mainproduct[li_row])
  100. s_rep.qqcode = Trim(dw_add.Object.qqcode[li_row])
  101. s_rep.msncode = Trim(dw_add.Object.msncode[li_row])
  102. s_rep.dscrp = Trim(dw_add.Object.dscrp[li_row])
  103. s_rep.Address = Trim(dw_add.Object.Address[li_row])
  104. s_rep.Permissions = ls_Permissions
  105. s_rep.reptype = 2 //1-供应商; 2-客户;
  106. s_rep.ljemail = Trim(dw_add.Object.ljemail[li_row])
  107. IF uo_ljc.uof_add_cust_rep(s_rep,arg_msg,False) = 0 THEN
  108. arg_msg = "行:"+String(li_row)+","+arg_msg
  109. rslt = 0
  110. GOTO ext
  111. END IF
  112. ll_cnt++
  113. ll_repid_arr[ll_cnt] = uo_ljc.uo_repid
  114. NEXT
  115. IF uo_fieb.send_cust_rep(0, ll_repid_arr, '', '', '', True, arg_msg, False) = 0 THEN
  116. rslt = 0
  117. GOTO ext
  118. END IF
  119. ext:
  120. Destroy uo_ljc
  121. Destroy uo_fieb
  122. IF rslt = 0 THEN
  123. ROLLBACK Using sqlca;
  124. ROLLBACK Using sys_email_sqlca;
  125. MessageBox('系统提示',arg_msg)
  126. ELSE
  127. COMMIT Using sqlca;
  128. COMMIT Using sys_email_sqlca;
  129. MessageBox('系统提示',"批复制用户成功")
  130. END IF
  131. RETURN rslt
  132. end function
  133. on w_cus_ecomm_edit_add_p.create
  134. int iCurrent
  135. call super::create
  136. this.st_1=create st_1
  137. this.cb_save=create cb_save
  138. this.dw_cus=create dw_cus
  139. this.dw_add=create dw_add
  140. this.cb_mx_ch=create cb_mx_ch
  141. this.cb_mx_del=create cb_mx_del
  142. this.cb_1=create cb_1
  143. this.cb_2=create cb_2
  144. this.ln_bar=create ln_bar
  145. this.ln_bar2=create ln_bar2
  146. this.r_bar=create r_bar
  147. iCurrent=UpperBound(this.Control)
  148. this.Control[iCurrent+1]=this.st_1
  149. this.Control[iCurrent+2]=this.cb_save
  150. this.Control[iCurrent+3]=this.dw_cus
  151. this.Control[iCurrent+4]=this.dw_add
  152. this.Control[iCurrent+5]=this.cb_mx_ch
  153. this.Control[iCurrent+6]=this.cb_mx_del
  154. this.Control[iCurrent+7]=this.cb_1
  155. this.Control[iCurrent+8]=this.cb_2
  156. this.Control[iCurrent+9]=this.ln_bar
  157. this.Control[iCurrent+10]=this.ln_bar2
  158. this.Control[iCurrent+11]=this.r_bar
  159. end on
  160. on w_cus_ecomm_edit_add_p.destroy
  161. call super::destroy
  162. destroy(this.st_1)
  163. destroy(this.cb_save)
  164. destroy(this.dw_cus)
  165. destroy(this.dw_add)
  166. destroy(this.cb_mx_ch)
  167. destroy(this.cb_mx_del)
  168. destroy(this.cb_1)
  169. destroy(this.cb_2)
  170. destroy(this.ln_bar)
  171. destroy(this.ln_bar2)
  172. destroy(this.r_bar)
  173. end on
  174. event open;call super::open;cur_cusid = Message.DoubleParm
  175. dw_cus.Retrieve(cur_cusid)
  176. ds = Create datastore
  177. ds.DataObject = "dw_cust_ecomm_cus_rep"
  178. ds.SetTransObject(sqlca)
  179. ds.Retrieve(cur_cusid)
  180. Long i
  181. FOR i = 1 To 18
  182. dw_add.SetTabOrder(i, i * 10)
  183. NEXT
  184. end event
  185. event close;call super::close;//closewithreturn(this,s_return)
  186. end event
  187. event resize;call super::resize;ln_bar.endx = this.width
  188. ln_bar2.endx = this.width
  189. r_bar.width = this.width
  190. dw_cus.width = this.width - dw_cus.x - 40
  191. dw_add.width = this.width - dw_add.x - 40
  192. dw_add.height = this.height - dw_add.y - 140
  193. end event
  194. event ue_before_open;call super::ue_before_open;dw_cus.SetTransObject(sqlca)
  195. dw_add.SetTransObject(sqlca)
  196. end event
  197. type cb_func from w_publ_base`cb_func within w_cus_ecomm_edit_add_p
  198. boolean visible = false
  199. integer taborder = 30
  200. end type
  201. type cb_exit from w_publ_base`cb_exit within w_cus_ecomm_edit_add_p
  202. integer x = 151
  203. integer width = 151
  204. integer height = 164
  205. integer picsize = 16
  206. toolbaralignment pic_align = alignattop!
  207. boolean border = false
  208. end type
  209. type st_1 from statictext within w_cus_ecomm_edit_add_p
  210. boolean visible = false
  211. integer y = 32
  212. integer width = 160
  213. integer height = 48
  214. boolean bringtotop = true
  215. integer textsize = -9
  216. integer weight = 400
  217. fontcharset fontcharset = gb2312charset!
  218. fontpitch fontpitch = variable!
  219. string facename = "宋体"
  220. long textcolor = 33554432
  221. long backcolor = 134217739
  222. string text = "摘要"
  223. alignment alignment = right!
  224. boolean focusrectangle = false
  225. end type
  226. type cb_save from uo_imflatbutton within w_cus_ecomm_edit_add_p
  227. integer width = 151
  228. integer height = 164
  229. integer taborder = 50
  230. boolean bringtotop = true
  231. string text = "保存"
  232. string normalpicname = "save.bmp"
  233. integer picsize = 16
  234. toolbaralignment pic_align = alignattop!
  235. boolean border = false
  236. end type
  237. event clicked;call super::clicked;IF wf_save() = 1 THEN
  238. Close(Parent)
  239. END IF
  240. end event
  241. type dw_cus from u_dw_rbtnfilter within w_cus_ecomm_edit_add_p
  242. integer y = 188
  243. integer width = 1495
  244. integer height = 644
  245. integer taborder = 70
  246. boolean bringtotop = true
  247. string title = "客户资料"
  248. string dataobject = "dw_cust_ecomm_edit_add_p"
  249. boolean maxbox = true
  250. boolean hscrollbar = true
  251. boolean vscrollbar = true
  252. boolean resizable = true
  253. boolean hsplitscroll = true
  254. borderstyle borderstyle = stylebox!
  255. boolean titleclick_sort_use = true
  256. end type
  257. event clicked;IF row > 0 THEN
  258. This.SetRow(row)
  259. This.SelectRow(row,Not This.IsSelected(row))
  260. END IF
  261. end event
  262. event constructor;call super::constructor;
  263. RBUTTON_FILTER_USE=true //右键查询功能开关
  264. end event
  265. type dw_add from u_dw_rbtnfilter within w_cus_ecomm_edit_add_p
  266. integer y = 976
  267. integer width = 1495
  268. integer height = 644
  269. integer taborder = 80
  270. boolean bringtotop = true
  271. string title = "客户资料"
  272. string dataobject = "dw_cust_ecomm_edit_add_p_rep"
  273. boolean maxbox = true
  274. boolean hscrollbar = true
  275. boolean vscrollbar = true
  276. boolean resizable = true
  277. boolean hsplitscroll = true
  278. borderstyle borderstyle = stylebox!
  279. boolean titleclick_sort_use = true
  280. end type
  281. event clicked;IF row > 0 THEN
  282. This.SetRow(row)
  283. This.SelectRow(0,False)
  284. This.SelectRow(row,True)
  285. END IF
  286. end event
  287. event constructor;call super::constructor;
  288. RBUTTON_FILTER_USE=true //右键查询功能开关
  289. end event
  290. event doubleclicked;call super::doubleclicked;//IF Not dw_edit_mode THEN RETURN
  291. //
  292. //Long ll_row
  293. //
  294. //ll_row = dw_cus.GetRow()
  295. //
  296. //IF ll_row <= 0 THEN RETURN
  297. //
  298. //OpenWithParm(w_cuscomm_list_ch,2)
  299. //
  300. //s_cuscomm_ljfieb INS_RT_STRU
  301. //
  302. //INS_RT_STRU = Message.PowerObjectParm
  303. //
  304. //dw_cus.Object.ifecomm[ll_row] = 1
  305. //dw_cus.Object.commcode[ll_row] = INS_RT_STRU.CusCode
  306. //
  307. //
  308. //dw_cus.accepttext()
  309. //
  310. //
  311. end event
  312. event rowfocuschanged;IF currentrow <=0 THEN RETURN
  313. this.selectrow(0,false)
  314. this.selectrow(currentrow,true)
  315. end event
  316. event dwnkey;call super::dwnkey;parent.triggerevent('user_key')
  317. end event
  318. type cb_mx_ch from uo_imflatbutton within w_cus_ecomm_edit_add_p
  319. integer y = 856
  320. integer taborder = 230
  321. boolean bringtotop = true
  322. string text = "↓ 选择"
  323. end type
  324. event clicked;call super::clicked;Long i, j, ll_row
  325. Long ll_cusid, ll_repid
  326. String ls_cuscode, ls_cusname
  327. FOR i = 1 To dw_cus.RowCount()
  328. IF dw_cus.IsSelected(i) THEN
  329. ll_cusid = dw_cus.Object.cusid[i]
  330. ls_cuscode = dw_cus.Object.cuscode[i]
  331. ls_cusname = dw_cus.Object.Name[i]
  332. FOR j = 1 To ds.RowCount()
  333. ll_repid = ds.Object.repid[j]
  334. ll_row = dw_add.Find("cusid = "+String(ll_cusid)+" and orirepid = "+ String(ll_repid), 1, dw_add.RowCount())
  335. IF ll_row > 0 THEN CONTINUE
  336. ll_row = dw_add.InsertRow(0)
  337. dw_add.Object.orirepid[ll_row] = ll_repid
  338. dw_add.Object.orirepname[ll_row] = ds.Object.repname[j]
  339. dw_add.Object.oriloginname[ll_row] = ds.Object.loginname[j]
  340. dw_add.Object.cusid[ll_row] = ll_cusid
  341. dw_add.Object.cuscode[ll_row] = ls_cuscode
  342. dw_add.Object.cusname[ll_row] = ls_cusname
  343. NEXT
  344. END IF
  345. NEXT
  346. end event
  347. type cb_mx_del from uo_imflatbutton within w_cus_ecomm_edit_add_p
  348. integer x = 311
  349. integer y = 856
  350. integer width = 357
  351. integer taborder = 240
  352. boolean bringtotop = true
  353. string text = "↑ 删除选择"
  354. end type
  355. event clicked;call super::clicked;IF dw_add.GetRow() = 0 THEN
  356. MessageBox('NO','请选择删除的行对象!')
  357. RETURN
  358. END IF
  359. IF MessageBox("确定", "是否确定删除当前行?", Question!, YesNo!) = 2 THEN RETURN
  360. dw_add.DeleteRow (0)
  361. dw_add.TriggerEvent (RowFocusChanged!)
  362. end event
  363. type cb_1 from uo_imflatbutton within w_cus_ecomm_edit_add_p
  364. integer x = 677
  365. integer y = 856
  366. integer taborder = 240
  367. boolean bringtotop = true
  368. string text = "全选"
  369. end type
  370. event clicked;call super::clicked;dw_cus.SelectRow(0, true)
  371. end event
  372. type cb_2 from uo_imflatbutton within w_cus_ecomm_edit_add_p
  373. integer x = 987
  374. integer y = 856
  375. integer taborder = 250
  376. boolean bringtotop = true
  377. string text = "反选"
  378. end type
  379. event clicked;call super::clicked;long i
  380. for i = 1 to dw_cus.rowcount()
  381. dw_cus.SelectRow(i, not dw_cus.IsSelected(i))
  382. next
  383. end event
  384. type ln_bar from line within w_cus_ecomm_edit_add_p
  385. long linecolor = 268435456
  386. integer linethickness = 4
  387. integer beginy = 172
  388. integer endx = 2007
  389. integer endy = 172
  390. end type
  391. type ln_bar2 from line within w_cus_ecomm_edit_add_p
  392. long linecolor = 16777215
  393. integer linethickness = 4
  394. integer beginy = 176
  395. integer endx = 2039
  396. integer endy = 176
  397. end type
  398. type r_bar from rectangle within w_cus_ecomm_edit_add_p
  399. long linecolor = 16777215
  400. integer linethickness = 4
  401. long fillcolor = 1073741824
  402. integer x = 1531
  403. integer width = 146
  404. integer height = 68
  405. end type
  406. event constructor;this.fillcolor = 14215660
  407. this.linecolor = 14215660
  408. this.x = -1
  409. this.y = -1
  410. this.height = ln_bar.beginy - 5
  411. end event