2ff390d577
- Primo commit.
191 lines
5.6 KiB
VB.net
191 lines
5.6 KiB
VB.net
Imports EgtWPFLib5
|
|
|
|
Public Class KeyPageVM
|
|
Inherits VMBase
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Private m_IsDongleList As New List(Of String)({"Hardware", "Software", "---ANY---", " "})
|
|
Public ReadOnly Property IsDongleList As List(Of String)
|
|
Get
|
|
Return m_IsDongleList
|
|
End Get
|
|
End Property
|
|
|
|
Private m_SelIsDongle As Integer
|
|
Public Property SelIsDongle As Integer
|
|
Get
|
|
If (m_SelIsDongle = 1) Then
|
|
Return 0
|
|
End If
|
|
If (m_SelIsDongle = 0) Then
|
|
Return 1
|
|
Else
|
|
Return 2
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
If value = 0 Then
|
|
m_SelIsDongle = 1 ' True
|
|
' Rendo visibile Number
|
|
Number_Visibility = Visibility.Visible
|
|
LockID_Visibility = Visibility.Collapsed
|
|
ElseIf value = 1 Then ' Else
|
|
m_SelIsDongle = 0 ' False
|
|
' Rendo visibile LockID
|
|
Number_Visibility = Visibility.Collapsed
|
|
LockID_Visibility = Visibility.Visible
|
|
ElseIf value > 1 Then
|
|
m_SelIsDongle = 2
|
|
Number_Visibility = Visibility.Collapsed
|
|
LockID_Visibility = Visibility.Visible
|
|
End If
|
|
NotifyPropertyChanged("SelIsDongle")
|
|
End Set
|
|
End Property
|
|
Friend Function GetSelIsDongle() As Integer
|
|
Return m_SelIsDongle
|
|
End Function
|
|
|
|
Private m_Number_Visibility As Visibility
|
|
Public Property Number_Visibility As Visibility
|
|
Get
|
|
Return m_Number_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_Number_Visibility = value
|
|
NotifyPropertyChanged("Number_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_LockID As String
|
|
Public Property LockID As String
|
|
Get
|
|
Return m_LockID
|
|
End Get
|
|
Set(value As String)
|
|
m_LockID = value
|
|
NotifyPropertyChanged("LockID")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_LockID_Visibility As Visibility
|
|
Public Property LockID_Visibility As Visibility
|
|
Get
|
|
Return m_LockID_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_LockID_Visibility = value
|
|
NotifyPropertyChanged("LockID_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_ClientList As List(Of Client)
|
|
Public ReadOnly Property ClientList As List(Of Client)
|
|
Get
|
|
Return m_ClientList
|
|
End Get
|
|
End Property
|
|
Friend Sub SetClientList(value As List(Of Client))
|
|
m_ClientList = value
|
|
End Sub
|
|
|
|
Private m_SelClient As Client
|
|
Public Property SelClient As Client
|
|
Get
|
|
Return m_SelClient
|
|
End Get
|
|
Set(value As Client)
|
|
m_SelClient = value
|
|
NotifyPropertyChanged("SelClient")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_StateList As New List(Of String)({" ", "Consegnata", "InDeposito", "Guasta", "---ANY---"}) ' Key.KeyState)({Key.KeyState.Consegnata, Key.KeyState.InDeposito, Key.KeyState.Guasta, Key.KeyState.ANY})
|
|
Public ReadOnly Property StateList As List(Of String) ' Key.KeyState)
|
|
Get
|
|
Return m_StateList
|
|
End Get
|
|
End Property
|
|
Friend Sub SetStateList(value As List(Of String)) ' Key.KeyState))
|
|
m_StateList = value
|
|
End Sub
|
|
|
|
Private m_SelState As Key.KeyState
|
|
Public Property SelState As String
|
|
Get
|
|
Return m_SelState.ToString()
|
|
End Get
|
|
Set(value As String) ' Key.KeyState)
|
|
'm_SelState = value
|
|
If (value.Equals(" ")) Then m_SelState = Nothing
|
|
If (value.Equals("Consegnata")) Then m_SelState = Key.KeyState.Consegnata
|
|
If (value.Equals("InDeposito")) Then m_SelState = Key.KeyState.InDeposito
|
|
If (value.Equals("Guasta")) Then m_SelState = Key.KeyState.Guasta
|
|
If (value.Equals("---ANY---")) Then m_SelState = Key.KeyState.ANY
|
|
NotifyPropertyChanged("SelState")
|
|
End Set
|
|
End Property
|
|
|
|
#Region "Messages"
|
|
|
|
Public ReadOnly Property IsDongleMsg As String
|
|
Get
|
|
Return "Is dongle"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property NumberMsg As String
|
|
Get
|
|
Return "Number"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property LockIDMsg As String
|
|
Get
|
|
Return "LockID"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ClientNameMsg As String
|
|
Get
|
|
Return "Client name"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property StateMsg As String
|
|
Get
|
|
Return "State"
|
|
End Get
|
|
End Property
|
|
|
|
#End Region ' Messages
|
|
|
|
#End Region ' FIELDS & PROPERTIES
|
|
|
|
#Region "METHODS"
|
|
|
|
Friend Sub InitKeyPage()
|
|
|
|
' Svuoto campi
|
|
m_LockID = String.Empty
|
|
NotifyPropertyChanged("LockID")
|
|
|
|
' Carico valore di default IsDongle
|
|
SelIsDongle = 0
|
|
|
|
' Carico lista Client
|
|
Dim Query As String = "SELECT * FROM " & DB_CLIENT
|
|
m_ClientList = ManageDb.ExecuteClientQuery(Query)
|
|
m_ClientList.Add(New Client("---ANY---", 0, 0, ""))
|
|
NotifyPropertyChanged("ClientList")
|
|
|
|
' Carico valore di default State (InDeposito)
|
|
' m_SelState = Key.KeyState.Guasta
|
|
NotifyPropertyChanged("StateList")
|
|
End Sub
|
|
|
|
#End Region ' METHODS
|
|
|
|
End Class
|