w_aifmb_addcuscomm_request2.srw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. $PBExportHeader$w_aifmb_addcuscomm_request2.srw
  2. forward
  3. global type w_aifmb_addcuscomm_request2 from window
  4. end type
  5. type cbx_3 from checkbox within w_aifmb_addcuscomm_request2
  6. end type
  7. type cbx_2 from checkbox within w_aifmb_addcuscomm_request2
  8. end type
  9. type cbx_1 from checkbox within w_aifmb_addcuscomm_request2
  10. end type
  11. type cb_6 from commandbutton within w_aifmb_addcuscomm_request2
  12. end type
  13. type em_1 from editmask within w_aifmb_addcuscomm_request2
  14. end type
  15. type cb_5 from commandbutton within w_aifmb_addcuscomm_request2
  16. end type
  17. type em_2 from editmask within w_aifmb_addcuscomm_request2
  18. end type
  19. type cb_4 from commandbutton within w_aifmb_addcuscomm_request2
  20. end type
  21. type cb_3 from commandbutton within w_aifmb_addcuscomm_request2
  22. end type
  23. type cb_2 from commandbutton within w_aifmb_addcuscomm_request2
  24. end type
  25. type cb_1 from commandbutton within w_aifmb_addcuscomm_request2
  26. end type
  27. type dw_1 from u_dw_rbtnfilter within w_aifmb_addcuscomm_request2
  28. end type
  29. end forward
  30. global type w_aifmb_addcuscomm_request2 from window
  31. integer width = 3214
  32. integer height = 2028
  33. windowtype windowtype = child!
  34. long backcolor = 67108864
  35. string icon = "AppIcon!"
  36. boolean center = true
  37. event ue_search ( )
  38. cbx_3 cbx_3
  39. cbx_2 cbx_2
  40. cbx_1 cbx_1
  41. cb_6 cb_6
  42. em_1 em_1
  43. cb_5 cb_5
  44. em_2 em_2
  45. cb_4 cb_4
  46. cb_3 cb_3
  47. cb_2 cb_2
  48. cb_1 cb_1
  49. dw_1 dw_1
  50. end type
  51. global w_aifmb_addcuscomm_request2 w_aifmb_addcuscomm_request2
  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_GetEntLinkMsgList(ds_productcode, cbx_1.Checked, cbx_2.Checked, cbx_3.Checked, 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. ext:
  78. Destroy ds_productcode
  79. Destroy lo_aifmb
  80. IF rslt = 0 THEN
  81. MessageBox('ERROR', arg_msg)
  82. END IF
  83. end event
  84. on w_aifmb_addcuscomm_request2.create
  85. this.cbx_3=create cbx_3
  86. this.cbx_2=create cbx_2
  87. this.cbx_1=create cbx_1
  88. this.cb_6=create cb_6
  89. this.em_1=create em_1
  90. this.cb_5=create cb_5
  91. this.em_2=create em_2
  92. this.cb_4=create cb_4
  93. this.cb_3=create cb_3
  94. this.cb_2=create cb_2
  95. this.cb_1=create cb_1
  96. this.dw_1=create dw_1
  97. this.Control[]={this.cbx_3,&
  98. this.cbx_2,&
  99. this.cbx_1,&
  100. this.cb_6,&
  101. this.em_1,&
  102. this.cb_5,&
  103. this.em_2,&
  104. this.cb_4,&
  105. this.cb_3,&
  106. this.cb_2,&
  107. this.cb_1,&
  108. this.dw_1}
  109. end on
  110. on w_aifmb_addcuscomm_request2.destroy
  111. destroy(this.cbx_3)
  112. destroy(this.cbx_2)
  113. destroy(this.cbx_1)
  114. destroy(this.cb_6)
  115. destroy(this.em_1)
  116. destroy(this.cb_5)
  117. destroy(this.em_2)
  118. destroy(this.cb_4)
  119. destroy(this.cb_3)
  120. destroy(this.cb_2)
  121. destroy(this.cb_1)
  122. destroy(this.dw_1)
  123. end on
  124. event resize;
  125. dw_1.Width = This.WorkSpaceWidth() - dw_1.X
  126. dw_1.Height = This.WorkSpaceHeight() - dw_1.Y
  127. end event
  128. type cbx_3 from checkbox within w_aifmb_addcuscomm_request2
  129. integer x = 494
  130. integer y = 40
  131. integer width = 247
  132. integer height = 60
  133. integer textsize = -9
  134. integer weight = 400
  135. fontcharset fontcharset = gb2312charset!
  136. fontpitch fontpitch = variable!
  137. string facename = "宋体"
  138. long textcolor = 33554432
  139. long backcolor = 67108864
  140. string text = "已处理"
  141. boolean lefttext = true
  142. end type
  143. type cbx_2 from checkbox within w_aifmb_addcuscomm_request2
  144. integer x = 265
  145. integer y = 40
  146. integer width = 192
  147. integer height = 60
  148. integer textsize = -9
  149. integer weight = 400
  150. fontcharset fontcharset = gb2312charset!
  151. fontpitch fontpitch = variable!
  152. string facename = "宋体"
  153. long textcolor = 33554432
  154. long backcolor = 67108864
  155. string text = "发件"
  156. boolean lefttext = true
  157. end type
  158. type cbx_1 from checkbox within w_aifmb_addcuscomm_request2
  159. integer x = 78
  160. integer y = 40
  161. integer width = 169
  162. integer height = 60
  163. integer textsize = -9
  164. integer weight = 400
  165. fontcharset fontcharset = gb2312charset!
  166. fontpitch fontpitch = variable!
  167. string facename = "宋体"
  168. long textcolor = 33554432
  169. long backcolor = 67108864
  170. string text = "收件"
  171. boolean lefttext = true
  172. end type
  173. type cb_6 from commandbutton within w_aifmb_addcuscomm_request2
  174. integer x = 1202
  175. integer y = 28
  176. integer width = 242
  177. integer height = 84
  178. integer taborder = 40
  179. integer textsize = -9
  180. integer weight = 400
  181. fontcharset fontcharset = gb2312charset!
  182. fontpitch fontpitch = variable!
  183. string facename = "宋体"
  184. string text = "上一页"
  185. end type
  186. event clicked;long pageindex
  187. pageindex = long(em_1.Text)
  188. pageindex -= 1
  189. em_1.Text = string(pageindex)
  190. parent.triggerevent('ue_search')
  191. end event
  192. type em_1 from editmask within w_aifmb_addcuscomm_request2
  193. integer x = 1445
  194. integer y = 28
  195. integer width = 165
  196. integer height = 84
  197. integer taborder = 40
  198. integer textsize = -9
  199. integer weight = 400
  200. fontcharset fontcharset = gb2312charset!
  201. fontpitch fontpitch = variable!
  202. string facename = "宋体"
  203. long textcolor = 33554432
  204. string text = "1"
  205. alignment alignment = right!
  206. borderstyle borderstyle = stylelowered!
  207. string mask = "#,##0"
  208. end type
  209. type cb_5 from commandbutton within w_aifmb_addcuscomm_request2
  210. integer x = 1609
  211. integer y = 28
  212. integer width = 242
  213. integer height = 84
  214. integer taborder = 40
  215. integer textsize = -9
  216. integer weight = 400
  217. fontcharset fontcharset = gb2312charset!
  218. fontpitch fontpitch = variable!
  219. string facename = "宋体"
  220. string text = "下一页"
  221. end type
  222. event clicked;long pageindex
  223. pageindex = long(em_1.Text)
  224. pageindex += 1
  225. em_1.Text = string(pageindex)
  226. parent.triggerevent('ue_search')
  227. end event
  228. type em_2 from editmask within w_aifmb_addcuscomm_request2
  229. integer x = 1874
  230. integer y = 28
  231. integer width = 165
  232. integer height = 84
  233. integer taborder = 40
  234. integer textsize = -9
  235. integer weight = 400
  236. fontcharset fontcharset = gb2312charset!
  237. fontpitch fontpitch = variable!
  238. string facename = "宋体"
  239. long textcolor = 33554432
  240. string text = "10"
  241. alignment alignment = right!
  242. borderstyle borderstyle = stylelowered!
  243. string mask = "#,##0"
  244. end type
  245. type cb_4 from commandbutton within w_aifmb_addcuscomm_request2
  246. integer x = 910
  247. integer y = 20
  248. integer width = 261
  249. integer height = 100
  250. integer taborder = 40
  251. integer textsize = -9
  252. integer weight = 400
  253. fontcharset fontcharset = gb2312charset!
  254. fontpitch fontpitch = variable!
  255. string facename = "宋体"
  256. string text = "刷新"
  257. end type
  258. event clicked;parent.triggerevent('ue_search')
  259. end event
  260. type cb_3 from commandbutton within w_aifmb_addcuscomm_request2
  261. integer x = 2912
  262. integer y = 20
  263. integer width = 261
  264. integer height = 100
  265. integer taborder = 30
  266. integer textsize = -9
  267. integer weight = 400
  268. fontcharset fontcharset = gb2312charset!
  269. fontpitch fontpitch = variable!
  270. string facename = "宋体"
  271. string text = "退出"
  272. end type
  273. event clicked;close(parent)
  274. end event
  275. type cb_2 from commandbutton within w_aifmb_addcuscomm_request2
  276. integer x = 2619
  277. integer y = 20
  278. integer width = 261
  279. integer height = 100
  280. integer taborder = 20
  281. integer textsize = -9
  282. integer weight = 400
  283. fontcharset fontcharset = gb2312charset!
  284. fontpitch fontpitch = variable!
  285. string facename = "宋体"
  286. string text = "拒绝"
  287. end type
  288. type cb_1 from commandbutton within w_aifmb_addcuscomm_request2
  289. integer x = 2327
  290. integer y = 20
  291. integer width = 261
  292. integer height = 100
  293. integer taborder = 10
  294. integer textsize = -9
  295. integer weight = 400
  296. fontcharset fontcharset = gb2312charset!
  297. fontpitch fontpitch = variable!
  298. string facename = "宋体"
  299. string text = "接受"
  300. end type
  301. event clicked;Int rslt = 1
  302. String arg_msg
  303. Long ll_row
  304. ll_row = dw_1.GetRow()
  305. IF ll_row <= 0 THEN
  306. MessageBox('提示', '请选择接受对象')
  307. RETURN
  308. END IF
  309. s_aifmb_addcuscomm s_parm
  310. s_parm.cusid = dw_1.Object.cusid[ll_row]
  311. s_parm.cuscode = dw_1.Object.usercode[ll_row]
  312. s_parm.cusname = dw_1.Object.username[ll_row]
  313. s_parm.lb_readonly = False
  314. IF dw_1.Object.custype[ll_row] = 1 THEN // 供应商
  315. s_parm.custype = 2
  316. ELSEIF dw_1.Object.custype[ll_row] = 2 THEN // 客户
  317. s_parm.custype = 1
  318. ELSEIF dw_1.Object.custype[ll_row] = 3 THEN
  319. s_parm.custype = 3
  320. END IF
  321. IF s_parm.cusid = '' THEN
  322. MessageBox('提示', '对方唯一码为空不能添加')
  323. RETURN
  324. END IF
  325. IF s_parm.cusid = '00000000-0000-0000-0000-000000000000' THEN
  326. MessageBox('提示', '对方唯一码为零不能添加')
  327. RETURN
  328. END IF
  329. //查询是否已经绑定客户
  330. Long ll_cnt
  331. SELECT COUNT(0)
  332. INTO :ll_cnt
  333. FROM LJFIEB_CusComm
  334. WHERE CusID = :s_parm.cusid
  335. Using sys_email_sqlca;
  336. IF sys_email_sqlca.SQLCode <> 0 THEN
  337. MessageBox('提示', '查询企业是否有本地信息失败,' + sys_email_sqlca.SQLErrText)
  338. RETURN
  339. END IF
  340. String ls_cuscode
  341. String ls_cusname
  342. IF ll_cnt > 0 THEN
  343. SELECT top 1 cuscode, cusname
  344. INTO :ls_cuscode, :ls_cusname
  345. FROM LJFIEB_CusComm
  346. WHERE CusID = :s_parm.cusid
  347. Using sys_email_sqlca;
  348. IF sys_email_sqlca.SQLCode <> 0 THEN
  349. MessageBox('提示', '查询本地企业信息失败,' + sys_email_sqlca.SQLErrText)
  350. RETURN
  351. END IF
  352. s_parm.cuscode = ls_cuscode
  353. s_parm.cusname = ls_cusname
  354. s_parm.lb_readonly = True
  355. IF s_parm.custype = 2 Or s_parm.custype = 3 THEN
  356. SELECT COUNT(0)
  357. INTO :ll_cnt
  358. FROM u_cust
  359. Where commcode = :ls_cuscode;
  360. IF sqlca.SQLCode <> 0 THEN
  361. MessageBox('提示', '查询已绑定客户个数失败,' + sys_email_sqlca.SQLErrText)
  362. RETURN
  363. END IF
  364. IF ll_cnt > 0 THEN
  365. IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个客户,是否继续?', Question!, YesNo!, 1) <> 1 THEN
  366. RETURN
  367. END IF
  368. END IF
  369. END IF
  370. IF s_parm.custype = 1 Or s_parm.custype = 3 THEN
  371. SELECT COUNT(0)
  372. INTO :ll_cnt
  373. FROM u_spt
  374. Where commcode = :ls_cuscode;
  375. IF sqlca.SQLCode <> 0 THEN
  376. MessageBox('提示', '查询已绑定供应商个数失败,' + sys_email_sqlca.SQLErrText)
  377. RETURN
  378. END IF
  379. IF ll_cnt > 0 THEN
  380. IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个供应商,是否继续?', Question!, YesNo!, 1) <> 1 THEN
  381. RETURN
  382. END IF
  383. END IF
  384. END IF
  385. END IF
  386. IF s_parm.custype = 2 Or s_parm.custype = 3 THEN
  387. s_custom s_cust
  388. s_cust.cuscode = dw_1.Object.usercode[ll_row]
  389. s_cust.Name = dw_1.Object.username[ll_row]
  390. s_cust.tele = dw_1.Object.tele[ll_row]
  391. s_cust.tele1 = dw_1.Object.phone[ll_row]
  392. s_cust.Address = dw_1.Object.Address[ll_row]
  393. s_cust.email = dw_1.Object.email[ll_row]
  394. s_cust.dscrp = dw_1.Object.dscrp[ll_row]
  395. s_edit_index_tran s_tran
  396. s_tran.if_retrieve_all = False //是否一次RETRIEVE所有行
  397. s_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  398. s_tran.arg_pkid = 0 //目标定位PKID (备用)
  399. s_tran.e_long = 1
  400. s_tran.a_any = s_cust
  401. OpenWithParm(w_cust_edit, s_tran)
  402. s_custom S_INSCUST
  403. S_INSCUST = Message.PowerObjectParm //接受返回结构
  404. IF S_INSCUST.cusid <= 0 THEN RETURN
  405. s_parm.ll_cusid = S_INSCUST.cusid
  406. s_parm.ls_cuscode = S_INSCUST.cuscode
  407. s_parm.ls_cusname = S_INSCUST.Name
  408. END IF
  409. IF s_parm.custype = 1 Or s_parm.custype = 3 THEN
  410. s_spt s_spt_tran
  411. s_spt_tran.sptcode = dw_1.Object.usercode[ll_row]
  412. s_spt_tran.Name = dw_1.Object.username[ll_row]
  413. s_spt_tran.tele = dw_1.Object.tele[ll_row]
  414. s_spt_tran.tele1 = dw_1.Object.phone[ll_row]
  415. s_spt_tran.Address = dw_1.Object.Address[ll_row]
  416. s_spt_tran.email = dw_1.Object.email[ll_row]
  417. s_spt_tran.dscrp = dw_1.Object.dscrp[ll_row]
  418. s_edit_index_tran s_tran_spt
  419. s_tran_spt.if_retrieve_all = False //是否一次RETRIEVE所有行
  420. s_tran_spt.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  421. s_tran_spt.arg_pkid = 0 //目标定位PKID (备用)
  422. s_tran_spt.e_long = 1
  423. s_tran_spt.a_any = s_spt_tran
  424. OpenWithParm(w_spt_edit, s_tran_spt)
  425. s_spt S_INSSPT
  426. S_INSSPT = Message.PowerObjectParm //接受返回结构
  427. IF S_INSSPT.sptid <= 0 THEN RETURN
  428. s_parm.ll_sptid = S_INSSPT.sptid
  429. s_parm.ls_sptcode = S_INSSPT.sptcode
  430. s_parm.ls_sptname = S_INSSPT.Name
  431. END IF
  432. OpenWithParm(w_aifmb_addcuscomm_accept,s_parm)
  433. end event
  434. type dw_1 from u_dw_rbtnfilter within w_aifmb_addcuscomm_request2
  435. integer y = 140
  436. integer width = 2638
  437. integer height = 1732
  438. string dataobject = "dw_aifmb_addcuscomm_request2"
  439. boolean hscrollbar = true
  440. boolean vscrollbar = true
  441. boolean hsplitscroll = true
  442. boolean rbutton_filter_use = true
  443. boolean rbutton_setposition_use = true
  444. boolean titleclick_sort_use = true
  445. end type
  446. event clicked;call super::clicked;if row > 0 then
  447. this.setrow(row)
  448. end if
  449. end event
  450. event rowfocuschanged;call super::rowfocuschanged;this.selectrow(0, false)
  451. if currentrow > 0 then
  452. this.selectrow(currentrow,true)
  453. end if
  454. end event