uo_cwork.sru 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  1. $PBExportHeader$uo_cwork.sru
  2. forward
  3. global type uo_cwork from nonvisualobject
  4. end type
  5. end forward
  6. global type uo_cwork from nonvisualobject
  7. end type
  8. global uo_cwork uo_cwork
  9. type variables
  10. public protectedwrite long billid //计件单自动增量id
  11. public protectedwrite string billcode //计件单的唯一编号
  12. public protectedwrite datetime opdate //建立时间,自动
  13. public protectedwrite string opemp //建立人
  14. public protectedwrite datetime moddate //修改时间,自动
  15. public protectedwrite string modemp //修改人
  16. public protectedwrite int flag=0 //审核标志
  17. public protectedwrite datetime auditingdate //审核时间
  18. public protectedwrite string auditingrep //审核操作员
  19. long empid
  20. datetime billdate
  21. decimal amt
  22. long wageid
  23. string reason
  24. string deptidea
  25. string idea
  26. datetime begindate
  27. datetime enddate
  28. long cworkid
  29. long wagemth
  30. uo_wage u_wage
  31. private:
  32. boolean it_newbegin=false //新建标志
  33. boolean it_updatebegin=false//修改标志
  34. end variables
  35. forward prototypes
  36. public function integer p_reset ()
  37. public function integer newbegin (ref string arg_msg)
  38. public function integer updatebegin (long arg_billid, ref string arg_msg)
  39. public function integer c_auditing (long arg_wageid, long arg_wagemth, ref string arg_msg, boolean arg_ifcommit)
  40. public function integer save (ref string arg_msg, boolean arg_ifcommit)
  41. public function integer del (long arg_billid, ref string arg_msg)
  42. public function integer auditing (long arg_wageid, long arg_wagemth, ref string arg_msg, boolean arg_ifcommit)
  43. public function integer add_deptidea (long arg_billid, string arg_newdescppart, ref string arg_msg)
  44. public function integer add_idea (long arg_billid, string arg_newdescppart, ref string arg_msg)
  45. end prototypes
  46. public function integer p_reset ();//INT p_RESET()
  47. //清除对象及其明细
  48. billid=0
  49. billcode=''
  50. opemp=''
  51. auditingrep=''
  52. flag=0
  53. empid=0
  54. amt=0
  55. reason=''
  56. wageid=0
  57. cworkid=0
  58. idea=''
  59. deptidea=''
  60. it_newbegin=FALSE
  61. it_updatebegin=FALSE
  62. RETURN 1
  63. end function
  64. public function integer newbegin (ref string arg_msg);p_reset()
  65. it_newbegin=TRUE
  66. it_updatebegin=FALSE
  67. return 1
  68. end function
  69. public function integer updatebegin (long arg_billid, ref string arg_msg);//====================================================================
  70. // Function: updatebegin(arg_billid,arg_msg)
  71. //--------------------------------------------------------------------
  72. // Description:
  73. //--------------------------------------------------------------------
  74. // Arguments:
  75. // value long arg_billid
  76. // reference string arg_msg
  77. //--------------------------------------------------------------------
  78. // Returns: integer
  79. //--------------------------------------------------------------------
  80. // Author: yyx Date: 2003.11.21
  81. //--------------------------------------------------------------------
  82. // Modify History:
  83. //
  84. //====================================================================
  85. int rslt = 1
  86. if arg_billid <= 0 then
  87. billid = 0
  88. arg_msg = '错误的单据ID'
  89. goto ext
  90. end if
  91. select
  92. u_gz_cwork.billcode,
  93. u_gz_cwork.billdate,
  94. u_gz_cwork.wagemth,
  95. u_gz_cwork.wageid,
  96. u_gz_cwork.empid,
  97. u_gz_cwork.amt,
  98. u_gz_cwork.reason,
  99. u_gz_cwork.deptidea,
  100. u_gz_cwork.begindate,
  101. u_gz_cwork.enddate,
  102. u_gz_cwork.idea,
  103. u_gz_cwork.flag
  104. into
  105. :billcode,
  106. :billdate,
  107. :wagemth,
  108. :wageid,
  109. :empid,
  110. :amt,
  111. :reason,
  112. :deptidea,
  113. :begindate,
  114. :enddate,
  115. :idea,
  116. :flag
  117. from u_gz_cwork where u_gz_cwork.billid = :arg_billid;
  118. if sqlca.sqlcode <> 0 then
  119. rslt = 0
  120. if pos(lower(sqlca.SQLErrText),'more than') > 0 then
  121. arg_msg = '查询操作失败,查询数据返回值多于一个'
  122. else
  123. arg_msg = '查询数据操作失败,考勤单(错误单据唯一码)'
  124. end if
  125. goto ext
  126. end if
  127. if flag = 1 then
  128. rslt = 0
  129. arg_msg = '单据已经审核,不可以修改'
  130. goto ext
  131. end if
  132. billid = arg_billid
  133. it_newbegin = false
  134. it_updatebegin = true
  135. ext:
  136. if rslt = 0 then p_reset()
  137. arg_msg = '考勤单,'+ arg_msg
  138. return rslt
  139. end function
  140. public function integer c_auditing (long arg_wageid, long arg_wagemth, ref string arg_msg, boolean arg_ifcommit);
  141. long cnt=0,i
  142. int rslt=1
  143. datetime null_server_dt
  144. setnull(null_server_dt)
  145. select count(*) into :cnt
  146. from u_gz_cwork
  147. where wagemth=:arg_wagemth
  148. and wageid = :arg_wageid
  149. and flag = 1;
  150. if sqlca.sqlcode<>0 then
  151. rslt=0
  152. arg_msg='查询考勤单失败'
  153. goto ext
  154. end if
  155. if cnt=0 then
  156. rslt=0
  157. arg_msg='该月的考勤单未审核,不用撤审!'
  158. goto ext
  159. end if
  160. select count(*) into :cnt from u_gz_wage
  161. where wagemth=:arg_wagemth and Auditingflag=1;
  162. if sqlca.sqlcode<>0 then
  163. rslt=0
  164. arg_msg='查询工资表失败'
  165. goto ext
  166. end if
  167. if cnt>0 then
  168. rslt=0
  169. arg_msg='该月的工资表已审核,不能撤审!'
  170. goto ext
  171. end if
  172. cnt=0
  173. select count(*) into :cnt from u_gz_wageitem where useflag=1 and wageid=:arg_wageid;
  174. if sqlca.sqlcode<>0 then
  175. rslt=0
  176. arg_msg='查询工资项目失败'
  177. goto ext
  178. end if
  179. if cnt=0 then
  180. rslt=0
  181. arg_msg='不存在该工资项目'
  182. goto ext
  183. end if
  184. update u_gz_cwork set
  185. flag=0,
  186. Auditrep='',
  187. Auditdate=:null_server_dt
  188. where wagemth=:arg_wagemth and flag=1 and wageid=:arg_wageid;
  189. if sqlca.sqlcode<>0 then
  190. ARG_msg='更新考勤单失败,原因:'+sqlca.sqlerrtext
  191. rslt=0
  192. goto ext
  193. end if
  194. update u_gz_wagemx set wageamt=0 where wageid=:arg_wageid and wagemth=:arg_wagemth;
  195. if sqlca.sqlcode<>0 then
  196. rslt=0
  197. arg_Msg='更新工资表失败!原因:'+sqlca.sqlerrtext
  198. goto ext
  199. end if
  200. ext:
  201. if rslt=0 then
  202. rollback;
  203. elseif rslt=1 and arg_ifcommit then
  204. commit;
  205. end if
  206. arg_msg = '考勤单,'+ arg_msg
  207. return rslt
  208. end function
  209. public function integer save (ref string arg_msg, boolean arg_ifcommit);//====================================================================
  210. // Function: save(arg_msg,arg_ifcommit)
  211. //--------------------------------------------------------------------
  212. // Description:
  213. //--------------------------------------------------------------------
  214. // Arguments:
  215. // reference string arg_msg
  216. // value boolean arg_ifcommit
  217. //--------------------------------------------------------------------
  218. // Returns: integer
  219. //--------------------------------------------------------------------
  220. // Author: yyx Date: 2003.11.21
  221. //--------------------------------------------------------------------
  222. // Modify History:
  223. //
  224. //====================================================================
  225. integer rslt = 1,cnt = 0,i
  226. datetime server_dt
  227. long ls_newid
  228. if isnull(empid) then empid = 0
  229. if isnull(amt) then amt = 0
  230. if isnull(wageid) then wageid = 0
  231. if isnull(wagemth) then wagemth = 0
  232. if isnull(reason) then reason = ''
  233. if isnull(deptidea) then deptidea = ''
  234. if isnull(idea) then idea = ''
  235. if isnull(cworkid) then cworkid = 0
  236. if it_newbegin = false and it_updatebegin = false then
  237. rslt = 0
  238. arg_msg = "非编辑状态不可以提交"
  239. goto ext
  240. end if
  241. select count(*) into :cnt
  242. from u_rs_empinfo
  243. where empid = :empid;
  244. if sqlca.sqlcode <> 0 then
  245. arg_msg = '查询人员资料失败'
  246. rslt = 0
  247. goto ext
  248. end if
  249. if cnt > 1 then
  250. arg_msg = '人员资料重复'
  251. rslt = 0
  252. goto ext
  253. end if
  254. cnt = 0
  255. select count(*) into :cnt
  256. from u_gz_cworkitem
  257. where cworkid = :cworkid;
  258. if sqlca.sqlcode <> 0 then
  259. arg_msg = '查询考勤项目资料失败'
  260. rslt = 0
  261. goto ext
  262. end if
  263. if cnt > 1 then
  264. arg_msg = '考勤项目重复'
  265. rslt = 0
  266. goto ext
  267. end if
  268. if wagemth = 0 then
  269. arg_msg = '错误的工资月份'
  270. rslt = 0
  271. goto ext
  272. end if
  273. if amt < 0 then
  274. arg_msg = '请输入正确的金额'
  275. rslt = 0
  276. goto ext
  277. end if
  278. select top 1 getdate() into :server_dt from u_user;
  279. //取得系统时间,借用操作员表
  280. if sqlca.sqlcode <> 0 then
  281. rslt = 0
  282. arg_msg = "查询操作失败,日期 "
  283. goto ext
  284. end if
  285. if year(date(billdate)) < 2000 or isnull(billdate) then
  286. rslt = 0
  287. arg_msg = "时间不合理"
  288. goto ext
  289. end if
  290. ////////////////////////////////////////////////开始区分:新建/更新 处理
  291. if billid = 0 then //新建
  292. ls_newid = f_sys_scidentity(0,"u_gz_cwork","billid",arg_msg,true,sqlca)
  293. if ls_newid <= 0 then
  294. rslt = 0
  295. goto ext
  296. end if
  297. billcode = getid(0,"KQ",date(server_dt),true,sqlca) //取得新单据编号
  298. if billcode = "err" then
  299. billcode = ''
  300. rslt = 0
  301. arg_msg = "无法获取考勤单编号"
  302. goto ext
  303. end if
  304. insert into u_gz_cwork (
  305. billid,
  306. billcode,
  307. billdate,
  308. Wagemth,
  309. wageid,
  310. empid,
  311. amt,
  312. reason,
  313. deptidea,
  314. idea,
  315. begindate,
  316. enddate,
  317. cworkid,
  318. opdate,
  319. opemp)
  320. values (
  321. :ls_newid,
  322. :billcode,
  323. :billdate,
  324. :Wagemth,
  325. :wageid,
  326. :empid,
  327. :amt,
  328. :reason,
  329. :deptidea,
  330. :idea,
  331. :begindate,
  332. :enddate,
  333. :cworkid,
  334. :server_dt,
  335. :publ_operator);
  336. if sqlca.sqlcode <> 0 then
  337. rslt = 0
  338. if pos(lower(sqlca.SQLErrText),'pk_u_gz_cwork') > 0 then
  339. arg_msg = '插入操作失败,关键字单据ID重复'
  340. elseif pos(lower(sqlca.SQLErrText),'ix_u_gz_cwork') > 0 then
  341. arg_msg = '插入操作失败,单据编号重复'
  342. else
  343. arg_msg = "因网络或其它原因导致插入操作失败>>"+"~n"+sqlca.sqlerrtext
  344. end if
  345. goto ext
  346. end if
  347. billid = ls_newid
  348. else //////////////////////////////////////////////////更新
  349. update u_gz_cwork
  350. set billdate = :billdate,
  351. wageid = :wageid,
  352. empid = :empid,
  353. amt = :amt,
  354. reason = :reason,
  355. deptidea = :deptidea,
  356. idea = :idea,
  357. moddate = :server_dt,
  358. modemp = :modemp,
  359. begindate = :begindate,
  360. enddate = :enddate,
  361. cworkid = :cworkid,
  362. Wagemth = :Wagemth
  363. where u_gz_cwork.billid = :billid
  364. and flag = 0;
  365. if sqlca.sqlcode <> 0 or sqlca.sqlnrows <= 0 then
  366. rslt = 0
  367. if pos(lower(sqlca.SQLErrText),'pk_u_gz_cwork') > 0 then
  368. arg_msg = '插入操作失败,关键字单据ID重复'
  369. elseif pos(lower(sqlca.SQLErrText),'ix_u_gz_cwork') > 0 then
  370. arg_msg = '插入操作失败,单据编号重复'
  371. else
  372. arg_msg = "因网络或其它原因导致插入操作失败>>"+"~n"+sqlca.sqlerrtext
  373. end if
  374. goto ext
  375. end if
  376. end if
  377. it_newbegin = false
  378. it_updatebegin = false
  379. ext:
  380. if rslt = 0 then
  381. rollback;
  382. elseif rslt=1 and arg_ifcommit then
  383. commit;
  384. end if
  385. arg_msg = '考勤单,'+ arg_msg
  386. return(rslt)
  387. end function
  388. public function integer del (long arg_billid, ref string arg_msg);//====================================================================
  389. // Function: del(arg_billid,arg_msg)
  390. //--------------------------------------------------------------------
  391. // Description:
  392. //--------------------------------------------------------------------
  393. // Arguments:
  394. // value long arg_billid
  395. // reference string arg_msg
  396. //--------------------------------------------------------------------
  397. // Returns: integer
  398. //--------------------------------------------------------------------
  399. // Author: yyx Date: 2003.11.21
  400. //--------------------------------------------------------------------
  401. // Modify History:
  402. //
  403. //====================================================================
  404. int rslt = 1
  405. if arg_billid <= 0 then
  406. rslt = 0
  407. arg_msg = "没有删除对象,操作取消"
  408. goto ext
  409. end if
  410. if it_newbegin or it_updatebegin then
  411. rslt=0
  412. arg_msg="编辑状态下不可以执行,操作取消"
  413. goto ext
  414. end if
  415. select u_gz_cwork.flag
  416. into :flag
  417. from u_gz_cwork
  418. where u_gz_cwork.billid = :arg_billid;
  419. if sqlca.sqlcode <> 0 then
  420. rslt = 0
  421. if pos(lower(sqlca.SQLErrText),'more than') > 0 then
  422. arg_msg = '查询操作失败,查询数据返回值多于一个'
  423. else
  424. arg_msg = '查询考勤单操作失败(错误单据唯一码)'
  425. end if
  426. goto ext
  427. end if
  428. if flag = 1 then
  429. rslt = 0
  430. arg_msg = "单据已经审核,不可以删除"
  431. goto ext
  432. end if
  433. delete from u_gz_cwork where u_gz_cwork.billid = :arg_billid;
  434. if sqlca.sqlcode <> 0 then
  435. rslt = 0
  436. arg_msg = "删除考勤单操作失败"+"~n"+sqlca.sqlerrtext
  437. goto ext
  438. end if
  439. commit;
  440. it_newbegin = false
  441. it_updatebegin = false
  442. ext:
  443. if rslt = 0 then
  444. rollback;
  445. p_reset()
  446. end if
  447. arg_msg = '考勤单,'+ arg_msg
  448. return (rslt)
  449. end function
  450. public function integer auditing (long arg_wageid, long arg_wagemth, ref string arg_msg, boolean arg_ifcommit);//====================================================================
  451. // Function: auditing()
  452. //--------------------------------------------------------------------
  453. // Description:
  454. //--------------------------------------------------------------------
  455. // Arguments:
  456. // value long arg_wageid
  457. // value long arg_wagemth
  458. // value datetime arg_enddate
  459. // reference string arg_msg
  460. // value boolean arg_ifcommit
  461. //--------------------------------------------------------------------
  462. // Returns: integer
  463. //--------------------------------------------------------------------
  464. // Author: yyx Date: 2004.10.19
  465. //--------------------------------------------------------------------
  466. // Modify History:
  467. //
  468. //====================================================================
  469. long cnt=0,i
  470. int rslt=1
  471. decimal ls_emp_sumwage
  472. datastore ds_emp_sumwage
  473. cnt=0
  474. select count(*) into :cnt
  475. from u_gz_cwork
  476. where wagemth=:arg_wagemth
  477. and wageid = :arg_wageid
  478. and flag=1;
  479. if sqlca.sqlcode<>0 then
  480. rslt=0
  481. arg_msg='查询考勤单明细失败!'
  482. goto ext
  483. end if
  484. if cnt>0 then
  485. rslt=0
  486. arg_msg='该月的考勤单已审核,审核前请先执行撤审!'
  487. goto ext
  488. end if
  489. cnt=0
  490. select count(*) into :cnt
  491. from u_gz_wageitem where useflag=1 and wageid=:arg_wageid;
  492. if sqlca.sqlcode<>0 then
  493. rslt=0
  494. arg_msg='查询工资项目失败!'
  495. goto ext
  496. end if
  497. if cnt=0 then
  498. rslt=0
  499. arg_msg='不存在该工资项目!'
  500. goto ext
  501. end if
  502. ds_emp_sumwage=create datastore
  503. ds_emp_sumwage.dataobject='dw_emp_sumcworkwage'
  504. ds_emp_sumwage.settransobject(sqlca)
  505. if ds_emp_sumwage.retrieve(arg_wagemth,arg_wageid)<=0 then
  506. rslt=0
  507. arg_msg='本月没有考勤单可审核或查询考勤单失败'
  508. goto ext
  509. end if
  510. for i= 1 to ds_emp_sumwage.rowcount()
  511. ls_emp_sumwage=0.00
  512. ls_emp_sumwage=ds_emp_sumwage.object.sumwage[i]
  513. if u_wage.f_setwagemxdata(arg_wagemth,ds_emp_sumwage.object.empid[i],arg_wageid,ls_emp_sumwage,arg_msg,false)=0 then
  514. rslt=0
  515. goto ext
  516. end if
  517. next
  518. update u_gz_cwork set
  519. flag=1,
  520. auditrep=:publ_operator,
  521. Auditdate=getdate()
  522. where wagemth = :arg_wagemth
  523. and wageid = :arg_wageid
  524. and flag = 0;
  525. if sqlca.sqlcode<>0 then
  526. ARG_msg='更新考勤单失败,原因>>'+sqlca.sqlerrtext
  527. rslt=0
  528. goto ext
  529. end if
  530. ext:
  531. if rslt=0 then
  532. rollback;
  533. elseif rslt=1 and arg_ifcommit then
  534. commit;
  535. end if
  536. arg_msg = '考勤单,'+ arg_msg
  537. return rslt
  538. end function
  539. public function integer add_deptidea (long arg_billid, string arg_newdescppart, ref string arg_msg);//====================================================================
  540. // Function: add_dscrp(arg_billid,arg_newdescppart,arg_msg)
  541. //--------------------------------------------------------------------
  542. // Description:
  543. //--------------------------------------------------------------------
  544. // Arguments:
  545. // value long arg_billid
  546. // value string arg_newdescppart
  547. // reference string arg_msg
  548. //--------------------------------------------------------------------
  549. // Returns: integer
  550. //--------------------------------------------------------------------
  551. // Author: yyx Date: 2003.11.21
  552. //--------------------------------------------------------------------
  553. // Modify History:
  554. //
  555. //====================================================================
  556. int rslt = 1
  557. arg_newdescppart = trim(arg_newdescppart)
  558. if arg_billid <= 0 then
  559. rslt = 0
  560. arg_msg = "没有编辑对象,操作取消"
  561. goto ext
  562. end if
  563. //if it_newbegin or it_updatebegin then
  564. // rslt=0
  565. // arg_msg="编辑状态下不可以执行,操作取消"
  566. // goto ext
  567. //end if
  568. select u_gz_cwork.flag
  569. into :flag
  570. from u_gz_cwork
  571. where u_gz_cwork.billid = :arg_billid;
  572. if sqlca.sqlcode <> 0 then
  573. rslt = 0
  574. if pos(lower(sqlca.SQLErrText),'more than') > 0 then
  575. arg_msg = '查询操作失败,查询数据返回值多于一个'
  576. else
  577. arg_msg = '查询考勤单操作失败(错误单据唯一码)'
  578. end if
  579. goto ext
  580. end if
  581. if flag = 0 then
  582. rslt = 0
  583. arg_msg = "非审核状态下不可用"
  584. goto ext
  585. end if
  586. update u_gz_cwork
  587. set deptidea = lTRIM(RTRIM(deptidea)) +' '+:arg_newdescppart
  588. where u_gz_cwork.billid = :arg_billid;
  589. if sqlca.sqlcode <> 0 then
  590. rollback ;
  591. rslt = 0
  592. arg_msg = "因网络或其它原因导致添加主管部门意见操作失败"+"~n"+sqlca.sqlerrtext
  593. goto ext
  594. end if
  595. commit;
  596. deptidea = deptidea+' '+arg_newdescppart
  597. ext:
  598. arg_msg = '考勤单,'+ arg_msg
  599. return (rslt)
  600. end function
  601. public function integer add_idea (long arg_billid, string arg_newdescppart, ref string arg_msg);
  602. Int rslt = 1
  603. arg_newdescppart = Trim(arg_newdescppart)
  604. IF arg_billid <= 0 THEN
  605. rslt = 0
  606. arg_msg = "没有编辑对象,操作取消"
  607. GOTO ext
  608. END IF
  609. //if it_newbegin or it_updatebegin then
  610. // rslt=0
  611. // arg_msg="编辑状态下不可以执行,操作取消"
  612. // goto ext
  613. //end if
  614. SELECT u_gz_cwork.flag
  615. INTO :flag
  616. FROM u_gz_cwork
  617. Where u_gz_cwork.billid = :arg_billid;
  618. IF sqlca.SQLCode <> 0 THEN
  619. rslt = 0
  620. IF Pos(Lower(sqlca.SQLErrText),'more than') > 0 THEN
  621. arg_msg = '查询操作失败,查询数据返回值多于一个'
  622. ELSE
  623. arg_msg = '查询考勤单操作失败(错误单据唯一码)'
  624. END IF
  625. GOTO ext
  626. END IF
  627. IF flag = 0 THEN
  628. rslt = 0
  629. arg_msg = "非审核状态下不可用"
  630. GOTO ext
  631. END IF
  632. UPDATE u_gz_cwork
  633. SET idea = lTRIM(RTRIM(idea)) +' '+:arg_newdescppart
  634. Where u_gz_cwork.billid = :arg_billid;
  635. IF sqlca.SQLCode <> 0 THEN
  636. rslt = 0
  637. arg_msg = "因网络或其它原因导致添加批示操作失败"+"~n"+sqlca.SQLErrText
  638. GOTO ext
  639. END IF
  640. idea = idea+' '+arg_newdescppart
  641. ext:
  642. IF rslt = 0 THEN
  643. arg_msg = '考勤单,'+ arg_msg
  644. ROLLBACK;
  645. ELSE
  646. COMMIT;
  647. END IF
  648. RETURN rslt
  649. end function
  650. on uo_cwork.create
  651. call super::create
  652. TriggerEvent( this, "constructor" )
  653. end on
  654. on uo_cwork.destroy
  655. TriggerEvent( this, "destructor" )
  656. call super::destroy
  657. end on
  658. event constructor; u_wage=create uo_wage
  659. end event
  660. event destructor;DESTROY u_wage
  661. end event