-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclsOpportunityState.cls
More file actions
80 lines (67 loc) · 2.46 KB
/
Copy pathclsOpportunityState.cls
File metadata and controls
80 lines (67 loc) · 2.46 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "clsOpportunityState"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'@Description: Estado relacionado con la oportunidad actual
'@Category: State
'@Folder "3-Dominio.1-Estado"
Option Explicit
Private Const MODULE_NAME As String = "clsOpportunityState"
' ==========================================
' ESTADO DE OPORTUNIDAD
' ==========================================
Private mCurrentOpportunity As clsOpportunity
Private mCurrentIndex As Long
' ==========================================
' INICIALIZACIÓN
' ==========================================
Private Sub Class_Initialize()
Set mCurrentOpportunity = Nothing
mCurrentIndex = -1
End Sub
Private Sub Class_Terminate()
Set mCurrentOpportunity = Nothing
End Sub
' ==========================================
' PROPIEDADES PÚBLICAS
' ==========================================
'@Description: Obtiene o establece la oportunidad actual
Public Property Get CurrentOpportunity() As clsOpportunity
Set CurrentOpportunity = mCurrentOpportunity
End Property
Friend Property Set CurrentOpportunity(op As clsOpportunity)
Set mCurrentOpportunity = op
LogDebug MODULE_NAME, "[CurrentOpportunity] Changed to: " & GetCurrentOpportunityLabel()
End Property
'@Description: Obtiene o establece el índice de la oportunidad actual en la colección
Public Property Get CurrentIndex() As Long
CurrentIndex = mCurrentIndex
End Property
Friend Property Let CurrentIndex(Value As Long)
mCurrentIndex = Value
LogDebug MODULE_NAME, "[CurrentIndex] Changed to: " & Value
End Property
' ==========================================
' CONSULTAS DE ESTADO
' ==========================================
'@Description: Indica si hay una oportunidad actualmente seleccionada
Public Function HasCurrentOpportunity() As Boolean
HasCurrentOpportunity = Not (mCurrentOpportunity Is Nothing)
End Function
'@Description: Obtiene el label/nombre de la oportunidad actual
'@Returns: String con el nombre de la oportunidad o "(ninguna)"
Public Function GetCurrentOpportunityLabel() As String
If mCurrentOpportunity Is Nothing Then
GetCurrentOpportunityLabel = "(ninguna)"
Else
On Error Resume Next
GetCurrentOpportunityLabel = mCurrentOpportunity.Label
If Err.Number <> 0 Then GetCurrentOpportunityLabel = "(error)"
On Error GoTo 0
End If
End Function