LicenceManager 2.4c2 : - Correzione creazione nuova licenza quando simile è già esistente

This commit is contained in:
RenzoL
2022-03-23 11:20:36 +01:00
parent fad3d5160b
commit 653e04bc3f
2 changed files with 14 additions and 5 deletions
+2 -2
View File
@@ -59,5 +59,5 @@ Imports System.Windows
' usando l'asterisco '*' come illustrato di seguito:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.3.1")>
<Assembly: AssemblyFileVersion("2.4.3.1")>
<Assembly: AssemblyVersion("2.4.3.2")>
<Assembly: AssemblyFileVersion("2.4.3.2")>
+12 -3
View File
@@ -549,10 +549,12 @@ Public Class NewLicencePageVM
' Nome licenza
Dim sCliName As String = If(String.IsNullOrWhiteSpace(m_ClientName), "", "-" & m_ClientName)
Dim sLicName As String = If(GetSelIsDongle(), "Key-", "Soft-") & SelNumber.Number.ToString("D6") & "-" & SelProduct.ProductName & sCliName
' Nome file
Dim fileName As String = Map.refMainWindowVM.MainWindowM.sKeygenDataDir & "\" & sLicName & ".Kge"
fileName = ManageFile.ComputeFileName(fileName, Path.GetFileNameWithoutExtension(fileName))
' Aggiorno nome licenza col nuovo nome calcolato del file
sLicName = Path.GetFileNameWithoutExtension(fileName)
' Scrivo il file
Dim StringFile As New List(Of String)
StringFile.Add(";")
@@ -621,9 +623,16 @@ Public Class NewLicencePageVM
Return
End Try
' Ora aggiungo la licenza al DB
' Ora leggo il contenuto del file .lic generato e aggiungo la licenza al DB
Dim textLic As String = String.Empty
Try
textLic = File.ReadAllText(Path.ChangeExtension(fileName.Replace("\", "\\"), ".lic"))
Catch ex As Exception
MessageBox.Show("File .lic non trovato", "LicenceManager Error")
Return
End Try
Try
Dim textLic As String = File.ReadAllText(Path.ChangeExtension(fileName.Replace("\", "\\"), ".lic"))
If String.IsNullOrEmpty(NestKey) Or String.IsNullOrWhiteSpace(NestKey) Then
Query = "INSERT INTO " & DB_LICENCE & " (" & DB_PRODUCTID & ", " & DB_PRODUCTVERSION & ", " & DB_PRODUCTLEVEL & ", " &