fad3d5160b
- Colonna LicenceFileContent sostituita con ExpirationDate in SearchLicencePage - Aggiunto riquadro Note a LicenceBox - Modificate larghezze colonne in SearchLicencePage
614 lines
21 KiB
VB.net
614 lines
21 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class MainMenuVM
|
|
Inherits VMBase
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Private Const MULTIAX_ID As Integer = 28
|
|
Private Const OMAG_ID As Integer = 29
|
|
Private Const ESSETRE_ID As Integer = 30
|
|
Private Const DaysBeforeExpiration As Integer = 20
|
|
Private Const OptionDaysBeforeExpiration As Integer = 10
|
|
Public UpdateFromExpLic As Boolean = False
|
|
|
|
Private m_ExpiringLic_Visibility As Visibility
|
|
Public Property ExpiringLic_Visibility As Visibility
|
|
Get
|
|
Return m_ExpiringLic_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_ExpiringLic_Visibility = value
|
|
NotifyPropertyChanged("ExpiringLic_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_ExpiringOptionLic_Visibility As Visibility
|
|
Public Property ExpiringOptionLic_Visibility As Visibility
|
|
Get
|
|
Return m_ExpiringOptionLic_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_ExpiringOptionLic_Visibility = value
|
|
NotifyPropertyChanged("ExpiringOptionLic_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_SelSearchResult As Licence
|
|
Public Property SelSearchResult As Licence
|
|
Get
|
|
Return m_SelSearchResult
|
|
End Get
|
|
Set(value As Licence)
|
|
m_SelSearchResult = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_SearchResult As ObservableCollection(Of SearchLicence)
|
|
Public ReadOnly Property SearchResult As ObservableCollection(Of SearchLicence)
|
|
Get
|
|
Return m_SearchResult
|
|
End Get
|
|
End Property
|
|
|
|
Private m_SelOptionSearchResult As Licence
|
|
Public Property SelOptionSearchResult As Licence
|
|
Get
|
|
Return m_SelOptionSearchResult
|
|
End Get
|
|
Set(value As Licence)
|
|
m_SelOptionSearchResult = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_OptionSearchResult As ObservableCollection(Of SearchLicence)
|
|
Public ReadOnly Property OptionSearchResult As ObservableCollection(Of SearchLicence)
|
|
Get
|
|
Return m_OptionSearchResult
|
|
End Get
|
|
End Property
|
|
|
|
' Definizione comandi
|
|
Private m_cmdNewClient As Command
|
|
Private m_cmdNewKey As Command
|
|
Private m_cmdNewLicence As Command
|
|
Private m_cmdNewProduct As Command
|
|
Private m_cmdNewVersion As Command
|
|
Private m_cmdNewReseller As Command
|
|
Private m_cmdSearchClient As Command
|
|
Private m_cmdSearchKey As Command
|
|
Private m_cmdSearchLicence As Command
|
|
Private m_cmdSearchProduct As Command
|
|
Private m_cmdSearchVersion As Command
|
|
Private m_cmdSearchReseller As Command
|
|
Private m_cmdUpdateClient As Command
|
|
Private m_cmdUpdateKey As Command
|
|
Private m_cmdUpdateLicence As Command
|
|
Private m_cmdUpdateProduct As Command
|
|
Private m_cmdUpdateVersion As Command
|
|
Private m_cmdUpdateReseller As Command
|
|
'Private m_cmdAboutBox As Command
|
|
Private m_cmdUpdateOverwrite As Command
|
|
Private m_cmdUpdateNew As Command
|
|
Private m_cmdOptionUpdateOverwrite As Command
|
|
|
|
#Region "Messages"
|
|
|
|
Public ReadOnly Property UpdateOverwriteMsg As String
|
|
Get
|
|
Return "Update (Overwrite)"
|
|
End Get
|
|
End Property
|
|
|
|
#End Region ' Messages
|
|
|
|
#End Region ' FIELDS & PROPERTIES
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
' Imposto riferimento nella mappa
|
|
Map.SetRefMainMenuVM(Me)
|
|
'LoadExpiringLicences()
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "NewClient"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property NewClient_Command As ICommand
|
|
Get
|
|
If m_cmdNewClient Is Nothing Then
|
|
m_cmdNewClient = New Command(AddressOf NewClient)
|
|
End If
|
|
Return m_cmdNewClient
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub NewClient(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWCLIENT
|
|
End Sub
|
|
|
|
#End Region ' NewClient
|
|
|
|
#Region "NewKey"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property NewKey_Command As ICommand
|
|
Get
|
|
If m_cmdNewKey Is Nothing Then
|
|
m_cmdNewKey = New Command(AddressOf NewKey)
|
|
End If
|
|
Return m_cmdNewKey
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub NewKey(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWKEY
|
|
End Sub
|
|
|
|
#End Region ' NewKey
|
|
|
|
#Region "NewLicence"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property NewLicence_Command As ICommand
|
|
Get
|
|
If m_cmdNewLicence Is Nothing Then
|
|
m_cmdNewLicence = New Command(AddressOf NewLicence)
|
|
End If
|
|
Return m_cmdNewLicence
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub NewLicence(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWLICENCE
|
|
End Sub
|
|
|
|
#End Region ' NewLicence
|
|
|
|
#Region "NewProduct"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property NewProduct_Command As ICommand
|
|
Get
|
|
If m_cmdNewProduct Is Nothing Then
|
|
m_cmdNewProduct = New Command(AddressOf NewProduct)
|
|
End If
|
|
Return m_cmdNewProduct
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub NewProduct(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWPRODUCT
|
|
End Sub
|
|
|
|
#End Region ' NewProduct
|
|
|
|
#Region "NewVersion"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property NewVersion_Command As ICommand
|
|
Get
|
|
If m_cmdNewVersion Is Nothing Then
|
|
m_cmdNewVersion = New Command(AddressOf NewVersion)
|
|
End If
|
|
Return m_cmdNewVersion
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub NewVersion(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWVERSION
|
|
End Sub
|
|
|
|
#End Region ' NewVersion
|
|
|
|
#Region "NewReseller"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property NewReseller_Command As ICommand
|
|
Get
|
|
If m_cmdNewReseller Is Nothing Then
|
|
m_cmdNewReseller = New Command(AddressOf NewReseller)
|
|
End If
|
|
Return m_cmdNewReseller
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub NewReseller(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWRESELLER
|
|
End Sub
|
|
|
|
#End Region ' NewReseller
|
|
|
|
#Region "SearchClient"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property SearchClient_Command As ICommand
|
|
Get
|
|
If m_cmdSearchClient Is Nothing Then
|
|
m_cmdSearchClient = New Command(AddressOf SearchClient)
|
|
End If
|
|
Return m_cmdSearchClient
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub SearchClient(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHCLIENT
|
|
End Sub
|
|
|
|
#End Region ' SearchCLient
|
|
|
|
#Region "SearchKey"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property SearchKey_Command As ICommand
|
|
Get
|
|
If m_cmdSearchKey Is Nothing Then
|
|
m_cmdSearchKey = New Command(AddressOf SearchKey)
|
|
End If
|
|
Return m_cmdSearchKey
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub SearchKey(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHKEY
|
|
End Sub
|
|
|
|
#End Region ' SearchKey
|
|
|
|
#Region "SearchLicence"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property SearchLicence_Command As ICommand
|
|
Get
|
|
If m_cmdSearchLicence Is Nothing Then
|
|
m_cmdSearchLicence = New Command(AddressOf SearchLicence)
|
|
End If
|
|
Return m_cmdSearchLicence
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub SearchLicence(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHLICENCE
|
|
End Sub
|
|
|
|
#End Region ' SearchLicence
|
|
|
|
#Region "SearchProduct"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property SearchProduct_Command As ICommand
|
|
Get
|
|
If m_cmdSearchProduct Is Nothing Then
|
|
m_cmdSearchProduct = New Command(AddressOf SearchProduct)
|
|
End If
|
|
Return m_cmdSearchProduct
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub SearchProduct(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHPRODUCT
|
|
End Sub
|
|
|
|
#End Region ' SearchProduct
|
|
|
|
#Region "SearchVersion"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property SearchVersion_Command As ICommand
|
|
Get
|
|
If m_cmdSearchVersion Is Nothing Then
|
|
m_cmdSearchVersion = New Command(AddressOf SearchVersion)
|
|
End If
|
|
Return m_cmdSearchVersion
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub SearchVersion(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHVERSION
|
|
End Sub
|
|
|
|
#End Region ' SearchVersion
|
|
|
|
#Region "SearchReseller"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property SearchReseller_Command As ICommand
|
|
Get
|
|
If m_cmdSearchReseller Is Nothing Then
|
|
m_cmdSearchReseller = New Command(AddressOf SearchReseller)
|
|
End If
|
|
Return m_cmdSearchReseller
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub SearchReseller(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHRESELLER
|
|
End Sub
|
|
|
|
#End Region ' SearchReseller
|
|
|
|
#Region "UpdateClient"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property UpdateClient_Command As ICommand
|
|
Get
|
|
If m_cmdUpdateClient Is Nothing Then
|
|
m_cmdUpdateClient = New Command(AddressOf UpdateClient)
|
|
End If
|
|
Return m_cmdUpdateClient
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub UpdateClient(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATECLIENT
|
|
End Sub
|
|
|
|
#End Region ' UpdateClient
|
|
|
|
#Region "UpdateKey"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property UpdateKey_Command As ICommand
|
|
Get
|
|
If m_cmdUpdateKey Is Nothing Then
|
|
m_cmdUpdateKey = New Command(AddressOf UpdateKey)
|
|
End If
|
|
Return m_cmdUpdateKey
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub UpdateKey(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATEKEY
|
|
End Sub
|
|
|
|
#End Region ' UpdateKey
|
|
|
|
#Region "UpdateLicence"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property UpdateLicence_Command As ICommand
|
|
Get
|
|
If m_cmdUpdateLicence Is Nothing Then
|
|
m_cmdUpdateLicence = New Command(AddressOf UpdateLicence)
|
|
End If
|
|
Return m_cmdUpdateLicence
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub UpdateLicence(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATELICENCE
|
|
End Sub
|
|
|
|
#End Region ' UpdateKey
|
|
|
|
#Region "UpdateProduct"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property UpdateProduct_Command As ICommand
|
|
Get
|
|
If m_cmdUpdateProduct Is Nothing Then
|
|
m_cmdUpdateProduct = New Command(AddressOf UpdateProduct)
|
|
End If
|
|
Return m_cmdUpdateProduct
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub UpdateProduct(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATEPRODUCT
|
|
End Sub
|
|
|
|
#End Region ' UpdateProduct
|
|
|
|
#Region "UpdateVersion"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property UpdateVersion_Command As ICommand
|
|
Get
|
|
If m_cmdUpdateVersion Is Nothing Then
|
|
m_cmdUpdateVersion = New Command(AddressOf UpdateVersion)
|
|
End If
|
|
Return m_cmdUpdateVersion
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub UpdateVersion(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATEVERSION
|
|
End Sub
|
|
|
|
#End Region ' UpdateVersion
|
|
|
|
#Region "UpdateReseller"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property UpdateReseller_Command As ICommand
|
|
Get
|
|
If m_cmdUpdateReseller Is Nothing Then
|
|
m_cmdUpdateReseller = New Command(AddressOf UpdateReseller)
|
|
End If
|
|
Return m_cmdUpdateReseller
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub UpdateReseller(ByVal param As Object)
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATERESELLER
|
|
End Sub
|
|
|
|
#End Region ' SearchReseller
|
|
|
|
'#Region "AboutBox"
|
|
|
|
' ' Returns a command that manage the MainWindow_Unloaded command
|
|
' Public ReadOnly Property AboutBox_Command As ICommand
|
|
' Get
|
|
' If m_cmdAboutBox Is Nothing Then
|
|
' m_cmdAboutBox = New Command(AddressOf AboutBox)
|
|
' End If
|
|
' Return m_cmdAboutBox
|
|
' End Get
|
|
' End Property
|
|
|
|
' ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
' Public Sub AboutBox(ByVal param As Object)
|
|
' Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHRESELLER
|
|
' End Sub
|
|
|
|
'#End Region ' AboutBox
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
#Region "METHODS"
|
|
|
|
Friend Sub InitMainMenuPage()
|
|
LoadExpiringLicences()
|
|
End Sub
|
|
|
|
#Region "LoadExpiringLicenses"
|
|
|
|
Private Sub LoadExpiringLicences()
|
|
|
|
' Carico lista ProductName
|
|
Dim ProductList As List(Of Product)
|
|
Dim prodQuery As String
|
|
prodQuery = "SELECT * FROM " & DB_PRODUCT
|
|
ProductList = ManageDb.ExecuteProductQuery(prodQuery)
|
|
|
|
' Carico lista ClientName
|
|
Dim ClientList As List(Of Client)
|
|
Dim clientQuery As String
|
|
clientQuery = "SELECT * FROM " & DB_CLIENT
|
|
ClientList = ManageDb.ExecuteClientQuery(clientQuery)
|
|
|
|
Dim Query As String = "SELECT * FROM " & DB_LICENCE & " INNER JOIN " & DB_PRODUCT &
|
|
" ON " & DB_LICENCE & "." & DB_PRODUCTID & " = " & DB_PRODUCT & "." & DB_PRODUCTID &
|
|
" INNER JOIN " & DB_KEY &
|
|
" ON " & DB_KEY & "." & DB_LOCKID & " = " & DB_LICENCE & "." & DB_LOCKID &
|
|
" INNER JOIN " & DB_CLIENT &
|
|
" ON " & DB_KEY & "." & DB_CLIENTID & " = " & DB_CLIENT & "." & DB_CLIENTID &
|
|
" WHERE " & DB_CLIENT & "." & DB_CLIENTID & " IN (" & MULTIAX_ID & ", " & OMAG_ID & ", " & ESSETRE_ID & ")" &
|
|
" AND DATEDIFF(" & DB_LICENCE & "." & DB_DATE & ", '" & Format(DateTime.Now.AddYears(-1), "yyyy-MM-dd") & "') > 0 "
|
|
' & " AND DATEDIFF(" & DB_LICENCE & "." & DB_DATE & ", '" & Format(DateTime.Now.AddYears(-1), "yyyy-MM-dd") & "') < " & DaysBeforeExpiration
|
|
|
|
Dim TempSearchResult As ObservableCollection(Of SearchLicence) = New ObservableCollection(Of SearchLicence)(ManageDb.ExecuteExpiringLicenceQuery(Query, ProductList, ClientList))
|
|
m_SearchResult = New ObservableCollection(Of SearchLicence)
|
|
For Each ItemToAdd In TempSearchResult
|
|
If (New Date(ItemToAdd.ExpirationDate.Year, ItemToAdd.ExpirationDate.Month, ItemToAdd.ExpirationDate.Day) - Date.Now).TotalDays >= 0 And
|
|
(New Date(ItemToAdd.ExpirationDate.Year, ItemToAdd.ExpirationDate.Month, ItemToAdd.ExpirationDate.Day) - Date.Now).TotalDays < DaysBeforeExpiration Then
|
|
m_SearchResult.Add(ItemToAdd)
|
|
End If
|
|
Next
|
|
NotifyPropertyChanged("SearchResult")
|
|
|
|
If m_SearchResult.Count > 0 Then
|
|
ExpiringLic_Visibility = Visibility.Visible
|
|
Else
|
|
ExpiringLic_Visibility = Visibility.Collapsed
|
|
End If
|
|
|
|
' Costruisco la nuova query per caricare l'altra Datagrid, che tiene conto di Product/OptionDeadline
|
|
Query = "SELECT * FROM " & DB_LICENCE & " INNER JOIN " & DB_PRODUCT &
|
|
" ON " & DB_LICENCE & "." & DB_PRODUCTID & " = " & DB_PRODUCT & "." & DB_PRODUCTID &
|
|
" INNER JOIN " & DB_KEY &
|
|
" ON " & DB_KEY & "." & DB_LOCKID & " = " & DB_LICENCE & "." & DB_LOCKID &
|
|
" INNER JOIN " & DB_CLIENT &
|
|
" ON " & DB_KEY & "." & DB_CLIENTID & " = " & DB_CLIENT & "." & DB_CLIENTID &
|
|
" WHERE " & DB_CLIENT & "." & DB_CLIENTID & " IN (" & MULTIAX_ID & ", " & OMAG_ID & ", " & ESSETRE_ID & ")" &
|
|
" AND ((DATEDIFF(" & DB_LICENCE & "." & DB_PRODUCTDEADLINE & ", '" & Format(DateTime.Now, "yyyy-MM-dd") & "') > 0 " &
|
|
" AND DATEDIFF(" & DB_LICENCE & "." & DB_PRODUCTDEADLINE & ", '" & Format(DateTime.Now, "yyyy-MM-dd") & "') < " & OptionDaysBeforeExpiration & ")" &
|
|
" OR (DATEDIFF(" & DB_LICENCE & "." & DB_OPTIONDEADLINE & ", '" & Format(DateTime.Now, "yyyy-MM-dd") & "') > 0 " &
|
|
" AND DATEDIFF(" & DB_LICENCE & "." & DB_OPTIONDEADLINE & ", '" & Format(DateTime.Now, "yyyy-MM-dd") & "') < " & OptionDaysBeforeExpiration & "))"
|
|
|
|
m_OptionSearchResult = New ObservableCollection(Of SearchLicence)(ManageDb.ExecuteExpiringLicenceQuery(Query, ProductList, ClientList))
|
|
NotifyPropertyChanged("OptionSearchResult")
|
|
|
|
If m_OptionSearchResult.Count > 0 Then
|
|
ExpiringOptionLic_Visibility = Visibility.Visible
|
|
Else
|
|
ExpiringOptionLic_Visibility = Visibility.Collapsed
|
|
End If
|
|
|
|
End Sub
|
|
|
|
#End Region ' LoadExpiringLicenses
|
|
|
|
#Region "UpdateOverwrite"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property UpdateOverwrite_Command As ICommand
|
|
Get
|
|
If m_cmdUpdateOverwrite Is Nothing Then
|
|
m_cmdUpdateOverwrite = New Command(AddressOf UpdateOverwrite)
|
|
End If
|
|
Return m_cmdUpdateOverwrite
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub UpdateOverwrite(ByVal param As Object)
|
|
If Not IsNothing(m_SelSearchResult) Then
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Map.refUpdateLicencePageVM.Licence = m_SelSearchResult
|
|
UpdateFromExpLic = True
|
|
Map.refUpdateLicencePageVM.Overwrite = True
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATELICENCE
|
|
Else
|
|
MessageBox.Show("Non è stata selezionata nessuna licenza")
|
|
End If
|
|
|
|
End Sub
|
|
|
|
#End Region ' UpdateOverwrite
|
|
|
|
#Region "OptionUpdateOverwrite"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property OptionUpdateOverwrite_Command As ICommand
|
|
Get
|
|
If m_cmdOptionUpdateOverwrite Is Nothing Then
|
|
m_cmdOptionUpdateOverwrite = New Command(AddressOf OptionUpdateOverwrite)
|
|
End If
|
|
Return m_cmdOptionUpdateOverwrite
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub OptionUpdateOverwrite(ByVal param As Object)
|
|
If Not IsNothing(m_SelOptionSearchResult) Then
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Map.refUpdateLicencePageVM.Licence = m_SelOptionSearchResult
|
|
UpdateFromExpLic = True
|
|
Map.refUpdateLicencePageVM.Overwrite = True
|
|
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATELICENCE
|
|
Else
|
|
MessageBox.Show("Non è stata selezionata nessuna licenza")
|
|
End If
|
|
|
|
End Sub
|
|
|
|
#End Region ' UpdateOverwrite
|
|
|
|
#End Region ' METHODS
|
|
|
|
End Class
|