w_aifmb_querycom2.srw 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. $PBExportHeader$w_aifmb_querycom2.srw
  2. forward
  3. global type w_aifmb_querycom2 from window
  4. end type
  5. type cb_5 from commandbutton within w_aifmb_querycom2
  6. end type
  7. type cb_4 from commandbutton within w_aifmb_querycom2
  8. end type
  9. type em_2 from editmask within w_aifmb_querycom2
  10. end type
  11. type cb_3 from commandbutton within w_aifmb_querycom2
  12. end type
  13. type em_1 from editmask within w_aifmb_querycom2
  14. end type
  15. type cb_2 from commandbutton within w_aifmb_querycom2
  16. end type
  17. type cb_addcusspt from commandbutton within w_aifmb_querycom2
  18. end type
  19. type cb_addspt from commandbutton within w_aifmb_querycom2
  20. end type
  21. type cb_addcus from commandbutton within w_aifmb_querycom2
  22. end type
  23. type cb_1 from commandbutton within w_aifmb_querycom2
  24. end type
  25. type dw_1 from u_dw_rbtnfilter within w_aifmb_querycom2
  26. end type
  27. end forward
  28. global type w_aifmb_querycom2 from window
  29. integer width = 3351
  30. integer height = 1968
  31. windowtype windowtype = child!
  32. long backcolor = 67108864
  33. string icon = "AppIcon!"
  34. boolean center = true
  35. event ue_search ( )
  36. cb_5 cb_5
  37. cb_4 cb_4
  38. em_2 em_2
  39. cb_3 cb_3
  40. em_1 em_1
  41. cb_2 cb_2
  42. cb_addcusspt cb_addcusspt
  43. cb_addspt cb_addspt
  44. cb_addcus cb_addcus
  45. cb_1 cb_1
  46. dw_1 dw_1
  47. end type
  48. global w_aifmb_querycom2 w_aifmb_querycom2
  49. forward prototypes
  50. public function integer wf_retrieve_type (ref string arg_msg)
  51. end prototypes
  52. event ue_search();DataStore ds_productcode
  53. uo_aifmb lo_aifmb
  54. ds_productcode = Create DataStore
  55. lo_aifmb = Create uo_aifmb
  56. Int rslt = 1
  57. String arg_msg
  58. ds_productcode.DataObject = dw_1.DataObject
  59. Long pageindex = 0
  60. Long pagesize = 0
  61. pageindex = Long(em_1.Text)
  62. IF pageindex <= 0 THEN
  63. em_1.Text = '1'
  64. pageindex = 1
  65. END IF
  66. pagesize = Long(em_2.Text)
  67. IF pagesize <= 0 THEN
  68. em_2.Text = '10'
  69. pagesize = 10
  70. END IF
  71. IF lo_aifmb.uf_getlinkedentlist(ds_productcode, pageindex, pagesize, arg_msg) <> 1 THEN
  72. rslt = 0
  73. GOTO ext
  74. END IF
  75. dw_1.Reset()
  76. ds_productcode.RowsCopy(1, ds_productcode.RowCount(), Primary!, dw_1, 1, Primary!)
  77. IF wf_retrieve_type(arg_msg) <> 1 THEN
  78. rslt = 0
  79. GOTO ext
  80. END IF
  81. ext:
  82. Destroy ds_productcode
  83. Destroy lo_aifmb
  84. IF rslt = 0 THEN
  85. MessageBox('ERROR', arg_msg)
  86. END IF
  87. end event
  88. public function integer wf_retrieve_type (ref string arg_msg);Int rslt = 1
  89. String ls_CusID
  90. Long ll_custype
  91. String ls_cuscode
  92. String ls_cusname
  93. Long i
  94. FOR i = 1 To dw_1.RowCount()
  95. ls_CusID = dw_1.Object.CusID[i]
  96. IF IsNull(ls_CusID) THEN CONTINUE
  97. IF ls_CusID = '' THEN CONTINUE
  98. SELECT top 1 custype, cuscode, cusname
  99. INTO :ll_custype, :ls_cuscode, :ls_cusname
  100. FROM LJFIEB_CusComm
  101. WHERE CusID = :ls_CusID
  102. Using sys_email_sqlca;
  103. IF sys_email_sqlca.SQLCode <> 0 THEN CONTINUE
  104. dw_1.Object.custype[i] = ll_custype
  105. dw_1.Object.cuscode[i] = ls_cuscode
  106. dw_1.Object.cusname[i] = ls_cusname
  107. NEXT
  108. RETURN rslt
  109. end function
  110. on w_aifmb_querycom2.create
  111. this.cb_5=create cb_5
  112. this.cb_4=create cb_4
  113. this.em_2=create em_2
  114. this.cb_3=create cb_3
  115. this.em_1=create em_1
  116. this.cb_2=create cb_2
  117. this.cb_addcusspt=create cb_addcusspt
  118. this.cb_addspt=create cb_addspt
  119. this.cb_addcus=create cb_addcus
  120. this.cb_1=create cb_1
  121. this.dw_1=create dw_1
  122. this.Control[]={this.cb_5,&
  123. this.cb_4,&
  124. this.em_2,&
  125. this.cb_3,&
  126. this.em_1,&
  127. this.cb_2,&
  128. this.cb_addcusspt,&
  129. this.cb_addspt,&
  130. this.cb_addcus,&
  131. this.cb_1,&
  132. this.dw_1}
  133. end on
  134. on w_aifmb_querycom2.destroy
  135. destroy(this.cb_5)
  136. destroy(this.cb_4)
  137. destroy(this.em_2)
  138. destroy(this.cb_3)
  139. destroy(this.em_1)
  140. destroy(this.cb_2)
  141. destroy(this.cb_addcusspt)
  142. destroy(this.cb_addspt)
  143. destroy(this.cb_addcus)
  144. destroy(this.cb_1)
  145. destroy(this.dw_1)
  146. end on
  147. event resize;
  148. dw_1.Width = This.WorkSpaceWidth() - dw_1.X
  149. dw_1.Height = This.WorkSpaceHeight() - dw_1.Y
  150. end event
  151. type cb_5 from commandbutton within w_aifmb_querycom2
  152. integer x = 2816
  153. integer y = 40
  154. integer width = 274
  155. integer height = 84
  156. integer taborder = 20
  157. integer textsize = -9
  158. integer weight = 400
  159. fontcharset fontcharset = gb2312charset!
  160. fontpitch fontpitch = variable!
  161. string facename = "宋体"
  162. string text = "消息记录"
  163. end type
  164. event clicked;open(w_aifmb_addcuscomm_request2)
  165. end event
  166. type cb_4 from commandbutton within w_aifmb_querycom2
  167. integer x = 2409
  168. integer y = 40
  169. integer width = 274
  170. integer height = 84
  171. integer taborder = 10
  172. integer textsize = -9
  173. integer weight = 400
  174. fontcharset fontcharset = gb2312charset!
  175. fontpitch fontpitch = variable!
  176. string facename = "宋体"
  177. string text = "发消息"
  178. end type
  179. event clicked;Long i, j = 0, row = 0
  180. FOR i = 1 To dw_1.RowCount()
  181. IF dw_1.Object.ch[i] = 1 THEN
  182. j = i
  183. EXIT
  184. END IF
  185. NEXT
  186. Long arr_entids[]
  187. Long k = 0
  188. IF j <= 0 THEN
  189. row = dw_1.GetRow()
  190. IF row <= 0 THEN
  191. MessageBox('提示', '请选择对象')
  192. RETURN
  193. END IF
  194. k++
  195. arr_entids[k] = dw_1.Object.UserID[row]
  196. ELSE
  197. FOR i = j To dw_1.RowCount()
  198. IF dw_1.Object.ch[i] = 1 THEN
  199. k++
  200. arr_entids[k] = dw_1.Object.UserID[i]
  201. END IF
  202. NEXT
  203. END IF
  204. Open(w_aifmb_linkmsg)
  205. s_aifmb_linkmsg s_rslt
  206. s_rslt = Message.PowerObjectParm
  207. IF s_rslt.ifok = 0 THEN
  208. RETURN
  209. END IF
  210. Int rslt = 1
  211. String arg_msg = ''
  212. uo_aifmb lo_aifmb
  213. lo_aifmb = Create uo_aifmb
  214. IF lo_aifmb.uf_setentlinkmsg(arr_entids, s_rslt.msgcontent, s_rslt.linkstring, arg_msg) <> 1 THEN
  215. rslt = 0
  216. GOTO ext
  217. END IF
  218. ext:
  219. Destroy lo_aifmb
  220. IF rslt = 0 THEN
  221. MessageBox('ERROR', arg_msg)
  222. ELSE
  223. MessageBox('提示', '发送成功')
  224. END IF
  225. end event
  226. type em_2 from editmask within w_aifmb_querycom2
  227. integer x = 946
  228. integer y = 40
  229. integer width = 165
  230. integer height = 84
  231. integer taborder = 90
  232. integer textsize = -9
  233. integer weight = 400
  234. fontcharset fontcharset = gb2312charset!
  235. fontpitch fontpitch = variable!
  236. string facename = "宋体"
  237. long textcolor = 33554432
  238. string text = "10"
  239. alignment alignment = right!
  240. borderstyle borderstyle = stylelowered!
  241. string mask = "#,##0"
  242. end type
  243. type cb_3 from commandbutton within w_aifmb_querycom2
  244. integer x = 681
  245. integer y = 40
  246. integer width = 242
  247. integer height = 84
  248. integer taborder = 80
  249. integer textsize = -9
  250. integer weight = 400
  251. fontcharset fontcharset = gb2312charset!
  252. fontpitch fontpitch = variable!
  253. string facename = "宋体"
  254. string text = "下一页"
  255. end type
  256. event clicked;long pageindex
  257. pageindex = long(em_1.Text)
  258. pageindex += 1
  259. em_1.Text = string(pageindex)
  260. parent.triggerevent('ue_search')
  261. end event
  262. type em_1 from editmask within w_aifmb_querycom2
  263. integer x = 517
  264. integer y = 40
  265. integer width = 165
  266. integer height = 84
  267. integer taborder = 70
  268. integer textsize = -9
  269. integer weight = 400
  270. fontcharset fontcharset = gb2312charset!
  271. fontpitch fontpitch = variable!
  272. string facename = "宋体"
  273. long textcolor = 33554432
  274. string text = "1"
  275. alignment alignment = right!
  276. borderstyle borderstyle = stylelowered!
  277. string mask = "#,##0"
  278. end type
  279. type cb_2 from commandbutton within w_aifmb_querycom2
  280. integer x = 274
  281. integer y = 40
  282. integer width = 242
  283. integer height = 84
  284. integer taborder = 60
  285. integer textsize = -9
  286. integer weight = 400
  287. fontcharset fontcharset = gb2312charset!
  288. fontpitch fontpitch = variable!
  289. string facename = "宋体"
  290. string text = "上一页"
  291. end type
  292. event clicked;long pageindex
  293. pageindex = long(em_1.Text)
  294. pageindex -= 1
  295. em_1.Text = string(pageindex)
  296. parent.triggerevent('ue_search')
  297. end event
  298. type cb_addcusspt from commandbutton within w_aifmb_querycom2
  299. integer x = 1856
  300. integer y = 40
  301. integer width = 439
  302. integer height = 84
  303. integer taborder = 50
  304. integer textsize = -9
  305. integer weight = 400
  306. fontcharset fontcharset = gb2312charset!
  307. fontpitch fontpitch = variable!
  308. string facename = "宋体"
  309. string text = "加为客户供应商"
  310. end type
  311. event clicked;Long ll_row
  312. ll_row = dw_1.GetRow()
  313. IF ll_row <= 0 THEN
  314. MessageBox('提示', '请选择添加对象')
  315. RETURN
  316. END IF
  317. s_aifmb_addcuscomm s_parm
  318. s_parm.cusid = dw_1.Object.cusid[ll_row]
  319. s_parm.cuscode = dw_1.Object.usercode[ll_row]
  320. s_parm.cusname = dw_1.Object.username[ll_row]
  321. s_parm.lb_readonly = False
  322. s_parm.custype = 3
  323. IF s_parm.cusid = '' THEN
  324. MessageBox('提示', '对方唯一码为空不能添加')
  325. RETURN
  326. END IF
  327. IF s_parm.cusid = '00000000-0000-0000-0000-000000000000' THEN
  328. MessageBox('提示', '对方唯一码为零不能添加')
  329. RETURN
  330. END IF
  331. //查询是否已经绑定客户
  332. Long ll_cnt
  333. SELECT COUNT(0)
  334. INTO :ll_cnt
  335. FROM LJFIEB_CusComm
  336. WHERE CusID = :s_parm.cusid
  337. Using sys_email_sqlca;
  338. IF sys_email_sqlca.SQLCode <> 0 THEN
  339. MessageBox('提示', '查询企业是否有本地信息失败,' + sys_email_sqlca.SQLErrText)
  340. RETURN
  341. END IF
  342. String ls_cuscode
  343. String ls_cusname
  344. IF ll_cnt > 0 THEN
  345. SELECT top 1 cuscode, cusname
  346. INTO :ls_cuscode, :ls_cusname
  347. FROM LJFIEB_CusComm
  348. WHERE CusID = :s_parm.cusid
  349. Using sys_email_sqlca;
  350. IF sys_email_sqlca.SQLCode <> 0 THEN
  351. MessageBox('提示', '查询本地企业信息失败,' + sys_email_sqlca.SQLErrText)
  352. RETURN
  353. END IF
  354. s_parm.cuscode = ls_cuscode
  355. s_parm.cusname = ls_cusname
  356. s_parm.lb_readonly = True
  357. SELECT COUNT(0)
  358. INTO :ll_cnt
  359. FROM u_cust
  360. Where commcode = :ls_cuscode;
  361. IF sqlca.SQLCode <> 0 THEN
  362. MessageBox('提示', '查询已绑定客户个数失败,' + sys_email_sqlca.SQLErrText)
  363. RETURN
  364. END IF
  365. IF ll_cnt > 0 THEN
  366. IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个客户,是否继续?', Question!, YesNo!, 1) <> 1 THEN
  367. RETURN
  368. END IF
  369. END IF
  370. SELECT COUNT(0)
  371. INTO :ll_cnt
  372. FROM u_spt
  373. Where commcode = :ls_cuscode;
  374. IF sqlca.SQLCode <> 0 THEN
  375. MessageBox('提示', '查询已绑定供应商个数失败,' + sys_email_sqlca.SQLErrText)
  376. RETURN
  377. END IF
  378. IF ll_cnt > 0 THEN
  379. IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个供应商,是否继续?', Question!, YesNo!, 1) <> 1 THEN
  380. RETURN
  381. END IF
  382. END IF
  383. END IF
  384. s_custom s_cust
  385. s_cust.cuscode = dw_1.Object.usercode[ll_row]
  386. s_cust.Name = dw_1.Object.username[ll_row]
  387. s_cust.tele = dw_1.Object.tele[ll_row]
  388. s_cust.tele1 = dw_1.Object.phone[ll_row]
  389. s_cust.Address = dw_1.Object.Address[ll_row]
  390. s_cust.email = dw_1.Object.email[ll_row]
  391. s_cust.dscrp = dw_1.Object.dscrp[ll_row]
  392. s_edit_index_tran s_tran
  393. s_tran.if_retrieve_all = False //是否一次RETRIEVE所有行
  394. s_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  395. s_tran.arg_pkid = 0 //目标定位PKID (备用)
  396. s_tran.e_long = 1
  397. s_tran.a_any = s_cust
  398. OpenWithParm(w_cust_edit, s_tran)
  399. s_custom S_INSCUST
  400. S_INSCUST = Message.PowerObjectParm //接受返回结构
  401. IF S_INSCUST.cusid <= 0 THEN RETURN
  402. s_parm.ll_cusid = S_INSCUST.cusid
  403. s_parm.ls_cuscode = S_INSCUST.cuscode
  404. s_parm.ls_cusname = S_INSCUST.Name
  405. s_spt s_spt_tran
  406. s_spt_tran.sptcode = dw_1.Object.usercode[ll_row]
  407. s_spt_tran.Name = dw_1.Object.username[ll_row]
  408. s_spt_tran.tele = dw_1.Object.tele[ll_row]
  409. s_spt_tran.tele1 = dw_1.Object.phone[ll_row]
  410. s_spt_tran.Address = dw_1.Object.Address[ll_row]
  411. s_spt_tran.email = dw_1.Object.email[ll_row]
  412. s_spt_tran.dscrp = dw_1.Object.dscrp[ll_row]
  413. s_edit_index_tran s_tran_spt
  414. s_tran_spt.if_retrieve_all = False //是否一次RETRIEVE所有行
  415. s_tran_spt.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  416. s_tran_spt.arg_pkid = 0 //目标定位PKID (备用)
  417. s_tran_spt.e_long = 1
  418. s_tran_spt.a_any = s_spt_tran
  419. OpenWithParm(w_spt_edit, s_tran_spt)
  420. s_spt S_INSSPT
  421. S_INSSPT = Message.PowerObjectParm //接受返回结构
  422. IF S_INSSPT.sptid <= 0 THEN RETURN
  423. s_parm.ll_sptid = S_INSSPT.sptid
  424. s_parm.ls_sptcode = S_INSSPT.sptcode
  425. s_parm.ls_sptname = S_INSSPT.Name
  426. OpenWithParm(w_aifmb_addcuscomm,s_parm)
  427. end event
  428. type cb_addspt from commandbutton within w_aifmb_querycom2
  429. integer x = 1513
  430. integer y = 40
  431. integer width = 329
  432. integer height = 84
  433. integer taborder = 50
  434. integer textsize = -9
  435. integer weight = 400
  436. fontcharset fontcharset = gb2312charset!
  437. fontpitch fontpitch = variable!
  438. string facename = "宋体"
  439. string text = "加为供应商"
  440. end type
  441. event clicked;Long ll_row
  442. ll_row = dw_1.GetRow()
  443. IF ll_row <= 0 THEN
  444. MessageBox('提示', '请选择添加对象')
  445. RETURN
  446. END IF
  447. s_aifmb_addcuscomm s_parm
  448. s_parm.cusid = dw_1.Object.cusid[ll_row]
  449. s_parm.cuscode = dw_1.Object.usercode[ll_row]
  450. s_parm.cusname = dw_1.Object.username[ll_row]
  451. s_parm.lb_readonly = False
  452. s_parm.custype = 1
  453. IF s_parm.cusid = '' THEN
  454. MessageBox('提示', '对方唯一码为空不能添加')
  455. RETURN
  456. END IF
  457. IF s_parm.cusid = '00000000-0000-0000-0000-000000000000' THEN
  458. MessageBox('提示', '对方唯一码为零不能添加')
  459. RETURN
  460. END IF
  461. //查询是否已经绑定客户
  462. Long ll_cnt
  463. SELECT COUNT(0)
  464. INTO :ll_cnt
  465. FROM LJFIEB_CusComm
  466. WHERE CusID = :s_parm.cusid
  467. Using sys_email_sqlca;
  468. IF sys_email_sqlca.SQLCode <> 0 THEN
  469. MessageBox('提示', '查询企业是否有本地信息失败,' + sys_email_sqlca.SQLErrText)
  470. RETURN
  471. END IF
  472. String ls_cuscode
  473. String ls_cusname
  474. IF ll_cnt > 0 THEN
  475. SELECT top 1 cuscode, cusname
  476. INTO :ls_cuscode, :ls_cusname
  477. FROM LJFIEB_CusComm
  478. WHERE CusID = :s_parm.cusid
  479. Using sys_email_sqlca;
  480. IF sys_email_sqlca.SQLCode <> 0 THEN
  481. MessageBox('提示', '查询本地企业信息失败,' + sys_email_sqlca.SQLErrText)
  482. RETURN
  483. END IF
  484. s_parm.cuscode = ls_cuscode
  485. s_parm.cusname = ls_cusname
  486. s_parm.lb_readonly = True
  487. SELECT COUNT(0)
  488. INTO :ll_cnt
  489. FROM u_spt
  490. Where commcode = :ls_cuscode;
  491. IF sqlca.SQLCode <> 0 THEN
  492. MessageBox('提示', '查询已绑定供应商个数失败,' + sys_email_sqlca.SQLErrText)
  493. RETURN
  494. END IF
  495. IF ll_cnt > 0 THEN
  496. IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个供应商,是否继续?', Question!, YesNo!, 1) <> 1 THEN
  497. RETURN
  498. END IF
  499. END IF
  500. END IF
  501. s_spt s_spt_tran
  502. s_spt_tran.sptcode = dw_1.Object.usercode[ll_row]
  503. s_spt_tran.Name = dw_1.Object.username[ll_row]
  504. s_spt_tran.tele = dw_1.Object.tele[ll_row]
  505. s_spt_tran.tele1 = dw_1.Object.phone[ll_row]
  506. s_spt_tran.Address = dw_1.Object.Address[ll_row]
  507. s_spt_tran.email = dw_1.Object.email[ll_row]
  508. s_spt_tran.dscrp = dw_1.Object.dscrp[ll_row]
  509. s_edit_index_tran s_tran_spt
  510. s_tran_spt.if_retrieve_all = False //是否一次RETRIEVE所有行
  511. s_tran_spt.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  512. s_tran_spt.arg_pkid = 0 //目标定位PKID (备用)
  513. s_tran_spt.e_long = 1
  514. s_tran_spt.a_any = s_spt_tran
  515. OpenWithParm(w_spt_edit, s_tran_spt)
  516. s_spt S_INSSPT
  517. S_INSSPT = Message.PowerObjectParm //接受返回结构
  518. IF S_INSSPT.sptid <= 0 THEN RETURN
  519. s_parm.ll_sptid = S_INSSPT.sptid
  520. s_parm.ls_sptcode = S_INSSPT.sptcode
  521. s_parm.ls_sptname = S_INSSPT.Name
  522. OpenWithParm(w_aifmb_addcuscomm,s_parm)
  523. end event
  524. type cb_addcus from commandbutton within w_aifmb_querycom2
  525. integer x = 1225
  526. integer y = 40
  527. integer width = 274
  528. integer height = 84
  529. integer taborder = 40
  530. integer textsize = -9
  531. integer weight = 400
  532. fontcharset fontcharset = gb2312charset!
  533. fontpitch fontpitch = variable!
  534. string facename = "宋体"
  535. string text = "加为客户"
  536. end type
  537. event clicked;Long ll_row
  538. ll_row = dw_1.GetRow()
  539. IF ll_row <= 0 THEN
  540. MessageBox('提示', '请选择添加对象')
  541. RETURN
  542. END IF
  543. s_aifmb_addcuscomm s_parm
  544. s_parm.cusid = dw_1.Object.cusid[ll_row]
  545. s_parm.cuscode = dw_1.Object.usercode[ll_row]
  546. s_parm.cusname = dw_1.Object.username[ll_row]
  547. s_parm.lb_readonly = False
  548. s_parm.custype = 2
  549. IF s_parm.cusid = '' THEN
  550. MessageBox('提示', '对方唯一码为空不能添加')
  551. RETURN
  552. END IF
  553. IF s_parm.cusid = '00000000-0000-0000-0000-000000000000' THEN
  554. MessageBox('提示', '对方唯一码为零不能添加')
  555. RETURN
  556. END IF
  557. //查询是否已经绑定客户
  558. Long ll_cnt
  559. SELECT COUNT(0)
  560. INTO :ll_cnt
  561. FROM LJFIEB_CusComm
  562. WHERE CusID = :s_parm.cusid
  563. Using sys_email_sqlca;
  564. IF sys_email_sqlca.SQLCode <> 0 THEN
  565. MessageBox('提示', '查询企业是否有本地信息失败,' + sys_email_sqlca.SQLErrText)
  566. RETURN
  567. END IF
  568. String ls_cuscode
  569. String ls_cusname
  570. IF ll_cnt > 0 THEN
  571. SELECT top 1 cuscode, cusname
  572. INTO :ls_cuscode, :ls_cusname
  573. FROM LJFIEB_CusComm
  574. WHERE CusID = :s_parm.cusid
  575. Using sys_email_sqlca;
  576. IF sys_email_sqlca.SQLCode <> 0 THEN
  577. MessageBox('提示', '查询本地企业信息失败,' + sys_email_sqlca.SQLErrText)
  578. RETURN
  579. END IF
  580. s_parm.cuscode = ls_cuscode
  581. s_parm.cusname = ls_cusname
  582. s_parm.lb_readonly = True
  583. SELECT COUNT(0)
  584. INTO :ll_cnt
  585. FROM u_cust
  586. Where commcode = :ls_cuscode;
  587. IF sqlca.SQLCode <> 0 THEN
  588. MessageBox('提示', '查询已绑定客户个数失败,' + sys_email_sqlca.SQLErrText)
  589. RETURN
  590. END IF
  591. IF ll_cnt > 0 THEN
  592. IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个客户,是否继续?', Question!, YesNo!, 1) <> 1 THEN
  593. RETURN
  594. END IF
  595. END IF
  596. END IF
  597. s_custom s_cust
  598. s_cust.cuscode = dw_1.Object.usercode[ll_row]
  599. s_cust.Name = dw_1.Object.username[ll_row]
  600. s_cust.tele = dw_1.Object.tele[ll_row]
  601. s_cust.tele1 = dw_1.Object.phone[ll_row]
  602. s_cust.Address = dw_1.Object.Address[ll_row]
  603. s_cust.email = dw_1.Object.email[ll_row]
  604. s_cust.dscrp = dw_1.Object.dscrp[ll_row]
  605. s_edit_index_tran s_tran
  606. s_tran.if_retrieve_all = False //是否一次RETRIEVE所有行
  607. s_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  608. s_tran.arg_pkid = 0 //目标定位PKID (备用)
  609. s_tran.e_long = 1
  610. s_tran.a_any = s_cust
  611. OpenWithParm(w_cust_edit, s_tran)
  612. s_custom S_INSCUST
  613. S_INSCUST = Message.PowerObjectParm //接受返回结构
  614. IF S_INSCUST.cusid <= 0 THEN RETURN
  615. s_parm.ll_cusid = S_INSCUST.cusid
  616. s_parm.ls_cuscode = S_INSCUST.cuscode
  617. s_parm.ls_cusname = S_INSCUST.Name
  618. OpenWithParm(w_aifmb_addcuscomm,s_parm)
  619. end event
  620. type cb_1 from commandbutton within w_aifmb_querycom2
  621. integer x = 37
  622. integer y = 40
  623. integer width = 206
  624. integer height = 84
  625. integer taborder = 20
  626. integer textsize = -9
  627. integer weight = 400
  628. fontcharset fontcharset = gb2312charset!
  629. fontpitch fontpitch = variable!
  630. string facename = "宋体"
  631. string text = "查找"
  632. end type
  633. event clicked;parent.triggerevent('ue_search')
  634. end event
  635. type dw_1 from u_dw_rbtnfilter within w_aifmb_querycom2
  636. integer y = 152
  637. integer width = 2446
  638. integer height = 1212
  639. string dataobject = "dw_aifmb_querycom2"
  640. boolean hscrollbar = true
  641. boolean vscrollbar = true
  642. boolean hsplitscroll = true
  643. boolean rbutton_filter_use = true
  644. boolean rbutton_setposition_use = true
  645. boolean titleclick_sort_use = true
  646. end type
  647. event rowfocuschanged;call super::rowfocuschanged;this.selectrow(0, false)
  648. if currentrow > 0 then
  649. this.selectrow(currentrow,true)
  650. end if
  651. end event
  652. event clicked;call super::clicked;if row > 0 then
  653. this.setrow(row)
  654. end if
  655. end event