w_item_cust_spt_mx_add.srw 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. $PBExportHeader$w_item_cust_spt_mx_add.srw
  2. forward
  3. global type w_item_cust_spt_mx_add from w_publ_base
  4. end type
  5. type cb_1 from uo_imflatbutton within w_item_cust_spt_mx_add
  6. end type
  7. type cb_2 from uo_imflatbutton within w_item_cust_spt_mx_add
  8. end type
  9. type sle_mxcode from singlelineedit within w_item_cust_spt_mx_add
  10. end type
  11. type sle_mxname from singlelineedit within w_item_cust_spt_mx_add
  12. end type
  13. type st_1 from statictext within w_item_cust_spt_mx_add
  14. end type
  15. type st_2 from statictext within w_item_cust_spt_mx_add
  16. end type
  17. end forward
  18. global type w_item_cust_spt_mx_add from w_publ_base
  19. integer width = 1641
  20. integer height = 812
  21. string title = "增项目"
  22. boolean minbox = false
  23. windowtype windowtype = response!
  24. cb_1 cb_1
  25. cb_2 cb_2
  26. sle_mxcode sle_mxcode
  27. sle_mxname sle_mxname
  28. st_1 st_1
  29. st_2 st_2
  30. end type
  31. global w_item_cust_spt_mx_add w_item_cust_spt_mx_add
  32. type variables
  33. Long il_itemid
  34. end variables
  35. forward prototypes
  36. public subroutine wf_new ()
  37. public function integer wf_save ()
  38. end prototypes
  39. public subroutine wf_new ();sle_mxcode.Text = ''
  40. sle_mxname.Text = ''
  41. sle_mxcode.SetFocus()
  42. end subroutine
  43. public function integer wf_save ();Int rslt = 1
  44. Long ll_mxid
  45. String arg_msg
  46. String ls_mxcode,ls_mxname
  47. Long cnt
  48. ls_mxcode = Trim(sle_mxcode.Text)
  49. ls_mxname = Trim(sle_mxname.Text)
  50. IF ls_mxcode = '' THEN
  51. arg_msg = '请输入编号'
  52. sle_mxcode.SetFocus()
  53. rslt = 0
  54. END IF
  55. IF ls_mxname = '' THEN
  56. arg_msg = '请输入名称'
  57. sle_mxname.SetFocus()
  58. rslt = 0
  59. END IF
  60. SELECT count(*) INTO :cnt
  61. FROM u_item_cust_spt_def
  62. Where itemid = :il_itemid;
  63. IF sqlca.SQLCode <> 0 THEN
  64. arg_msg = '查询项目资料失败,'+sqlca.SQLErrText
  65. rslt = 0
  66. GOTO ext
  67. END IF
  68. IF cnt <> 1 THEN
  69. arg_msg = '项目资料不存在或重复'
  70. rslt = 0
  71. GOTO ext
  72. END IF
  73. ll_mxid = f_sys_scidentity(0,"u_item_cust_spt_def_mx","mxid",arg_msg,TRUE,sqlca)
  74. IF ll_mxid <= 0 THEN
  75. rslt = 0
  76. GOTO ext
  77. END IF
  78. INSERT INTO u_item_cust_spt_def_mx
  79. (mxid,itemid,mxcode,mxname)
  80. Values(:ll_mxid,:il_itemid,:ls_mxcode,:ls_mxname);
  81. IF sqlca.SQLCode <> 0 THEN
  82. arg_msg = '建立明细项目资料失败,'+sqlca.SQLErrText
  83. rslt = 0
  84. GOTO ext
  85. END IF
  86. ext:
  87. IF rslt = 0 THEN
  88. ROLLBACK;
  89. MessageBox('错误',arg_msg,stopsign!,ok!)
  90. ELSE
  91. COMMIT;
  92. END IF
  93. RETURN rslt
  94. end function
  95. on w_item_cust_spt_mx_add.create
  96. int iCurrent
  97. call super::create
  98. this.cb_1=create cb_1
  99. this.cb_2=create cb_2
  100. this.sle_mxcode=create sle_mxcode
  101. this.sle_mxname=create sle_mxname
  102. this.st_1=create st_1
  103. this.st_2=create st_2
  104. iCurrent=UpperBound(this.Control)
  105. this.Control[iCurrent+1]=this.cb_1
  106. this.Control[iCurrent+2]=this.cb_2
  107. this.Control[iCurrent+3]=this.sle_mxcode
  108. this.Control[iCurrent+4]=this.sle_mxname
  109. this.Control[iCurrent+5]=this.st_1
  110. this.Control[iCurrent+6]=this.st_2
  111. end on
  112. on w_item_cust_spt_mx_add.destroy
  113. call super::destroy
  114. destroy(this.cb_1)
  115. destroy(this.cb_2)
  116. destroy(this.sle_mxcode)
  117. destroy(this.sle_mxname)
  118. destroy(this.st_1)
  119. destroy(this.st_2)
  120. end on
  121. event open;call super::open;il_itemid = Message.DoubleParm
  122. wf_new()
  123. end event
  124. type cb_func from w_publ_base`cb_func within w_item_cust_spt_mx_add
  125. boolean visible = false
  126. integer x = 517
  127. integer taborder = 40
  128. boolean enabled = false
  129. end type
  130. type cb_exit from w_publ_base`cb_exit within w_item_cust_spt_mx_add
  131. integer x = 1065
  132. integer y = 476
  133. end type
  134. type cb_1 from uo_imflatbutton within w_item_cust_spt_mx_add
  135. integer x = 119
  136. integer y = 476
  137. integer width = 389
  138. integer taborder = 50
  139. boolean bringtotop = true
  140. string text = "保存&新增"
  141. string normalpicname = "new.bmp"
  142. end type
  143. event clicked;call super::clicked;IF wf_save( ) = 1 THEN
  144. wf_new()
  145. END IF
  146. end event
  147. type cb_2 from uo_imflatbutton within w_item_cust_spt_mx_add
  148. integer x = 585
  149. integer y = 476
  150. integer width = 402
  151. integer taborder = 60
  152. boolean bringtotop = true
  153. string text = "保存&退出"
  154. string normalpicname = "save.bmp"
  155. end type
  156. event clicked;call super::clicked;IF wf_save( ) = 1 THEN
  157. Close(PARENT)
  158. END IF
  159. end event
  160. type sle_mxcode from singlelineedit within w_item_cust_spt_mx_add
  161. integer x = 549
  162. integer y = 160
  163. integer width = 366
  164. integer height = 84
  165. integer taborder = 20
  166. boolean bringtotop = true
  167. integer textsize = -9
  168. integer weight = 400
  169. fontcharset fontcharset = gb2312charset!
  170. fontpitch fontpitch = variable!
  171. string facename = "宋体"
  172. long textcolor = 33554432
  173. borderstyle borderstyle = stylelowered!
  174. end type
  175. type sle_mxname from singlelineedit within w_item_cust_spt_mx_add
  176. integer x = 549
  177. integer y = 296
  178. integer width = 558
  179. integer height = 84
  180. integer taborder = 30
  181. boolean bringtotop = true
  182. integer textsize = -9
  183. integer weight = 400
  184. fontcharset fontcharset = gb2312charset!
  185. fontpitch fontpitch = variable!
  186. string facename = "宋体"
  187. long textcolor = 33554432
  188. borderstyle borderstyle = stylelowered!
  189. end type
  190. type st_1 from statictext within w_item_cust_spt_mx_add
  191. integer x = 343
  192. integer y = 176
  193. integer width = 146
  194. integer height = 48
  195. boolean bringtotop = true
  196. integer textsize = -9
  197. integer weight = 400
  198. fontcharset fontcharset = gb2312charset!
  199. fontpitch fontpitch = variable!
  200. string facename = "宋体"
  201. long textcolor = 33554432
  202. long backcolor = 134217739
  203. string text = "编号"
  204. alignment alignment = center!
  205. boolean focusrectangle = false
  206. end type
  207. type st_2 from statictext within w_item_cust_spt_mx_add
  208. integer x = 343
  209. integer y = 312
  210. integer width = 146
  211. integer height = 48
  212. boolean bringtotop = true
  213. integer textsize = -9
  214. integer weight = 400
  215. fontcharset fontcharset = gb2312charset!
  216. fontpitch fontpitch = variable!
  217. string facename = "宋体"
  218. long textcolor = 33554432
  219. long backcolor = 134217739
  220. string text = "名称"
  221. alignment alignment = center!
  222. boolean focusrectangle = false
  223. end type