diff --git a/MainMenu/MainMenuV.xaml b/MainMenu/MainMenuV.xaml
index 5e8cff5..d429141 100644
--- a/MainMenu/MainMenuV.xaml
+++ b/MainMenu/MainMenuV.xaml
@@ -27,94 +27,188 @@
TextAlignment="Center"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
diff --git a/MainMenu/MainMenuVM.vb b/MainMenu/MainMenuVM.vb
index 9e3b649..58d0cc1 100644
--- a/MainMenu/MainMenuVM.vb
+++ b/MainMenu/MainMenuVM.vb
@@ -10,6 +10,7 @@ Public Class MainMenuVM
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
@@ -23,6 +24,17 @@ Public Class MainMenuVM
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
@@ -40,6 +52,23 @@ Public Class MainMenuVM
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
@@ -62,6 +91,7 @@ Public Class MainMenuVM
'Private m_cmdAboutBox As Command
Private m_cmdUpdateOverwrite As Command
Private m_cmdUpdateNew As Command
+ Private m_cmdOptionUpdateOverwrite As Command
#Region "Messages"
@@ -491,6 +521,28 @@ Public Class MainMenuVM
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
@@ -522,6 +574,33 @@ Public Class MainMenuVM
#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
diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb
index 44b876b..7c3a5af 100644
--- a/My Project/AssemblyInfo.vb
+++ b/My Project/AssemblyInfo.vb
@@ -59,5 +59,5 @@ Imports System.Windows
' usando l'asterisco '*' come illustrato di seguito:
'
-
-
+
+
diff --git a/SearchKeyPage/SearchKeyPageV.xaml b/SearchKeyPage/SearchKeyPageV.xaml
index a083cb5..f8a298b 100644
--- a/SearchKeyPage/SearchKeyPageV.xaml
+++ b/SearchKeyPage/SearchKeyPageV.xaml
@@ -1,85 +1,85 @@
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:LicenseManager="clr-namespace:LicenseManager"
+ DataContext="{StaticResource SearchKeyPageVM}" Loaded="Grid_Loaded">
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
+
\ No newline at end of file
diff --git a/SearchLicencePage/SearchLicencePageV.xaml b/SearchLicencePage/SearchLicencePageV.xaml
index e13b300..311fc67 100644
--- a/SearchLicencePage/SearchLicencePageV.xaml
+++ b/SearchLicencePage/SearchLicencePageV.xaml
@@ -4,304 +4,305 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
DataContext="{StaticResource SearchLicencePageVM}" Loaded="Grid_Loaded">
-
-
-
-
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Grid.Row="0"
+ Style="{StaticResource ParametersComboBox}"/>
-
+
+
+
+
+
+
+
-
+
-
+
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file