w_sendway_edit_popup.srw 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. $PBExportHeader$w_sendway_edit_popup.srw
  2. forward
  3. global type w_sendway_edit_popup from w_publ_edit_choice
  4. end type
  5. end forward
  6. global type w_sendway_edit_popup from w_publ_edit_choice
  7. integer width = 3689
  8. integer height = 1592
  9. string title = "短信通道"
  10. boolean minbox = true
  11. windowtype windowtype = popup!
  12. end type
  13. global w_sendway_edit_popup w_sendway_edit_popup
  14. type variables
  15. uo_spring_sendway ins_uo_sendway
  16. long ins_col_num = 5
  17. s_spring_sendway ins_rslt
  18. end variables
  19. on w_sendway_edit_popup.create
  20. call super::create
  21. end on
  22. on w_sendway_edit_popup.destroy
  23. call super::destroy
  24. end on
  25. event open;call super::open;ins_uo_sendway = create uo_spring_sendway
  26. ins_uo_sendway.commit_transaction = sqlca
  27. ins_rslt.sendwayid = 0
  28. end event
  29. event close;call super::close;Destroy ins_uo_sendway
  30. CloseWithReturn(This, ins_rslt)
  31. end event
  32. event resize;call super::resize;
  33. dw_uc.Width = This.WorkSpaceWidth()
  34. dw_uc.Height = This.WorkSpaceHeight() - dw_uc.Y
  35. end event
  36. type cb_func from w_publ_edit_choice`cb_func within w_sendway_edit_popup
  37. end type
  38. type cb_exit from w_publ_edit_choice`cb_exit within w_sendway_edit_popup
  39. integer x = 987
  40. end type
  41. type cb_add from w_publ_edit_choice`cb_add within w_sendway_edit_popup
  42. end type
  43. event cb_add::clicked;call super::clicked;Long ll_newid,i
  44. String errmsg
  45. IF dw_edit_mode THEN
  46. IF dw_uc.AcceptText() <> 1 THEN RETURN
  47. dw_uc.Object.sendwayname[dw_uc.GetRow()] = Trim(dw_uc.Object.sendwayname[dw_uc.GetRow()])
  48. IF dw_uc.Object.sendwayname[dw_uc.GetRow()] = '' THEN
  49. MessageBox(publ_operator, '请输入通道名称')
  50. RETURN
  51. END IF
  52. END IF
  53. IF dw_edit_mode THEN
  54. s_spring_sendway s_sendway
  55. String ls_errmsg
  56. s_sendway.sendwayid = dw_uc.Object.sendwayid[dw_uc.GetRow()]
  57. s_sendway.sendwaytype = dw_uc.Object.sendwaytype[dw_uc.GetRow()]
  58. s_sendway.url = dw_uc.Object.url[dw_uc.GetRow()]
  59. s_sendway.sn = dw_uc.Object.sn[dw_uc.GetRow()]
  60. s_sendway.psw = dw_uc.Object.psw[dw_uc.GetRow()]
  61. s_sendway.sendwayname = dw_uc.Object.sendwayname[dw_uc.GetRow()]
  62. IF ins_uo_sendway.uf_save(Ref s_sendway, Ref ls_errmsg) <> 1 THEN
  63. MessageBox(publ_operator, ls_errmsg)
  64. RETURN
  65. END IF
  66. dw_uc.Object.sendwayid[dw_uc.GetRow()] = s_sendway.sendwayid
  67. FOR i = 1 To ins_col_num
  68. dw_uc.SetTabOrder ( i, 0 )
  69. NEXT
  70. ELSE
  71. Long li_row, li_cur_row
  72. li_cur_row = dw_uc.GetRow()
  73. li_row = dw_uc.InsertRow (0)
  74. FOR i = 1 To ins_col_num
  75. dw_uc.SetTabOrder ( i, i*10 )
  76. NEXT
  77. dw_uc.SelectRow(0,False)
  78. dw_uc.ScrollToRow (li_row)
  79. dw_uc.SelectRow(li_row,True)
  80. dw_uc.SetFocus()
  81. modifyrow_no = li_row
  82. END IF
  83. dw_edit_mode = Not dw_edit_mode
  84. WF_FACE_CHANGE()
  85. end event
  86. type cb_edit from w_publ_edit_choice`cb_edit within w_sendway_edit_popup
  87. end type
  88. event cb_edit::clicked;call super::clicked;Long i
  89. IF dw_edit_mode THEN
  90. IF dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = NewModified! Or dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = New! THEN
  91. dw_uc.DeleteRow(dw_uc.GetRow())
  92. ELSE
  93. dw_uc.ReselectRow(dw_uc.GetRow())
  94. END IF
  95. FOR i = 1 To ins_col_num
  96. dw_uc.SetTabOrder ( i, 0 )
  97. NEXT
  98. modifyrow_no = 0
  99. ELSE
  100. modifyrow_no = dw_uc.GetRow()
  101. FOR i = 1 To ins_col_num
  102. dw_uc.SetTabOrder ( i, i*10 )
  103. NEXT
  104. dw_uc.SetFocus()
  105. dw_uc.SelectRow(0,False)
  106. dw_uc.ScrollToRow (modifyrow_no)
  107. dw_uc.SelectRow(modifyrow_no,True)
  108. END IF
  109. dw_edit_mode = Not dw_edit_mode
  110. WF_FACE_CHANGE()
  111. end event
  112. type cb_delet from w_publ_edit_choice`cb_delet within w_sendway_edit_popup
  113. end type
  114. event cb_delet::clicked;call super::clicked;IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  115. RETURN
  116. END IF
  117. Long LS_id
  118. Long LS_LONG = 0
  119. String ls_code,arg_msg
  120. IF DW_UC.GetRow() <= 0 THEN
  121. MessageBox('','没有操作目标记录!')
  122. RETURN
  123. END IF
  124. LS_id = DW_UC.Object.sendwayid[DW_UC.GetRow()]
  125. IF ins_uo_sendway.uf_del(LS_id, arg_msg) <> 1 THEN
  126. MessageBox(publ_operator, arg_msg)
  127. RETURN
  128. END IF
  129. DW_UC.SetRedraw (False)
  130. DW_UC.DeleteRow (0)
  131. DW_UC.TriggerEvent (RowFocusChanged!)
  132. DW_UC.SetRedraw (True)
  133. end event
  134. type cb_choice from w_publ_edit_choice`cb_choice within w_sendway_edit_popup
  135. boolean visible = false
  136. end type
  137. event cb_choice::clicked;call super::clicked;IF DW_UC.GetRow() <= 0 THEN
  138. MessageBox('','没有操作目标记录!')
  139. RETURN
  140. END IF
  141. ins_rslt.sendwayid = dw_uc.Object.sendwayid[dw_uc.GETROW()]
  142. ins_rslt.sendwaytype = dw_uc.Object.sendwaytype[dw_uc.GETROW()]
  143. ins_rslt.url = dw_uc.Object.url[dw_uc.GETROW()]
  144. ins_rslt.sn = dw_uc.Object.sn[dw_uc.GETROW()]
  145. ins_rslt.psw = dw_uc.Object.psw[dw_uc.GETROW()]
  146. ins_rslt.sendwayname = dw_uc.Object.sendwayname[dw_uc.GETROW()]
  147. close(parent)
  148. end event
  149. type dw_uc from w_publ_edit_choice`dw_uc within w_sendway_edit_popup
  150. integer width = 3666
  151. integer height = 1304
  152. string dataobject = "dw_sendway_edit_ch"
  153. boolean hscrollbar = true
  154. end type
  155. type cb_rtr from w_publ_edit_choice`cb_rtr within w_sendway_edit_popup
  156. end type
  157. type cb_help from w_publ_edit_choice`cb_help within w_sendway_edit_popup
  158. integer x = 837
  159. end type
  160. type ln_bar from w_publ_edit_choice`ln_bar within w_sendway_edit_popup
  161. end type
  162. type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_sendway_edit_popup
  163. end type
  164. type r_bar from w_publ_edit_choice`r_bar within w_sendway_edit_popup
  165. end type