From 49ba669707c99a0d71bdff2d3dc3dc404886d58b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 7 Jan 2026 16:46:59 +0100 Subject: [PATCH] LicenceManager : - piccole correzioni - aggiunta colonna scadenza licenza in SearchLicence. --- MainWindow/Objects.vb | 31 +++++++++++++++++------ SearchLicencePage/SearchLicencePageV.xaml | 15 ++++++----- UpdateLicencePage/UpdateLicencePageV.xaml | 2 +- UpdateLicencePage/UpdateLicencePageVM.vb | 6 ++++- 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/MainWindow/Objects.vb b/MainWindow/Objects.vb index 9145092..5014faa 100644 --- a/MainWindow/Objects.vb +++ b/MainWindow/Objects.vb @@ -226,14 +226,27 @@ Public Class Licence 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 nVer As Integer = CInt(ProductVersion.Substring(0, 2)) - Dim nYear As Integer = nVer + 1999 + If( nVer < 31, 0, -3) - Dim nMonth As Integer = CInt(ProductVersion.Substring(2, 2)) - Return New Date(nYear, nMonth, DateTime.DaysInMonth(nYear, nMonth)) + Dim nYear As Integer = 2015 + Dim nMonth As Integer = 12 + Dim nVer As Integer = CInt(ProductVersion) + If nVer = 16 Then + nYear = 2017 + ElseIf nVer = 18 Then + nYear = 2018 + ElseIf nVer = 19 Then + nYear = 2019 + ElseIf nVer = 21 Then + nYear = 2020 + ElseIf nVer = 22 Then + nYear = 2021 + ElseIf nVer >= 2201 And nVer <= 2712 Then + nYear = nVer \ 100 + 1999 + nMonth = nVer Mod 100 + ElseIf nVer >= 3101 And nVer <= 36812 Then + nYear = nVer \ 100 + 1996 + nMonth = nVer Mod 100 End If - Return Nothing + Return New Date(nYear, nMonth, DateTime.DaysInMonth(nYear, nMonth)) End Get End Property @@ -251,7 +264,9 @@ Public Class Licence End Get End Property - Sub New(ProductID As Integer, ProductVersion As String, ProductLevel As Integer, ProductDeadline As Date, Option1 As Integer, Option2 As Integer, OptionDeadline As Date, LockID As String, File As String, LicenceID As String, LicenseDate As Date, LicFile As String, Note As String) + Sub New(ProductID As Integer, ProductVersion As String, ProductLevel As Integer, ProductDeadline As Date, + Option1 As Integer, Option2 As Integer, OptionDeadline As Date, LockID As String, File As String, + LicenceID As String, LicenseDate As Date, LicFile As String, Note As String) m_ProductID = ProductID m_ProductVersion = ProductVersion m_ProductLevel = ProductLevel diff --git a/SearchLicencePage/SearchLicencePageV.xaml b/SearchLicencePage/SearchLicencePageV.xaml index c95726b..963ac13 100644 --- a/SearchLicencePage/SearchLicencePageV.xaml +++ b/SearchLicencePage/SearchLicencePageV.xaml @@ -239,8 +239,9 @@ Grid.ColumnSpan="4" RowHeight="20" Height="Auto" - MaxHeight="250" + MaxHeight="400" ColumnHeaderHeight="25" + Margin="5,0,5,0" MouseDoubleClick="Row_MouseDoubleClick" > @@ -248,10 +249,10 @@ - - + Width="1.6*"/> - + + Style="{StaticResource ParameterTextBox}" TextWrapping="Wrap" HorizontalContentAlignment="Left" Width="Auto" Margin="10,5,10,5" />