-
Notifications
You must be signed in to change notification settings - Fork 3
/
M_omSeqFunctions.def
67 lines (58 loc) · 2.06 KB
/
M_omSeqFunctions.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Option Compare Database
Option Explicit
Const seqUrl = "http://seq.domainmmvii.local:5341/"
Public Enum omSeqItemLevel
NotDefinedSeqLevel = 0
DebugSeqLevel = 1
WarningSeqLevel = 2
ErrorSeqLevel = 3
End Enum
Public Function omSeqItemLevelToString(value As omSeqItemLevel) As String
Select Case value
Case omSeqItemLevel.DebugSeqLevel
omSeqItemLevelToString = "Debug"
Case omSeqItemLevel.WarningSeqLevel
omSeqItemLevelToString = "Warning"
Case omSeqItemLevel.ErrorSeqLevel
omSeqItemLevelToString = "Error"
End Select
End Function
Public Sub SendSeqItem(Optional seqItem As omSeqItem) 'item As omSeqItem)
Dim json As New omJSON
Dim result As String
If omObjectFunctions.IsNothing(seqItem) Then
Set seqItem = New omSeqItem
With seqItem
.ApplicationName = "MSAccess-Test"
.Level = ErrorSeqLevel
.action = "omSeqFunctions.SendSeqItem"
.Step = "self test"
End With
End If
result = json.request(seqUrl & "api/events/raw?clef", seqItem.ToJson(), text)
seqItem.Step = ""
seqItem.Level = DebugSeqLevel
seqItem.Exception = ""
seqItem.Parameters = ""
End Sub
Public Sub OpenSeq(Optional filter As String = "")
omFileFunctions.OpenUrl seqUrl & IIf(NotIsNullOrEmpty(filter), "#/events?filter=" & filter, "")
End Sub
Public Function GetUtcDateTime()
Dim dt As Object
Set dt = CreateObject("WbemScripting.SWbemDateTime")
dt.SetVarDate Now
GetUtcDateTime = dt.GetVarDate(False)
Set dt = Nothing
End Function
'ISO to Access
Public Function DtIsoToAccess(myisodate As String) As Date
DtIsoToAccess = CDate(Replace(myisodate, "T", " "))
End Function
'Access to ISO
Public Function DtAccessToIso(myaccdate As Date, Optional myUtcDate As Date = 0) As String
Dim dtDiff As Long
myUtcDate = IIf(myUtcDate = 0, myaccdate, myUtcDate)
dtDiff = DateDiff("h", myUtcDate, myaccdate)
DtAccessToIso = format(myaccdate, "yyyy-mm-dd\Thh:nn:ss.000" & IIf(dtDiff = 0, "z", format(dtDiff, "+00") & ":00"))
End Function