diff --git a/LicenceBox/LicenceBoxV.xaml b/LicenceBox/LicenceBoxV.xaml index 87d725d..e4014c5 100644 --- a/LicenceBox/LicenceBoxV.xaml +++ b/LicenceBox/LicenceBoxV.xaml @@ -44,8 +44,18 @@ HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20"> - + + + + + + + + + + diff --git a/LicenceBox/LicenceBoxVM.vb b/LicenceBox/LicenceBoxVM.vb index ed9d1f5..31b775d 100644 --- a/LicenceBox/LicenceBoxVM.vb +++ b/LicenceBox/LicenceBoxVM.vb @@ -14,6 +14,16 @@ Public Class LicenceBoxVM End Set End Property + Private m_LicNoteText As String + Public Property LicNoteText As String + Get + Return m_LicNoteText + End Get + Set(value As String) + m_LicNoteText = value + End Set + End Property + Private m_Option1 As New ObservableCollection(Of KeyOption) Public ReadOnly Property Option1 As ObservableCollection(Of KeyOption) Get @@ -139,6 +149,7 @@ Public Class LicenceBoxVM Friend Sub InitLicenceBox() LicFileContentText = CType(Map.refSearchLicencePageVM.Row.Item, Licence).LicFile + LicNoteText = CType(Map.refSearchLicencePageVM.Row.Item, Licence).Note m_ProductDeadline = CType(Map.refSearchLicencePageVM.Row.Item, Licence).ProductDeadline.ToShortDateString() NotifyPropertyChanged("ProductDeadline") diff --git a/MainMenu/MainMenuVM.vb b/MainMenu/MainMenuVM.vb index 58d0cc1..5707486 100644 --- a/MainMenu/MainMenuVM.vb +++ b/MainMenu/MainMenuVM.vb @@ -509,10 +509,17 @@ Public Class MainMenuVM " 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 + " 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 - m_SearchResult = New ObservableCollection(Of SearchLicence)(ManageDb.ExecuteExpiringLicenceQuery(Query, ProductList, ClientList)) + 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 diff --git a/MainWindow/Objects.vb b/MainWindow/Objects.vb index 75f33fb..89bf3f0 100644 --- a/MainWindow/Objects.vb +++ b/MainWindow/Objects.vb @@ -224,6 +224,18 @@ Public Class Licence End Get End Property + Public ReadOnly Property ExpirationDate As Date + Get + If ProductVersion.Length > 3 Then + ' Es. se ProductVersion = 2402 la licenza scade il 01/02/2023, dove 2023 รจ 24 + 1999 + Dim nYear As Integer = CInt(ProductVersion.Substring(0, 2)) + 1999 + Dim nMonth As Integer = CInt(ProductVersion.Substring(2, 2)) + Return New Date(nYear, nMonth, 1) + End If + Return Nothing + End Get + End Property + Private m_LicFile As String Public ReadOnly Property LicFile As String Get diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 7c3a5af..2ea0873 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/SearchLicencePage/SearchLicencePageV.xaml b/SearchLicencePage/SearchLicencePageV.xaml index 311fc67..90136ba 100644 --- a/SearchLicencePage/SearchLicencePageV.xaml +++ b/SearchLicencePage/SearchLicencePageV.xaml @@ -247,7 +247,7 @@ + Width="0.7*"/> @@ -265,16 +265,19 @@ Width="1*"/> + Width="2*"/> - + Width="1*"/>--> + + Width="2*"/>