uo_kms_set.sru 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. $PBExportHeader$uo_kms_set.sru
  2. forward
  3. global type uo_kms_set from nonvisualobject
  4. end type
  5. end forward
  6. global type uo_kms_set from nonvisualobject
  7. end type
  8. global uo_kms_set uo_kms_set
  9. type variables
  10. datastore ins_ds
  11. end variables
  12. forward prototypes
  13. public subroutine addmsg (string msgid)
  14. public subroutine addmsg (string msgid, string arg0)
  15. public subroutine addmsg (string msgid, string arg0, string arg1)
  16. public subroutine addmsg (string msgid, string arg0, string arg1, string arg2)
  17. public subroutine addmsg (string msgid, string arg0, string arg1, string arg2, string arg3)
  18. public subroutine addmsg (string msgid, string arg0, string arg1, string arg2, string arg3, string arg4)
  19. public function long count ()
  20. end prototypes
  21. public subroutine addmsg (string msgid);addmsg(msgid,"","","","","")
  22. end subroutine
  23. public subroutine addmsg (string msgid, string arg0);addmsg(msgid,arg0,"","","","")
  24. end subroutine
  25. public subroutine addmsg (string msgid, string arg0, string arg1);addmsg(msgid,arg0,arg1,"","","")
  26. end subroutine
  27. public subroutine addmsg (string msgid, string arg0, string arg1, string arg2);addmsg(msgid,arg0,arg1,arg2,"","")
  28. end subroutine
  29. public subroutine addmsg (string msgid, string arg0, string arg1, string arg2, string arg3);addmsg(msgid,arg0,arg1,arg2,arg3,"")
  30. end subroutine
  31. public subroutine addmsg (string msgid, string arg0, string arg1, string arg2, string arg3, string arg4);IF IsNull(msgid) THEN RETURN
  32. msgid = Trim(msgid)
  33. IF msgid = "" THEN RETURN
  34. Long ll_row
  35. IF ins_ds.RowCount() > 0 THEN
  36. ll_row = ins_ds.Find("msgid = '"+msgid+"'", 1, ins_ds.RowCount())
  37. END IF
  38. IF ll_row = 0 THEN
  39. ll_row = ins_ds.InsertRow(0)
  40. ins_ds.Object.msgid[ll_row] = msgid
  41. END IF
  42. string arr_arg[], arr_col[], ls_tmp
  43. arr_arg = {arg0, arg1, arg2, arg3, arg4}
  44. arr_col = {"arg0", "arg1", "arg2", "arg3", "arg4"}
  45. Int li_i
  46. FOR li_i = 1 TO UpperBound(arr_arg)
  47. IF IsNull(arr_arg[li_i]) THEN CONTINUE
  48. IF Trim(arr_arg[li_i]) = "" THEN CONTINUE
  49. ls_tmp = ins_ds.GetItemString(ll_row, arr_col[li_i])
  50. IF Len(ls_tmp) > 0 THEN
  51. IF POS("," + ls_tmp + ",", "," + arr_arg[li_i] + ",") > 0 THEN
  52. CONTINUE
  53. END IF
  54. END IF
  55. ins_ds.SetItem(ll_row, arr_col[li_i], ls_tmp + "," + arr_arg[li_i])
  56. NEXT
  57. end subroutine
  58. public function long count ();return ins_ds.RowCount()
  59. end function
  60. on uo_kms_set.create
  61. call super::create
  62. TriggerEvent( this, "constructor" )
  63. end on
  64. on uo_kms_set.destroy
  65. TriggerEvent( this, "destructor" )
  66. call super::destroy
  67. end on
  68. event constructor;ins_ds = CREATE datastore
  69. ins_ds.DataObject = "dw_kms_set"
  70. end event