123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- $PBExportHeader$uo_ljsmc.sru
- forward
- global type uo_ljsmc from nonvisualobject
- end type
- end forward
- global type uo_ljsmc from nonvisualobject
- end type
- global uo_ljsmc uo_ljsmc
- forward prototypes
- public function integer uf_getservicestatus (ref datawindow arg_dw, ref string arg_msg)
- public function integer uf_getinstancestatus (string arg_servername, ref datawindow arg_dw, ref string arg_msg)
- public function integer uf_update (string arg_servername, ref string arg_msg)
- end prototypes
- public function integer uf_getservicestatus (ref datawindow arg_dw, ref string arg_msg);Int rslt = 1
- uo_ljsmcproxy uo_proxy
- uo_proxy = Create uo_ljsmcproxy
- IF Not IsValid(arg_dw) THEN
- rslt = 0
- arg_msg = 'arg_dw无效'
- GOTO ext
- END IF
- oleobject ljsmc
- IF uo_proxy.getproxy(Ref ljsmc, Ref arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- oleobject rsp
- rsp = ljsmc.GetServiceStatus()
- IF Not IsNull(rsp.ErrMsg) THEN
- rslt = 0
- arg_msg = rsp.ErrMsg
- GOTO ext
- END IF
- arg_dw.Reset()
- Long cnt, i, row
- oleobject status
- cnt = rsp.ServicesStatusList.Count
- FOR i = 0 To cnt - 1
- status = rsp.ServicesStatusList.GetItem(i)
- row = arg_dw.InsertRow(0)
- arg_dw.Object.ServerName[row] = status.ServerName
- arg_dw.Object.DisplayName[row] = status.DisplayName
- arg_dw.Object.Description[row] = status.Description
- arg_dw.Object.Version[row] = status.Version
- arg_dw.Object.NewVersion[row] = status.NewVersion
- arg_dw.Object.downing[row] = status.downing
- arg_dw.Object.Auto[row] = status.Auto
- arg_dw.Object.SingleInstance[row] = status.SingleInstance
- NEXT
- ext:
- Destroy uo_proxy
- RETURN rslt
- end function
- public function integer uf_getinstancestatus (string arg_servername, ref datawindow arg_dw, ref string arg_msg);Int rslt = 1
- uo_ljsmcproxy uo_proxy
- uo_proxy = Create uo_ljsmcproxy
- IF Not IsValid(arg_dw) THEN
- rslt = 0
- arg_msg = 'arg_dw无效'
- GOTO ext
- END IF
- oleobject ljsmc
- IF uo_proxy.getproxy(Ref ljsmc, Ref arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- oleobject rsp
- rsp = ljsmc.GetInstanceStatus(arg_servername)
- IF Not IsNull(rsp.ErrMsg) THEN
- rslt = 0
- arg_msg = rsp.ErrMsg
- GOTO ext
- END IF
- arg_dw.Reset()
- Long cnt, i, row
- oleobject status
- cnt = rsp.InstanceStatusList.Count
- FOR i = 0 To cnt - 1
- status = rsp.InstanceStatusList.GetItem(i)
- row = arg_dw.InsertRow(0)
- arg_dw.Object.instance[row] = status.instanc
- arg_dw.Object.status[row] = status.status
- NEXT
- ext:
- Destroy uo_proxy
- RETURN rslt
- end function
- public function integer uf_update (string arg_servername, ref string arg_msg);Int rslt = 1
- uo_ljsmcproxy uo_proxy
- uo_proxy = Create uo_ljsmcproxy
- oleobject ljsmc
- IF uo_proxy.getproxy(Ref ljsmc, Ref arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- any rsp
- rsp = ljsmc.Update(arg_servername)
- IF Not IsNull(rsp) THEN
- rslt = 0
- arg_msg = rsp
- GOTO ext
- END IF
- ext:
- Destroy uo_proxy
- RETURN rslt
- end function
- on uo_ljsmc.create
- call super::create
- TriggerEvent( this, "constructor" )
- end on
- on uo_ljsmc.destroy
- TriggerEvent( this, "destructor" )
- call super::destroy
- end on
|