diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 45e51e6..91156d3 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/NewClientPage/NewClientPageVM.vb b/NewClientPage/NewClientPageVM.vb index 673ad16..991e686 100644 --- a/NewClientPage/NewClientPageVM.vb +++ b/NewClientPage/NewClientPageVM.vb @@ -128,7 +128,7 @@ Public Class NewClientPageVM Not IsNothing(SelReseller) Then ' Aggiungo un rivenditore al Db Dim Query As String = "INSERT INTO " & DB_CLIENT & " (" & DB_NAME & ", " & DB_RESELLERID & ", " & DB_EMAIL & ")" & - " VALUES ('" & m_Name & "', " & + " VALUES ('" & Trim(m_Name) & "', " & "'" & SelReseller.ResellerID & "', " & "'" & m_Email & "')" ManageDb.ExecuteQuery(Query) diff --git a/NewLicencePage/NewLicencePageVM.vb b/NewLicencePage/NewLicencePageVM.vb index bb7ad97..600a837 100644 --- a/NewLicencePage/NewLicencePageVM.vb +++ b/NewLicencePage/NewLicencePageVM.vb @@ -580,15 +580,25 @@ Public Class NewLicencePageVM Return End Try - ' Lancio il generatore di licenza - Dim sParams As String = """" & fileName & """ 1" - Dim proc As Process = Process.Start(Map.refMainWindowVM.MainWindowM.sKeygenPath, sParams) + Dim proc As Process = Nothing + Try + ' Lancio il generatore di licenza + Dim sParams As String = """" & fileName & """ 1" + proc = Process.Start(Map.refMainWindowVM.MainWindowM.sKeygenPath, sParams) - ' Attendo il termine del processo - While Not proc.HasExited - proc.Refresh() - System.Threading.Thread.Sleep(50) - End While + ' Attendo il termine del processo + While Not proc.HasExited + proc.Refresh() + System.Threading.Thread.Sleep(50) + End While + Catch ex As Exception + If File.Exists(Map.refMainWindowVM.MainWindowM.sKeygenPath) Then + MessageBox.Show("Errore nell'esecuzione di KeyGenerator", "LicenceManager Error") + Else + MessageBox.Show("Il percorso di KeyGenerator specificato nel file INI non esiste", "LicenceManager Error") + End If + Return + End Try ' Errore nella generazione della licenza If proc.ExitCode <> 0 Then diff --git a/UpdateClientPage/UpdateClientPageVM.vb b/UpdateClientPage/UpdateClientPageVM.vb index 4dd9b6f..96cef16 100644 --- a/UpdateClientPage/UpdateClientPageVM.vb +++ b/UpdateClientPage/UpdateClientPageVM.vb @@ -130,7 +130,7 @@ Public Class UpdateClientPageVM Query &= " SET " If Not String.IsNullOrWhiteSpace(Name) Then EvalWhere(bFirstWhere, Query) - Query &= DB_NAME & " = '" & Name & "' " + Query &= DB_NAME & " = '" & Trim(Name) & "' " End If If Not String.IsNullOrWhiteSpace(Email) Then EvalWhere(bFirstWhere, Query) diff --git a/UpdateLicencePage/UpdateLicencePageVM.vb b/UpdateLicencePage/UpdateLicencePageVM.vb index 904a82d..7c777d6 100644 --- a/UpdateLicencePage/UpdateLicencePageVM.vb +++ b/UpdateLicencePage/UpdateLicencePageVM.vb @@ -664,15 +664,25 @@ Public Class UpdateLicencePageVM Return End Try - ' Lancio il generatore di licenza - Dim sParams As String = """" & FilePath & """ 1" - Dim proc As Process = Process.Start(Map.refMainWindowVM.MainWindowM.sKeygenPath, sParams) + Dim proc As Process = Nothing + Try + ' Lancio il generatore di licenza + Dim sParams As String = """" & FilePath & """ 1" + proc = Process.Start(Map.refMainWindowVM.MainWindowM.sKeygenPath, sParams) - ' Attendo il termine del processo - While Not proc.HasExited - proc.Refresh() - System.Threading.Thread.Sleep(50) - End While + ' Attendo il termine del processo + While Not proc.HasExited + proc.Refresh() + System.Threading.Thread.Sleep(50) + End While + Catch + If File.Exists(Map.refMainWindowVM.MainWindowM.sKeygenPath) Then + MessageBox.Show("Errore nell'esecuzione di KeyGenerator", "LicenceManager Error") + Else + MessageBox.Show("Il percorso di KeyGenerator specificato nel file INI non esiste", "LicenceManager Error") + End If + Return + End Try ' Errore nella generazione della licenza If proc.ExitCode <> 0 Then @@ -842,15 +852,25 @@ Public Class UpdateLicencePageVM Return End Try - ' Lancio il generatore di licenza - Dim sParams As String = """" & FilePath & """ 1" - Dim proc As Process = Process.Start(Map.refMainWindowVM.MainWindowM.sKeygenPath, sParams) + Dim proc As Process = Nothing + Try + ' Lancio il generatore di licenza + Dim sParams As String = """" & FilePath & """ 1" + proc = Process.Start(Map.refMainWindowVM.MainWindowM.sKeygenPath, sParams) - ' Attendo il termine del processo - While Not proc.HasExited - proc.Refresh() - System.Threading.Thread.Sleep(50) - End While + ' Attendo il termine del processo + While Not proc.HasExited + proc.Refresh() + System.Threading.Thread.Sleep(50) + End While + Catch + If File.Exists(Map.refMainWindowVM.MainWindowM.sKeygenPath) Then + MessageBox.Show("Errore nell'esecuzione di KeyGenerator", "LicenceManager Error") + Else + MessageBox.Show("Il percorso di KeyGenerator specificato nel file INI non esiste", "LicenceManager Error") + End If + Return + End Try ' Errore nella generazione della licenza If proc.ExitCode <> 0 Then