w_aifmb_entuser_edit.srw 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. $PBExportHeader$w_aifmb_entuser_edit.srw
  2. forward
  3. global type w_aifmb_entuser_edit from window
  4. end type
  5. type cb_save from uo_imflatbutton within w_aifmb_entuser_edit
  6. end type
  7. type cb_exit from uo_imflatbutton within w_aifmb_entuser_edit
  8. end type
  9. type dw_2 from datawindow within w_aifmb_entuser_edit
  10. end type
  11. type dw_1 from datawindow within w_aifmb_entuser_edit
  12. end type
  13. end forward
  14. global type w_aifmb_entuser_edit from window
  15. integer width = 2478
  16. integer height = 1144
  17. boolean titlebar = true
  18. string title = "用户修改"
  19. boolean controlmenu = true
  20. windowtype windowtype = response!
  21. long backcolor = 67108864
  22. string icon = "AppIcon!"
  23. boolean center = true
  24. event ue_retrieve_rights ( )
  25. cb_save cb_save
  26. cb_exit cb_exit
  27. dw_2 dw_2
  28. dw_1 dw_1
  29. end type
  30. global w_aifmb_entuser_edit w_aifmb_entuser_edit
  31. type variables
  32. s_aifmb_entuser_edit_tran s_tran
  33. end variables
  34. forward prototypes
  35. public function string wf_powerstring ()
  36. end prototypes
  37. event ue_retrieve_rights();s_tran.dw_rights.RowsCopy(1, s_tran.dw_rights.RowCount(), Primary!, dw_2, 1, Primary!)
  38. end event
  39. public function string wf_powerstring ();Long i
  40. String rslt = ''
  41. Long Pos = -1
  42. Long Right = -1
  43. FOR i = 1 To dw_2.RowCount()
  44. Pos = dw_2.Object.rightsindex[i] + 1
  45. Right = dw_2.Object.ch[i]
  46. IF Pos <= Len(rslt) THEN
  47. rslt = Replace(rslt, Pos, 1, String(Right))
  48. ELSE
  49. rslt += Fill('0', Pos - Len(rslt) - 1)
  50. rslt += String(Right)
  51. END IF
  52. NEXT
  53. RETURN rslt
  54. end function
  55. on w_aifmb_entuser_edit.create
  56. this.cb_save=create cb_save
  57. this.cb_exit=create cb_exit
  58. this.dw_2=create dw_2
  59. this.dw_1=create dw_1
  60. this.Control[]={this.cb_save,&
  61. this.cb_exit,&
  62. this.dw_2,&
  63. this.dw_1}
  64. end on
  65. on w_aifmb_entuser_edit.destroy
  66. destroy(this.cb_save)
  67. destroy(this.cb_exit)
  68. destroy(this.dw_2)
  69. destroy(this.dw_1)
  70. end on
  71. event open;s_tran = Message.PowerObjectParm
  72. TriggerEvent('ue_retrieve_rights')
  73. IF s_tran.row > 0 THEN
  74. s_tran.dw_user.RowsCopy(s_tran.row, s_tran.row, Primary!, dw_1, 1, Primary!)
  75. ELSE
  76. dw_1.InsertRow(0)
  77. END IF
  78. Long i
  79. FOR i = 1 To dw_2.RowCount()
  80. dw_2.Object.ch[i] = f_aifmb_ind_power(dw_1.Object.powers[1], dw_2.Object.rightsindex[i])
  81. NEXT
  82. end event
  83. type cb_save from uo_imflatbutton within w_aifmb_entuser_edit
  84. integer x = 1783
  85. integer y = 944
  86. integer width = 311
  87. integer height = 96
  88. integer taborder = 30
  89. string text = "保存"
  90. boolean cancel = true
  91. string normalpicname = "save.bmp"
  92. end type
  93. event clicked;call super::clicked;uo_aifmb = Create uo_aifmb
  94. Int rslt = 1
  95. String arg_msg
  96. Long row
  97. dw_1.AcceptText()
  98. dw_2.AcceptText()
  99. s_aifmb_a_user ss_user
  100. ss_user.UserID = dw_1.Object.UserID[1]
  101. ss_user.repid = dw_1.Object.repid[1]
  102. ss_user.logname = dw_1.Object.logname[1]
  103. ss_user.repname = dw_1.Object.repname[1]
  104. ss_user.tele = dw_1.Object.tele[1]
  105. ss_user.phone = dw_1.Object.phone[1]
  106. ss_user.Address = dw_1.Object.Address[1]
  107. ss_user.email = dw_1.Object.email[1]
  108. ss_user.qq = dw_1.Object.qq[1]
  109. ss_user.inuse = dw_1.Object.inuse[1]
  110. ss_user.powers = wf_powerstring()
  111. s_aifmb_a_user ss_users[]
  112. ss_users[1] = ss_user
  113. IF uo_aifmb.uf_setentuserright(ss_users, arg_msg) <> 1 THEN
  114. rslt = 0
  115. GOTO ext
  116. END IF
  117. IF s_tran.row > 0 THEN
  118. s_tran.dw_user.Object.logname[s_tran.row] = ss_user.logname
  119. s_tran.dw_user.Object.repname[s_tran.row] = ss_user.repname
  120. s_tran.dw_user.Object.tele[s_tran.row] = ss_user.tele
  121. s_tran.dw_user.Object.phone[s_tran.row] = ss_user.phone
  122. s_tran.dw_user.Object.Address[s_tran.row] = ss_user.Address
  123. s_tran.dw_user.Object.email[s_tran.row] = ss_user.email
  124. s_tran.dw_user.Object.qq[s_tran.row] = ss_user.qq
  125. s_tran.dw_user.Object.inuse[s_tran.row] = ss_user.inuse
  126. s_tran.dw_user.Object.powers[s_tran.row] = ss_user.powers
  127. s_tran.dw_user.SetRow(s_tran.row)
  128. s_tran.dw_user.ScrollToRow(s_tran.row)
  129. s_tran.dw_user.trigger event rowfocuschanged(s_tran.row)
  130. ELSE
  131. row = s_tran.dw_user.InsertRow(0)
  132. s_tran.dw_user.Object.UserID[row] = ss_user.UserID
  133. s_tran.dw_user.Object.repid[row] = ss_user.repid
  134. s_tran.dw_user.Object.logname[row] = ss_user.logname
  135. s_tran.dw_user.Object.repname[row] = ss_user.repname
  136. s_tran.dw_user.Object.tele[row] = ss_user.tele
  137. s_tran.dw_user.Object.phone[row] = ss_user.phone
  138. s_tran.dw_user.Object.Address[row] = ss_user.Address
  139. s_tran.dw_user.Object.email[row] = ss_user.email
  140. s_tran.dw_user.Object.qq[row] = ss_user.qq
  141. s_tran.dw_user.Object.inuse[row] = ss_user.inuse
  142. s_tran.dw_user.Object.powers[row] = ss_user.powers
  143. s_tran.dw_user.SetRow(row)
  144. s_tran.dw_user.ScrollToRow(row)
  145. s_tran.dw_user.trigger event rowfocuschanged(row)
  146. END IF
  147. GOTO ext
  148. ext:
  149. Destroy uo_aifmb
  150. IF rslt = 1 THEN
  151. Close(Parent)
  152. ELSE
  153. MessageBox('提示', arg_msg)
  154. END IF
  155. end event
  156. type cb_exit from uo_imflatbutton within w_aifmb_entuser_edit
  157. integer x = 2112
  158. integer y = 944
  159. integer width = 311
  160. integer height = 96
  161. integer taborder = 30
  162. string text = "退出"
  163. boolean cancel = true
  164. string normalpicname = "exit.bmp"
  165. end type
  166. event clicked;call super::clicked;close(parent)
  167. end event
  168. type dw_2 from datawindow within w_aifmb_entuser_edit
  169. integer x = 1367
  170. integer width = 1097
  171. integer height = 912
  172. integer taborder = 20
  173. string title = "none"
  174. string dataobject = "dw_aifmb_rights_edit"
  175. boolean hscrollbar = true
  176. boolean vscrollbar = true
  177. boolean hsplitscroll = true
  178. boolean livescroll = true
  179. borderstyle borderstyle = stylelowered!
  180. end type
  181. type dw_1 from datawindow within w_aifmb_entuser_edit
  182. integer width = 1371
  183. integer height = 912
  184. integer taborder = 10
  185. string title = "none"
  186. string dataobject = "dw_aifmb_entuser_edit"
  187. boolean livescroll = true
  188. borderstyle borderstyle = stylelowered!
  189. end type