LicenceManager 2.5j1 :

- aggiornamenti vari.
This commit is contained in:
Dario Sassi
2023-10-09 13:11:06 +02:00
parent 538cbbd89d
commit f4f19bb8f0
7 changed files with 35 additions and 35 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ Public Class LicenceBoxVM
Dim Query As String = "SELECT " & DB_NESTDEADLINE & " FROM " & DB_LICENCE & " WHERE " & DB_LICENCEID & " = " & licId
Dim m_NestKeyDict As Dictionary(Of String, String) = ManageDb.ExecuteStringDictionaryQuery(Query)
Dim NestDl As String = m_NestKeyDict(DB_NESTDEADLINE)
If Not String.IsNullOrWhiteSpace(NestDl) Or Not String.IsNullOrEmpty(NestDl) Then
If Not String.IsNullOrWhiteSpace(NestDl) Then
m_NestDlTxBl_Visibility = Visibility.Visible
m_NestDlTxBx_Visibility = Visibility.Visible
m_NestDeadline = NestDl
+4 -4
View File
@@ -17,9 +17,9 @@ Imports System.Windows
<Assembly: AssemblyTitle("LicenceManager")>
<Assembly: AssemblyDescription("LicenceManager")>
#End If
<Assembly: AssemblyCompany("Egaltech srl")>
<Assembly: AssemblyCompany("Egalware srl")>
<Assembly: AssemblyProduct("LicenceManager")>
<Assembly: AssemblyCopyright("Copyright © 2018-2019")>
<Assembly: AssemblyCopyright("Copyright © 2018-20123")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
@@ -59,5 +59,5 @@ Imports System.Windows
' usando l'asterisco '*' come illustrato di seguito:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.3.2")>
<Assembly: AssemblyFileVersion("2.4.3.2")>
<Assembly: AssemblyVersion("2.5.10.1")>
<Assembly: AssemblyFileVersion("2.5.10.1")>
+4 -4
View File
@@ -573,7 +573,7 @@ Public Class NewLicencePageVM
StringFile.Add("Opt2=" & nDecOption2)
StringFile.Add("OptExpDays=" & DayOptionDeadline)
' Se il campo NestKey non è vuoto aggiungo anche quello al file
If Not String.IsNullOrEmpty(NestKey) Or Not String.IsNullOrWhiteSpace(NestKey) Then
If Not String.IsNullOrWhiteSpace(NestKey) Then
StringFile.Add("NestKey=" & NestKey)
End If
@@ -614,8 +614,8 @@ Public Class NewLicencePageVM
' L'aggiunta della string NestKey al file .lic è necessaria perchè viene sì scritta nel .Kge ma viene ignorata dal KeyGenerator
Try
Dim sLicFile As String = Path.ChangeExtension(fileName.Replace("\", "\\"), ".lic")
If (File.Exists(sLicFile)) And (Not String.IsNullOrEmpty(NestKey) Or Not String.IsNullOrWhiteSpace(NestKey)) Then
My.Computer.FileSystem.WriteAllText(sLicFile, "NestKey=" & NestKey, True, Text.Encoding.UTF8)
If (File.Exists(sLicFile)) And Not String.IsNullOrWhiteSpace(NestKey) Then
My.Computer.FileSystem.WriteAllText(sLicFile, "NestKey=" & NestKey & vbNewLine, True, Text.Encoding.UTF8)
End If
Catch ex As Exception
@@ -634,7 +634,7 @@ Public Class NewLicencePageVM
Try
If String.IsNullOrEmpty(NestKey) Or String.IsNullOrWhiteSpace(NestKey) Then
If String.IsNullOrWhiteSpace(NestKey) Then
Query = "INSERT INTO " & DB_LICENCE & " (" & DB_PRODUCTID & ", " & DB_PRODUCTVERSION & ", " & DB_PRODUCTLEVEL & ", " &
DB_PRODUCTDEADLINE & ", " & DB_OPTION1 & ", " & DB_OPTION2 & ", " &
DB_OPTIONDEADLINE & ", " & DB_LOCKID & ", " & DB_FILE & ", " &
+2 -2
View File
@@ -81,7 +81,7 @@ Public Class SearchKeyPageVM
End Property
Private m_Note As String
Public Property Note As String
Public Overloads Property Note As String
Get
Return m_Note
End Get
@@ -92,7 +92,7 @@ Public Class SearchKeyPageVM
End Property
Private m_Seriale As String
Public Property Seriale As String
Public Overloads Property Seriale As String
Get
Return m_Seriale
End Get
+1 -1
View File
@@ -276,7 +276,7 @@ Public Class SearchReseller
End Property
Private m_Note As String
Public ReadOnly Property Note As String
Public Overloads ReadOnly Property Note As String
Get
Return m_Note
End Get
+19 -19
View File
@@ -524,7 +524,7 @@ Public Class UpdateLicencePageVM
m_NestKey = m_NestKeyDict(DB_NESTKEY)
Dim sNestDl As String = m_NestKeyDict(DB_NESTDEADLINE)
Dim splittedNestDl() As String = Split(sNestDl)
If Not String.IsNullOrEmpty(splittedNestDl(0)) Then
If Not String.IsNullOrWhiteSpace(splittedNestDl(0)) Then
m_NestDeadline = Date.ParseExact(splittedNestDl(0), "dd/MM/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)
End If
NotifyPropertyChanged("NestKey")
@@ -660,7 +660,7 @@ Public Class UpdateLicencePageVM
StringFile.Add("Opt2=" & nDecOption2)
StringFile.Add("OptExpDays=" & DayOptionDeadline)
' Se il campo NestKey non è vuoto aggiungo anche quello al file
If Not String.IsNullOrEmpty(NestKey) Or Not String.IsNullOrWhiteSpace(NestKey) Then
If Not String.IsNullOrWhiteSpace(NestKey) Then
StringFile.Add("NestKey=" & NestKey)
End If
@@ -701,8 +701,8 @@ Public Class UpdateLicencePageVM
' L'aggiunta della string NestKey al file .lic è necessaria perchè viene sì scritta nel .Kge ma viene ignorata dal KeyGenerator
Try
Dim sLicFile As String = Path.ChangeExtension(FilePath.Replace("\", "\\"), ".lic")
If (File.Exists(sLicFile)) And (Not String.IsNullOrEmpty(NestKey) Or Not String.IsNullOrWhiteSpace(NestKey)) Then
My.Computer.FileSystem.WriteAllText(sLicFile, "NestKey=" & NestKey, True, Text.Encoding.UTF8)
If (File.Exists(sLicFile)) And Not String.IsNullOrWhiteSpace(NestKey) Then
My.Computer.FileSystem.WriteAllText(sLicFile, "NestKey=" & NestKey & vbNewLine, True, Text.Encoding.UTF8)
End If
Catch ex As Exception
@@ -719,15 +719,15 @@ Public Class UpdateLicencePageVM
' Cerco nella tabella Licence
Query = "UPDATE " & DB_LICENCE
Dim bFirstWhere As Boolean = True
If Not IsNothing(m_SelVersion) OrElse
Not String.IsNullOrWhiteSpace(m_SelProductLevel) OrElse
Not IsNothing(ProductDeadline) OrElse
Not nDecOption1 = 0 OrElse
Not nDecOption2 = 0 OrElse
Not IsNothing(OptionDeadline) OrElse
Not IsNothing(LicenseDate) OrElse
Not String.IsNullOrWhiteSpace(FileName) OrElse
Not String.IsNullOrWhiteSpace(LockID) Then
If (Not IsNothing(m_SelVersion) OrElse
Not String.IsNullOrWhiteSpace(m_SelProductLevel.ToString()) OrElse
Not IsNothing(ProductDeadline) OrElse
Not nDecOption1 = 0 OrElse
Not nDecOption2 = 0 OrElse
Not IsNothing(OptionDeadline) OrElse
Not IsNothing(LicenseDate) OrElse
Not String.IsNullOrWhiteSpace(FileName) OrElse
Not String.IsNullOrWhiteSpace(LockID)) Then
Query &= " SET "
If Not IsNothing(m_SelVersion) Then
EvalWhere(bFirstWhere, Query)
@@ -735,7 +735,7 @@ Public Class UpdateLicencePageVM
End If
If Not IsNothing(m_SelProductLevel) Then
EvalWhere(bFirstWhere, Query)
Query &= DB_PRODUCTLEVEL & " = '" & m_SelProductLevel & "' "
Query &= DB_PRODUCTLEVEL & " = '" & m_SelProductLevel.ToString() & "' "
End If
If Not IsNothing(ProductDeadline) Then
EvalWhere(bFirstWhere, Query)
@@ -776,7 +776,7 @@ Public Class UpdateLicencePageVM
' Alla fine in ogni caso aggiorniamo anche NestKey e NestDeadline
EvalWhere(bFirstWhere, Query)
If String.IsNullOrEmpty(NestKey) Or String.IsNullOrWhiteSpace(NestKey) Then
If String.IsNullOrWhiteSpace(NestKey) Then
Query &= DB_NESTKEY & " = NULL, " & DB_NESTDEADLINE & " = NULL "
Else
Query &= DB_NESTKEY & " = '" & m_NestKey & "', " & DB_NESTDEADLINE & " = '" & Format(NestDeadline, "yyyy-MM-dd") & "' "
@@ -848,7 +848,7 @@ Public Class UpdateLicencePageVM
StringFile.Add("Opt2=" & nDecOption2)
StringFile.Add("OptExpDays=" & DayOptionDeadline)
' Se il campo NestKey non è vuoto aggiungo anche quello al file
If Not String.IsNullOrEmpty(NestKey) Or Not String.IsNullOrWhiteSpace(NestKey) Then
If Not String.IsNullOrWhiteSpace(NestKey) Then
StringFile.Add("NestKey=" & NestKey)
End If
@@ -889,8 +889,8 @@ Public Class UpdateLicencePageVM
' L'aggiunta della string NestKey al file .lic è necessaria perchè viene sì scritta nel .Kge ma viene ignorata dal KeyGenerator
Try
Dim sLicFile As String = Path.ChangeExtension(FilePath.Replace("\", "\\"), ".lic")
If (File.Exists(sLicFile)) And (Not String.IsNullOrEmpty(NestKey) Or Not String.IsNullOrWhiteSpace(NestKey)) Then
My.Computer.FileSystem.WriteAllText(sLicFile, "NestKey=" & NestKey, True, Text.Encoding.UTF8)
If (File.Exists(sLicFile)) And Not String.IsNullOrWhiteSpace(NestKey) Then
My.Computer.FileSystem.WriteAllText(sLicFile, "NestKey=" & NestKey & vbNewLine, True, Text.Encoding.UTF8)
End If
Catch ex As Exception
@@ -902,7 +902,7 @@ Public Class UpdateLicencePageVM
Try
Dim textLic As String = File.ReadAllText(Path.ChangeExtension(FilePath.Replace("\", "\\"), ".lic"))
If String.IsNullOrEmpty(NestKey) Or String.IsNullOrWhiteSpace(NestKey) Then
If String.IsNullOrWhiteSpace(NestKey) Then
Query = "INSERT INTO " & DB_LICENCE & " (" & DB_PRODUCTID & ", " & DB_PRODUCTVERSION & ", " & DB_PRODUCTLEVEL & ", " &
DB_PRODUCTDEADLINE & ", " & DB_OPTION1 & ", " & DB_OPTION2 & ", " &
DB_OPTIONDEADLINE & ", " & DB_LOCKID & ", " & DB_FILE & ", " &
+4 -4
View File
@@ -4,11 +4,11 @@ Module ManageFile
Public Function ComputeFileName(FilePath As String, FileNameOnly As String) As String
' Resetto il nome del file (in modo che sia senza '_' e numero) e cerco nel DB se è già presente un file con lo stesso nome
FilePath = Path.GetDirectoryName(FilePath) & "\" & FileNameOnly.Split("_")(0) & ".Kge"
FilePath = Path.GetDirectoryName(FilePath) & "\" & FileNameOnly.Split("_"c)(0) & ".Kge"
FilePath = FilePath.Replace("\", "\\")
Dim sFileNameQuery = "SELECT * FROM " & DB_LICENCE & " WHERE " & DB_FILE & " = '" & FilePath & "' "
Dim m_UpdateLicDict As Dictionary(Of String, String) = ManageDb.ExecuteStringDictionaryQuery(sFileNameQuery)
If m_UpdateLicDict.ContainsKey(DB_FILE) AndAlso Not String.IsNullOrEmpty(m_UpdateLicDict(DB_FILE)) Then
If m_UpdateLicDict.ContainsKey(DB_FILE) AndAlso Not String.IsNullOrWhiteSpace(m_UpdateLicDict(DB_FILE)) Then
' Se il nome del file già esiste procedo col loop per il calcolo del numero dopo '_'
FilePath = FilePath.Replace("\\", "\")
Dim fileNumber As Integer = 0
@@ -16,7 +16,7 @@ Module ManageFile
FilePath = FilePath.Replace("\", "\\")
sFileNameQuery = "SELECT * FROM " & DB_LICENCE & " WHERE " & DB_FILE & " = '" & FilePath & "' "
m_UpdateLicDict = ManageDb.ExecuteStringDictionaryQuery(sFileNameQuery)
If m_UpdateLicDict.ContainsKey(DB_FILE) AndAlso Not String.IsNullOrEmpty(m_UpdateLicDict(DB_FILE)) Then
If m_UpdateLicDict.ContainsKey(DB_FILE) AndAlso Not String.IsNullOrWhiteSpace(m_UpdateLicDict(DB_FILE)) Then
'The file does exist, so increment and try the next one
fileNumber = fileNumber + 1
FilePath = FilePath.Replace("\\", "\")
@@ -28,7 +28,7 @@ Module ManageFile
Else
'The file does not exist, do something..
If fileNumber = 1 Then
FilePath = FilePath.Split("_")(0) & "_1.Kge"
FilePath = FilePath.Split("_"c)(0) & "_1.Kge"
End If
Exit Do
End If