w_oppose_item_edit.srw 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. $PBExportHeader$w_oppose_item_edit.srw
  2. forward
  3. global type w_oppose_item_edit from w_publ_edit_choice
  4. end type
  5. type cb_view from uo_imflatbutton within w_oppose_item_edit
  6. end type
  7. end forward
  8. global type w_oppose_item_edit from w_publ_edit_choice
  9. integer width = 1586
  10. integer height = 1544
  11. string title = "投诉项目"
  12. boolean minbox = true
  13. windowtype windowtype = popup!
  14. cb_view cb_view
  15. end type
  16. global w_oppose_item_edit w_oppose_item_edit
  17. on w_oppose_item_edit.create
  18. int iCurrent
  19. call super::create
  20. this.cb_view=create cb_view
  21. iCurrent=UpperBound(this.Control)
  22. this.Control[iCurrent+1]=this.cb_view
  23. end on
  24. on w_oppose_item_edit.destroy
  25. call super::destroy
  26. destroy(this.cb_view)
  27. end on
  28. type cb_func from w_publ_edit_choice`cb_func within w_oppose_item_edit
  29. end type
  30. type cb_exit from w_publ_edit_choice`cb_exit within w_oppose_item_edit
  31. end type
  32. type cb_add from w_publ_edit_choice`cb_add within w_oppose_item_edit
  33. end type
  34. event cb_add::clicked;call super::clicked;if not f_power_ind(283) then
  35. messagebox('提示','你没有使用权限!', Information!, OK! )
  36. return
  37. end if
  38. long ll_newid,i
  39. string errmsg
  40. IF dw_edit_mode THEN
  41. dw_uc.accepttext()
  42. if dw_uc.GetNextModified(0, Primary!)=0 then
  43. MESSAGEBOX('提示','没有任何修改,不可以保存!', Information!, OK! )
  44. RETURN
  45. end if
  46. DW_UC.OBJECT.itemname[DW_UC.GETROW()]=TRIM(DW_UC.OBJECT.itemname[DW_UC.GETROW()])
  47. IF DW_UC.OBJECT.itemname[DW_UC.GETROW()]='' THEN
  48. MESSAGEBOX('提示','请输入项目名称!', Information!, OK! )
  49. RETURN
  50. END IF
  51. if dw_uc.object.itemid[dw_uc.getrow()]=0 then
  52. ll_newid=f_sys_scidentity(0,"u_oppose_item","itemid",errmsg,false,sqlca)
  53. if ll_newid<=0 then
  54. messagebox('提示',errmsg, Information!, OK! )
  55. return
  56. else
  57. dw_uc.object.itemid[DW_UC.GETROW()]=ll_newid
  58. end if
  59. end if
  60. end if
  61. IF dw_edit_mode THEN
  62. string ls_errmsg
  63. if dw_UC.Update() = -1 then
  64. if pos(ins_sqlerrtext,"Cannot insert duplicate key row")>0 then
  65. ls_errmsg="关键内容重复"
  66. else
  67. ls_errmsg="因为网络或其他原因>"+ins_sqlerrtext
  68. end if
  69. rollback;
  70. MessageBox ('提示',ls_errmsg+",保存操作失败!", Information!, OK! )
  71. LS_UPDATE_FLAG=FALSE
  72. RETURN
  73. else
  74. commit;
  75. for i=1 to 4
  76. dw_UC.SetTabOrder ( i, 0 )
  77. next
  78. LS_UPDATE_FLAG=TRUE
  79. end if
  80. ins_sqlerrtext=""
  81. ELSE
  82. long li_row, li_cur_row
  83. li_cur_row = dw_UC.GetRow()
  84. li_row = dw_UC.InsertRow (0)
  85. for i=1 to 4
  86. dw_UC.SetTabOrder ( i, i*10 )
  87. next
  88. dw_uc.selectrow(0,false)
  89. dw_UC.ScrollToRow (li_row)
  90. dw_uc.selectrow(li_row,true)
  91. dw_UC.SetFocus()
  92. modifyrow_no= li_row
  93. END IF
  94. dw_edit_mode= NOT dw_edit_mode
  95. WF_FACE_CHANGE()
  96. end event
  97. type cb_edit from w_publ_edit_choice`cb_edit within w_oppose_item_edit
  98. end type
  99. event cb_edit::clicked;call super::clicked;if not f_power_ind(283) then
  100. messagebox('提示','你没有使用权限!', Information!, OK! )
  101. return
  102. end if
  103. Long i
  104. IF dw_edit_mode THEN
  105. IF dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = NewModified! OR dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = New! THEN
  106. dw_uc.DeleteRow(dw_uc.GetRow())
  107. ELSE
  108. dw_uc.ReselectRow(dw_uc.GetRow())
  109. END IF
  110. FOR i = 1 TO 4
  111. dw_uc.SetTabOrder ( i, 0 )
  112. NEXT
  113. modifyrow_no = 0
  114. ELSE
  115. modifyrow_no = dw_uc.GetRow()
  116. FOR i = 1 TO 4
  117. dw_uc.SetTabOrder ( i, i*10 )
  118. NEXT
  119. dw_uc.SetFocus()
  120. dw_uc.SelectRow(0,FALSE)
  121. dw_uc.ScrollToRow (modifyrow_no)
  122. dw_uc.SelectRow(modifyrow_no,TRUE)
  123. END IF
  124. dw_edit_mode = NOT dw_edit_mode
  125. WF_FACE_CHANGE()
  126. end event
  127. type cb_delet from w_publ_edit_choice`cb_delet within w_oppose_item_edit
  128. end type
  129. event cb_delet::clicked;call super::clicked;if not f_power_ind(283) then
  130. messagebox('提示','你没有使用权限!', Information!, OK! )
  131. return
  132. end if
  133. IF MessageBox ('提示',"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  134. RETURN
  135. END IF
  136. string arg_msg
  137. IF DW_UC.GETROW()<=0 THEN
  138. MESSAGEBOX('提示','没有操作目标记录!', Information!, OK! )
  139. RETURN
  140. END IF
  141. long LS_LONG,ll_itemid
  142. ll_itemid = DW_UC.object.itemid[DW_UC.GETROW()]
  143. LS_LONG = 0
  144. SELECT COUNT(*) INTO :LS_LONG FROM u_oppose Where itemid = :ll_itemid ;
  145. IF SQLCA.SQLCode <> 0 THEN
  146. MessageBox ("提示","数据查询操作失败!(请重试!)", Information!, OK! )
  147. RETURN
  148. END IF
  149. IF LS_LONG > 0 THEN
  150. MessageBox ("提示","该资料已经使用于投诉单,不可以删除!", Information!, OK! )
  151. RETURN
  152. END IF
  153. dw_uc.SetRedraw (false)
  154. dw_UC.DeleteRow (0)
  155. dw_UC.TriggerEvent (rowfocuschanged!)
  156. if dw_UC.Update() = -1 then
  157. rollback;
  158. MessageBox ('提示',"删除记录操作失败!",Exclamation!,OK!)
  159. else
  160. commit;
  161. end if
  162. dw_uc.SetRedraw (true)
  163. end event
  164. type cb_choice from w_publ_edit_choice`cb_choice within w_oppose_item_edit
  165. boolean visible = false
  166. integer x = 1248
  167. boolean enabled = false
  168. end type
  169. type dw_uc from w_publ_edit_choice`dw_uc within w_oppose_item_edit
  170. integer width = 1559
  171. string dataobject = "dw_oppose_item"
  172. end type
  173. type cb_rtr from w_publ_edit_choice`cb_rtr within w_oppose_item_edit
  174. end type
  175. type cb_help from w_publ_edit_choice`cb_help within w_oppose_item_edit
  176. end type
  177. type ln_bar from w_publ_edit_choice`ln_bar within w_oppose_item_edit
  178. integer endx = 1563
  179. end type
  180. type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_oppose_item_edit
  181. integer endx = 1563
  182. end type
  183. type r_bar from w_publ_edit_choice`r_bar within w_oppose_item_edit
  184. integer x = 1426
  185. end type
  186. type cb_view from uo_imflatbutton within w_oppose_item_edit
  187. integer x = 837
  188. integer width = 151
  189. integer height = 164
  190. integer taborder = 30
  191. boolean bringtotop = true
  192. string text = "预览"
  193. string normalpicname = "preview.bmp"
  194. integer picsize = 16
  195. toolbaralignment pic_align = alignattop!
  196. boolean border = false
  197. end type
  198. event clicked;call super::clicked;S_print_MSG LS_PRMSG
  199. LS_PRMSG.obj_dwNAME = 'dw_rp_oppose_item'
  200. LS_PRMSG.SHARE_DW = DW_UC
  201. LS_PRMSG.TAG_TEXT = parent.title
  202. LS_PRMSG.SETUP_FLAG = 0
  203. LS_PRMSG.PAGECH_FLAG = 1
  204. OpenWithParm(w_publ_preview,LS_PRMSG)
  205. end event