4e40b7e61c
- Aggiunto KeyID in KeyTable nel DB - ClientID può essere NULL in KeyTable nel DB - NewKeyPage: impostato Generated Number/LockID in base a IsDongle - Aggiunto Stato Key 'InDepositoEgt' - Sistemate comboBox e textBox delle KeyPages e di UpdateLicencePage - Avviso Number già esistente nella creazione Key
255 lines
7.4 KiB
VB.net
255 lines
7.4 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 String
|
|
Get
|
|
If (m_SelIsDongle = 1) Then
|
|
Return "Hardware"
|
|
End If
|
|
If (m_SelIsDongle = 0) Then
|
|
Return "Software"
|
|
Else
|
|
Return "---ANY---"
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
If value = "Hardware" Then
|
|
m_SelIsDongle = 1 ' True
|
|
' Rendo visibile Number e GeneratedLockID
|
|
Number_Visibility = Visibility.Visible
|
|
LockID_Visibility = Visibility.Collapsed
|
|
GeneratedNumber_Visibility = Visibility.Collapsed
|
|
GeneratedLockID_Visibility = Visibility.Visible
|
|
ElseIf value = "Software" Then ' Else
|
|
m_SelIsDongle = 0 ' False
|
|
' Rendo visibile LockID e GeneratedNumber
|
|
Number_Visibility = Visibility.Collapsed
|
|
LockID_Visibility = Visibility.Visible
|
|
GeneratedNumber_Visibility = Visibility.Visible
|
|
GeneratedLockID_Visibility = Visibility.Collapsed
|
|
Else
|
|
m_SelIsDongle = 2
|
|
Number_Visibility = Visibility.Collapsed
|
|
LockID_Visibility = Visibility.Collapsed
|
|
GeneratedNumber_Visibility = Visibility.Collapsed
|
|
GeneratedLockID_Visibility = Visibility.Collapsed
|
|
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_GeneratedLockID As String
|
|
Public Property GeneratedLockID As String
|
|
Get
|
|
Return m_GeneratedLockID
|
|
End Get
|
|
Set(value As String)
|
|
m_GeneratedLockID = value
|
|
NotifyPropertyChanged("GeneratedLockID")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_GeneratedLockID_Visibility As Visibility
|
|
Public Property GeneratedLockID_Visibility As Visibility
|
|
Get
|
|
Return m_GeneratedLockID_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_GeneratedLockID_Visibility = value
|
|
NotifyPropertyChanged("GeneratedLockID_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_GeneratedNumber As Integer
|
|
Public Property GeneratedNumber As Integer
|
|
Get
|
|
Return m_GeneratedNumber
|
|
End Get
|
|
Set(value As Integer)
|
|
m_GeneratedNumber = value
|
|
NotifyPropertyChanged("GeneratedNumber")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_GeneratedNumber_Visibility As Visibility
|
|
Public Property GeneratedNumber_Visibility As Visibility
|
|
Get
|
|
Return m_GeneratedNumber_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_GeneratedNumber_Visibility = value
|
|
NotifyPropertyChanged("GeneratedNumber_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", "InDepositoEgt", "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("InDepositoEgt")) Then m_SelState = Key.KeyState.InDepositoEgt
|
|
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 GeneratedLockIDMsg As String
|
|
Get
|
|
Return "Generated LockID"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property GeneratedNumberMsg As String
|
|
Get
|
|
Return "Generated Number"
|
|
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 = String.Empty
|
|
NotifyPropertyChanged("SelIsDongle")
|
|
|
|
' 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
|