w_ljfieb_cominfo.srw 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. $PBExportHeader$w_ljfieb_cominfo.srw
  2. forward
  3. global type w_ljfieb_cominfo from w_publ_base
  4. end type
  5. type cb_save from uo_imflatbutton within w_ljfieb_cominfo
  6. end type
  7. type dw_1 from datawindow within w_ljfieb_cominfo
  8. end type
  9. type cb_reflash from uo_imflatbutton within w_ljfieb_cominfo
  10. end type
  11. end forward
  12. global type w_ljfieb_cominfo from w_publ_base
  13. integer width = 1650
  14. integer height = 1692
  15. string title = ""
  16. boolean minbox = false
  17. boolean center = true
  18. event ue_modpsw ( )
  19. event ue_address ( )
  20. cb_save cb_save
  21. dw_1 dw_1
  22. cb_reflash cb_reflash
  23. end type
  24. global w_ljfieb_cominfo w_ljfieb_cominfo
  25. type variables
  26. s_ljfieb_cominfo s_org_info
  27. end variables
  28. forward prototypes
  29. public function integer wf_fromdw (ref s_ljfieb_cominfo arg_cominfo, ref string arg_msg)
  30. public function integer wf_fromdb (ref s_ljfieb_cominfo arg_cominfo, ref string arg_msg)
  31. public function integer wf_save (ref string arg_msg)
  32. end prototypes
  33. event ue_modpsw();OpenWithParm(w_ljfieb_modpsw, dw_1.Object.psw[dw_1.GetRow()])
  34. s_ljfieb_modpsw s_rslt
  35. s_rslt = Message.PowerObjectParm
  36. IF s_rslt.ifok = 1 THEN
  37. dw_1.Object.newpsw[dw_1.GetRow()] = s_rslt.newpsw
  38. END IF
  39. end event
  40. event ue_address();s_view_dscrp s_view,s_return
  41. String ls_dscrp
  42. dw_1.AcceptText()
  43. ls_dscrp = dw_1.Object.Address[dw_1.GetRow()]
  44. s_view.Title = '地址'
  45. s_view.dscrp = ls_dscrp
  46. s_view.editmode = True
  47. OpenWithParm(w_view_dscrp,s_view)
  48. s_return = Message.PowerObjectParm
  49. dw_1.Object.Address[dw_1.GetRow()] = s_return.dscrp
  50. end event
  51. public function integer wf_fromdw (ref s_ljfieb_cominfo arg_cominfo, ref string arg_msg);Int rslt = 1
  52. Long row
  53. row = dw_1.GetRow()
  54. IF row <= 0 THEN
  55. rslt = 0
  56. arg_msg = '没有数据内容'
  57. GOTO ext
  58. END IF
  59. arg_cominfo.cusid = dw_1.Object.cusid[row]
  60. arg_cominfo.username = dw_1.Object.username[row]
  61. arg_cominfo.psw = dw_1.Object.psw[row]
  62. arg_cominfo.tele = dw_1.Object.tele[row]
  63. arg_cominfo.phone = dw_1.Object.phone[row]
  64. arg_cominfo.address = dw_1.Object.address[row]
  65. arg_cominfo.comcode = dw_1.Object.comcode[row]
  66. arg_cominfo.userid = dw_1.Object.userid[row]
  67. arg_cominfo.usercode = dw_1.Object.usercode[row]
  68. arg_cominfo.uploading = dw_1.Object.uploading[row]
  69. arg_cominfo.auditflag = dw_1.Object.auditflag[row]
  70. arg_cominfo.newpsw = dw_1.Object.newpsw[row]
  71. arg_cominfo.errmsg = dw_1.Object.errmsg[row]
  72. ext:
  73. RETURN rslt
  74. end function
  75. public function integer wf_fromdb (ref s_ljfieb_cominfo arg_cominfo, ref string arg_msg);Int rslt = 1
  76. SELECT cusid,
  77. username,
  78. psw,
  79. tele,
  80. phone,
  81. address,
  82. comcode,
  83. userid,
  84. usercode,
  85. uploading,
  86. auditflag,
  87. newpsw,
  88. errmsg
  89. INTO :arg_cominfo.cusid,
  90. :arg_cominfo.username,
  91. :arg_cominfo.psw,
  92. :arg_cominfo.tele,
  93. :arg_cominfo.phone,
  94. :arg_cominfo.address,
  95. :arg_cominfo.comcode,
  96. :arg_cominfo.userid,
  97. :arg_cominfo.usercode,
  98. :arg_cominfo.uploading,
  99. :arg_cominfo.auditflag,
  100. :arg_cominfo.newpsw,
  101. :arg_cominfo.errmsg
  102. FROM LJFIEB_ComInfo
  103. Using sys_email_sqlca;
  104. IF sys_email_sqlca.SQLCode <> 0 THEN
  105. rslt = 0
  106. arg_msg = '查询企业注册信息失败,' + sys_email_sqlca.SQLErrText
  107. GOTO ext
  108. END IF
  109. ext:
  110. RETURN rslt
  111. end function
  112. public function integer wf_save (ref string arg_msg);Int rslt = 1
  113. s_ljfieb_cominfo s_curinfo
  114. s_ljfieb_cominfo s_curdb
  115. dw_1.AcceptText()
  116. IF wf_fromdw(s_curinfo, arg_msg) <> 1 THEN
  117. rslt = 0
  118. GOTO ext
  119. END IF
  120. IF wf_fromdb(s_curdb, arg_msg) <> 1 THEN
  121. rslt = 0
  122. GOTO ext
  123. END IF
  124. IF s_curinfo.UserID = 0 THEN
  125. if s_curdb <> s_org_info then
  126. if s_curdb.UserID > 0 then
  127. rslt = 0
  128. arg_msg = ''
  129. goto ext
  130. else
  131. end if
  132. end if
  133. ELSE
  134. END IF
  135. ext:
  136. IF rslt = 1 THEN
  137. COMMIT Using sys_email_sqlca;
  138. ELSE
  139. ROLLBACK Using sys_email_sqlca;
  140. END IF
  141. RETURN rslt
  142. end function
  143. on w_ljfieb_cominfo.create
  144. int iCurrent
  145. call super::create
  146. this.cb_save=create cb_save
  147. this.dw_1=create dw_1
  148. this.cb_reflash=create cb_reflash
  149. iCurrent=UpperBound(this.Control)
  150. this.Control[iCurrent+1]=this.cb_save
  151. this.Control[iCurrent+2]=this.dw_1
  152. this.Control[iCurrent+3]=this.cb_reflash
  153. end on
  154. on w_ljfieb_cominfo.destroy
  155. call super::destroy
  156. destroy(this.cb_save)
  157. destroy(this.dw_1)
  158. destroy(this.cb_reflash)
  159. end on
  160. event open;call super::open;Int rslt = 1
  161. String arg_msg = ''
  162. Long ll_cnt
  163. IF sys_email_sqlca.DBHandle() = 0 THEN
  164. rslt = 0
  165. arg_msg = '未设置邮件数据库'
  166. GOTO ext
  167. END IF
  168. dw_1.SetTransObject(sys_email_sqlca)
  169. ll_cnt = dw_1.Retrieve()
  170. IF ll_cnt = 0 THEN
  171. rslt = 0
  172. arg_msg = '通信后台服务未初始化,不能使用'
  173. GOTO ext
  174. END IF
  175. IF wf_fromdw(s_org_info, arg_msg) <> 1 THEN
  176. rslt = 0
  177. GOTO ext
  178. END IF
  179. IF ll_cnt > 1 THEN
  180. rslt = 0
  181. arg_msg = '注册信息异常,LJFIEB_ComInfo出现多条记录'
  182. GOTO ext
  183. END IF
  184. ext:
  185. IF rslt = 0 THEN
  186. MessageBox('ERROR', arg_msg)
  187. cb_exit.PostEvent(Clicked!)
  188. END IF
  189. end event
  190. type cb_func from w_publ_base`cb_func within w_ljfieb_cominfo
  191. boolean visible = false
  192. end type
  193. type cb_exit from w_publ_base`cb_exit within w_ljfieb_cominfo
  194. integer x = 1294
  195. integer y = 1496
  196. end type
  197. type cb_save from uo_imflatbutton within w_ljfieb_cominfo
  198. integer x = 969
  199. integer y = 1496
  200. integer width = 311
  201. integer height = 96
  202. integer taborder = 30
  203. boolean bringtotop = true
  204. end type
  205. event clicked;call super::clicked;s_ljfieb_cominfo s_curinfo
  206. s_ljfieb_cominfo s_curdb
  207. dw_1.AcceptText()
  208. String arg_msg
  209. Int rslt = 1
  210. IF wf_fromdw(s_curinfo, arg_msg) <> 1 THEN
  211. MessageBox('ERROR', arg_msg)
  212. RETURN
  213. END IF
  214. IF s_curinfo.username = '' THEN
  215. MessageBox('ERROR', '请输入企业名称')
  216. dw_1.SetColumn('username')
  217. dw_1.SetFocus()
  218. RETURN
  219. END IF
  220. IF s_curinfo.tele = '' THEN
  221. MessageBox('ERROR', '请输入固定电话')
  222. dw_1.SetColumn('tele')
  223. dw_1.SetFocus()
  224. RETURN
  225. END IF
  226. IF s_curinfo.phone = '' THEN
  227. MessageBox('ERROR', '请输入手机号码')
  228. dw_1.SetColumn('phone')
  229. dw_1.SetFocus()
  230. RETURN
  231. END IF
  232. IF s_curinfo.Address = '' THEN
  233. MessageBox('ERROR', '请输入地址')
  234. dw_1.SetColumn('address')
  235. dw_1.SetFocus()
  236. RETURN
  237. END IF
  238. IF s_curinfo.comcode = '' THEN
  239. MessageBox('ERROR', '请输入机构代码')
  240. dw_1.SetColumn('comcode')
  241. dw_1.SetFocus()
  242. RETURN
  243. END IF
  244. IF wf_fromdb(s_curdb, arg_msg) <> 1 THEN
  245. MessageBox('ERROR', arg_msg)
  246. RETURN
  247. END IF
  248. IF s_curdb <> s_org_info THEN
  249. MessageBox('ERROR', '注册信息已经发生改变,请刷新后再修改')
  250. RETURN
  251. END IF
  252. IF s_curdb.uploading = 2 THEN
  253. MessageBox('ERROR', '注册信息正在处理不能保存,请刷新后再修改')
  254. RETURN
  255. END IF
  256. IF s_curdb.UserID = 0 THEN
  257. IF s_curinfo.psw = '' THEN
  258. MessageBox('ERROR', '请输入密码')
  259. dw_1.SetColumn('psw')
  260. dw_1.SetFocus()
  261. RETURN
  262. END IF
  263. IF s_curinfo.newpsw <> s_curinfo.psw THEN
  264. MessageBox('ERROR', '确认密码与原密码不相符')
  265. dw_1.SetColumn('newpsw')
  266. dw_1.SetFocus()
  267. RETURN
  268. END IF
  269. UPDATE LJFIEB_ComInfo SET
  270. username = :s_curinfo.username,
  271. psw = :s_curinfo.psw,
  272. newpsw = :s_curinfo.newpsw,
  273. tele = :s_curinfo.tele,
  274. phone = :s_curinfo.phone,
  275. address = :s_curinfo.address,
  276. comcode = :s_curinfo.comcode,
  277. uploading = 1,
  278. auditflag = 0,
  279. errmsg = ''
  280. WHERE cusid = :s_org_info.cusid AND
  281. username = :s_org_info.username AND
  282. psw = :s_org_info.psw AND
  283. tele = :s_org_info.tele AND
  284. phone = :s_org_info.phone AND
  285. address = :s_org_info.address AND
  286. comcode = :s_org_info.comcode AND
  287. userid = :s_org_info.userid AND
  288. usercode = :s_org_info.usercode AND
  289. uploading = :s_org_info.uploading AND
  290. auditflag = :s_org_info.auditflag AND
  291. newpsw = :s_org_info.newpsw
  292. Using sys_email_sqlca;
  293. IF sys_email_sqlca.SQLCode <> 0 THEN
  294. rslt = 0
  295. arg_msg = '更新注册信息失败,' + sys_email_sqlca.SQLErrText
  296. GOTO ext
  297. END IF
  298. IF sys_email_sqlca.SQLNRows <> 1 THEN
  299. rslt = 0
  300. arg_msg = '2.注册信息已经发生改变,请刷新后再修改'
  301. GOTO ext
  302. END IF
  303. ELSE
  304. UPDATE LJFIEB_ComInfo SET
  305. username = :s_curinfo.username,
  306. newpsw = :s_curinfo.newpsw,
  307. tele = :s_curinfo.tele,
  308. phone = :s_curinfo.phone,
  309. address = :s_curinfo.address,
  310. comcode = :s_curinfo.comcode,
  311. uploading = 1,
  312. auditflag = 0,
  313. errmsg = ''
  314. WHERE cusid = :s_org_info.cusid AND
  315. username = :s_org_info.username AND
  316. psw = :s_org_info.psw AND
  317. tele = :s_org_info.tele AND
  318. phone = :s_org_info.phone AND
  319. address = :s_org_info.address AND
  320. comcode = :s_org_info.comcode AND
  321. userid = :s_org_info.userid AND
  322. usercode = :s_org_info.usercode AND
  323. uploading = :s_org_info.uploading AND
  324. auditflag = :s_org_info.auditflag AND
  325. newpsw = :s_org_info.newpsw
  326. Using sys_email_sqlca;
  327. IF sys_email_sqlca.SQLCode <> 0 THEN
  328. rslt = 0
  329. arg_msg = '更新注册信息失败,' + sys_email_sqlca.SQLErrText
  330. GOTO ext
  331. END IF
  332. IF sys_email_sqlca.SQLNRows <> 1 THEN
  333. rslt = 0
  334. arg_msg = '2.注册信息已经发生改变,请刷新后再修改'
  335. GOTO ext
  336. END IF
  337. END IF
  338. ext:
  339. IF rslt = 1 THEN
  340. COMMIT Using sys_email_sqlca;
  341. MessageBox('OK', '保存成功')
  342. Close(Parent)
  343. ELSE
  344. ROLLBACK Using sys_email_sqlca;
  345. MessageBox('ERROR', arg_msg)
  346. END IF
  347. end event
  348. type dw_1 from datawindow within w_ljfieb_cominfo
  349. integer x = 46
  350. integer y = 20
  351. integer width = 1545
  352. integer height = 1428
  353. integer taborder = 30
  354. boolean bringtotop = true
  355. string title = "none"
  356. string dataobject = "dw_ljfieb_cominfo"
  357. boolean border = false
  358. boolean livescroll = true
  359. borderstyle borderstyle = stylelowered!
  360. end type
  361. event clicked;IF row <= 0 THEN RETURN
  362. IF dwo.Name = 'b_psw' THEN
  363. Parent.TriggerEvent('ue_modpsw')
  364. ELSEIF dwo.Name = 'p_1' THEN
  365. Parent.TriggerEvent('ue_address')
  366. END IF
  367. end event
  368. type cb_reflash from uo_imflatbutton within w_ljfieb_cominfo
  369. integer x = 178
  370. integer y = 1496
  371. integer width = 311
  372. integer height = 96
  373. integer taborder = 40
  374. boolean bringtotop = true
  375. string text = "刷新"
  376. end type
  377. event clicked;call super::clicked;string arg_msg
  378. dw_1.Retrieve()
  379. IF wf_fromdw(s_org_info, arg_msg) <> 1 THEN
  380. MessageBox('ERROR', arg_msg)
  381. END IF
  382. end event