LicenceManager :

- piccole correzioni
- aggiunta colonna scadenza licenza in SearchLicence.
This commit is contained in:
Dario Sassi
2026-01-07 16:46:59 +01:00
parent 2a56848505
commit 49ba669707
4 changed files with 37 additions and 17 deletions
+23 -8
View File
@@ -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
+8 -7
View File
@@ -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" >
<DataGrid.Columns>
@@ -248,10 +249,10 @@
<DataGridTextColumn Header="ProductName"
Binding="{Binding ProductName, Mode=OneWay}"
Width="0.4*"/>
<DataGridTextColumn Header="ProductVersion"
<DataGridTextColumn Header="Version"
Binding="{Binding ProductVersion, Mode=OneWay}"
Width="SizeToHeader"/>
<DataGridTextColumn Header="ProductLevel"
<DataGridTextColumn Header="Level"
Binding="{Binding ProductLevel, Mode=OneWay}"
Width="SizeToHeader"/>
<DataGridTextColumn Header="Option 1 "
@@ -265,14 +266,14 @@
Width="0.8*"/>
<DataGridTextColumn Header="File"
Binding="{Binding File, Mode=OneWay}"
Width="2*"/>
Width="1.6*"/>
<DataGridTextColumn Header="License Date "
Binding="{Binding LicenseDate, Mode=OneWay, StringFormat=\{0:dd/MM/yyyy\}}"
Width="SizeToHeader"/>
<!--<DataGridTextColumn Header="License File Content"
Binding="{Binding LicFile, Mode=OneWay}"
Width="1*"/>-->
<DataGridTextColumn Header="Expiration Date"
Binding="{Binding OptionDeadline, Mode=OneWay, StringFormat=\{0:dd/MM/yyyy\}}"
Width="SizeToHeader"/>
<DataGridTextColumn Header="End Service Date"
Binding="{Binding ExpirationDate, Mode=OneWay, StringFormat=\{0:dd/MM/yyyy\}}"
Width="SizeToHeader"/>
<DataGridTextColumn Header="Note"
+1 -1
View File
@@ -188,7 +188,7 @@
<EgtWPFLib5:EgtTextBox Name="textBoxNote" Text="{Binding Note, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
Grid.Column="3"
Grid.Row="3"
Style="{StaticResource ParameterTextBox}" TextWrapping="Wrap" HorizontalContentAlignment="Left" Width="Auto" />
Style="{StaticResource ParameterTextBox}" TextWrapping="Wrap" HorizontalContentAlignment="Left" Width="Auto" Margin="10,5,10,5" />
<TextBlock Text="{Binding KeyNumberMsg}"
Grid.Column="0"
+5 -1
View File
@@ -513,7 +513,11 @@ Public Class UpdateLicencePageVM
NotifyPropertyChanged("ProductDeadline")
m_OptionDeadline = Licence.OptionDeadline
NotifyPropertyChanged("OptionDeadline")
m_LicenseDate = Licence.LicenseDate
If Overwrite Then
m_LicenseDate = Licence.LicenseDate
Else
m_LicenseDate = DateTime.Now
End If
NotifyPropertyChanged("LicenseDate")
' Resetto i campi NestKey e NestDeadline e carico i valori grazie al LicenceID associato