w_ljmail_contact_ch_fx.srw 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. $PBExportHeader$w_ljmail_contact_ch_fx.srw
  2. $PBExportComments$(协同)通信录选择
  3. forward
  4. global type w_ljmail_contact_ch_fx from w_publ_base_style
  5. end type
  6. type dw_1 from u_dw_rbtnfilter within w_ljmail_contact_ch_fx
  7. end type
  8. type cb_ok from uo_imflatbutton within w_ljmail_contact_ch_fx
  9. end type
  10. type cb_retrieve from uo_imflatbutton within w_ljmail_contact_ch_fx
  11. end type
  12. end forward
  13. global type w_ljmail_contact_ch_fx from w_publ_base_style
  14. integer width = 3310
  15. integer height = 2080
  16. string title = "通信录"
  17. boolean minbox = false
  18. windowtype windowtype = response!
  19. long backcolor = 16777215
  20. string icon = "graphics\chain_link_128px.ico"
  21. boolean center = true
  22. dw_1 dw_1
  23. cb_ok cb_ok
  24. cb_retrieve cb_retrieve
  25. end type
  26. global w_ljmail_contact_ch_fx w_ljmail_contact_ch_fx
  27. type variables
  28. s_fx_ljmail_contact ins_contact
  29. end variables
  30. on w_ljmail_contact_ch_fx.create
  31. int iCurrent
  32. call super::create
  33. this.dw_1=create dw_1
  34. this.cb_ok=create cb_ok
  35. this.cb_retrieve=create cb_retrieve
  36. iCurrent=UpperBound(this.Control)
  37. this.Control[iCurrent+1]=this.dw_1
  38. this.Control[iCurrent+2]=this.cb_ok
  39. this.Control[iCurrent+3]=this.cb_retrieve
  40. end on
  41. on w_ljmail_contact_ch_fx.destroy
  42. call super::destroy
  43. destroy(this.dw_1)
  44. destroy(this.cb_ok)
  45. destroy(this.cb_retrieve)
  46. end on
  47. event open;call super::open;s_fx_ljmail_contact temp
  48. temp = Message.PowerObjectParm
  49. if (IsValid(temp) and not IsNull(temp)) then
  50. ins_contact = temp
  51. end if
  52. ins_contact.ifch = 0
  53. string arg_msg
  54. FXAppCom.UpdateContact(app_token_fx, ref arg_msg)
  55. if (arg_msg <> '') then
  56. MessageBox('提示', '更新(系统)通信录失败:' + arg_msg)
  57. end if
  58. cb_retrieve.post event clicked()
  59. end event
  60. event resize;call super::resize;cb_exit.X = this.workspacewidth( ) - cb_exit.Width
  61. end event
  62. type cb_func from w_publ_base_style`cb_func within w_ljmail_contact_ch_fx
  63. boolean visible = false
  64. integer taborder = 50
  65. boolean enabled = false
  66. end type
  67. type cb_exit from w_publ_base_style`cb_exit within w_ljmail_contact_ch_fx
  68. integer x = 1125
  69. integer taborder = 30
  70. end type
  71. type ln_bar from w_publ_base_style`ln_bar within w_ljmail_contact_ch_fx
  72. end type
  73. type ln_bar2 from w_publ_base_style`ln_bar2 within w_ljmail_contact_ch_fx
  74. end type
  75. type r_bar from w_publ_base_style`r_bar within w_ljmail_contact_ch_fx
  76. end type
  77. type dw_1 from u_dw_rbtnfilter within w_ljmail_contact_ch_fx
  78. integer y = 168
  79. integer width = 3333
  80. integer height = 1848
  81. integer taborder = 40
  82. boolean bringtotop = true
  83. string dataobject = "dw_fx_ljmail_contact"
  84. boolean hscrollbar = true
  85. boolean vscrollbar = true
  86. boolean rbutton_filter_use = true
  87. boolean rbutton_setposition_use = true
  88. boolean titleclick_sort_use = true
  89. end type
  90. event itemfocuschanged;call super::itemfocuschanged;if (row > 0) then
  91. this.SetRow(row)
  92. this.SelectRow(0, false)
  93. this.SelectRow(row, true)
  94. end if
  95. end event
  96. event clicked;call super::clicked;if (row > 0) then
  97. this.SetRow(row)
  98. this.SelectRow(0, false)
  99. this.SelectRow(row, true)
  100. end if
  101. end event
  102. type cb_ok from uo_imflatbutton within w_ljmail_contact_ch_fx
  103. integer x = 151
  104. integer width = 151
  105. integer height = 164
  106. integer taborder = 20
  107. boolean bringtotop = true
  108. string text = "选定"
  109. string normalpicname = "ok.bmp"
  110. integer picsize = 16
  111. toolbaralignment pic_align = alignattop!
  112. boolean border = false
  113. end type
  114. event clicked;call super::clicked;long i, j
  115. dw_1.SetFilter('')
  116. dw_1.Filter()
  117. s_fx_ljmail_contact ch
  118. for i = 1 to dw_1.RowCount()
  119. if (dw_1.Object.ch[i] = 1) then
  120. j ++
  121. ch.cid[j] = dw_1.Object.cid[i]
  122. ch.userid[j] = dw_1.Object.userid[i]
  123. ch.revCusCommID[j] = dw_1.Object.revCusCommID[i]
  124. ch.revName[j] = dw_1.Object.revName[i]
  125. ch.relType[j] = dw_1.Object.relType[i]
  126. ch.revEmpid[j] = dw_1.Object.revEmpid[i]
  127. ch.revLjmail[j] = dw_1.Object.revLjmail[i]
  128. ch.revRep[j] = dw_1.Object.revRep[i]
  129. ch.dscrp[j] = dw_1.Object.dscrp[i]
  130. end if
  131. next
  132. if (j <= 0) then
  133. MessageBox('提示', '请勾选收件人')
  134. return
  135. end if
  136. ins_contact = ch
  137. ins_contact.ifch = 1
  138. CloseWithReturn(parent, ins_contact)
  139. end event
  140. type cb_retrieve from uo_imflatbutton within w_ljmail_contact_ch_fx
  141. integer width = 151
  142. integer height = 164
  143. integer taborder = 10
  144. boolean bringtotop = true
  145. string text = "刷新"
  146. string normalpicname = "refresh.bmp"
  147. integer picsize = 16
  148. toolbaralignment pic_align = alignattop!
  149. boolean border = false
  150. end type
  151. event clicked;call super::clicked;string arg_msg
  152. oleobject list, item
  153. list = FXAppCom.GetContact(app_token_fx, ref arg_msg)
  154. if (arg_msg <> '') then
  155. MessageBox('提示', '获取通信录失败:' + arg_msg)
  156. return
  157. end if
  158. dw_1.Reset()
  159. dw_1.SetRedraw(false)
  160. long i, row
  161. for i = 1 to list.Count
  162. item = list.GetItem(i - 1)
  163. row = dw_1.InsertRow(0)
  164. dw_1.Object.ch[row] = 0
  165. dw_1.Object.cid[row] = item.GetInt('cid')
  166. dw_1.Object.userid[row] = item.GetInt('userid')
  167. dw_1.Object.revCusCommID[row] = item.GetInt('revCusCommID')
  168. dw_1.Object.revEmpid[row] = item.GetInt('revEmpid')
  169. dw_1.Object.relType[row] = item.GetInt('relType')
  170. dw_1.Object.revName[row] = item.GetString('revName')
  171. dw_1.Object.revLjmail[row] = item.GetString('revLjmail')
  172. dw_1.Object.revRep[row] = item.GetString('revRep')
  173. dw_1.Object.dscrp[row] = item.GetString('dscrp')
  174. next
  175. for i = 1 to UpperBound(ins_contact.revljmail)
  176. row = dw_1.Find('revName = "' + ins_contact.revname[i] + '" and revLjmail = "' + ins_contact.revljmail[i] + '"', 1, dw_1.RowCount())
  177. if (row > 0) then
  178. dw_1.Object.ch[row] = 1
  179. end if
  180. next
  181. dw_1.SetSort('ch,reltype,revname')
  182. dw_1.Sort()
  183. dw_1.SetRedraw(true)
  184. end event