LicenceManager 2.1b5:

- Pulsante Delete cancella il record ma rimane nella pagina Search
- Lettura file .ini adattata al lettore già presente nell'applicativo
- Rinominati i file di configurazione in LicenceManager (.ini/.lic)
- Rinominato il file d Log
- Percorso KeyGenerator nel file .ini 
- Proposta data di oggi di default in NewLicencePage 
- ComboBox per ProductLevel con 1,5,10
- ComboBox in ordine di numero
- Aggiunti "---ANY---" nelle comboBox di SearchKeyPage 
- SearchKey: Risultati di ricerca in ordine di numero
- Adattamento al valore restituito (0 o 1) da KeyGenerator
- Importazione AboutBox OmagCUT (DA SISTEMARE)
This commit is contained in:
Renzo Lanza
2019-03-06 15:33:16 +00:00
parent 9ab0d0cef5
commit 747d4c746d
22 changed files with 360 additions and 89 deletions
+60
View File
@@ -0,0 +1,60 @@
<Window x:Class="AboutBoxWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
FontFamily="./Resources/Fonts/#Century Gothic"
Title="AboutBoxWD" Height="469.15" Width="511.8" WindowStyle="None" ResizeMode="NoResize"
AllowsTransparency="True" Background="Transparent" ShowInTaskbar="False">
<!-- Definizione dell'AboutBox -->
<Border>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Name="LogoBrd" Grid.Column="1" Background="White">
<Image Source="Resources/LogoLicenceManager.jpg" Stretch="Uniform"/>
</Border>
</Grid>
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18" />
<TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="KeyLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="MachineLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="ProjectLbl" Grid.Column="1" Grid.Row="7" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="8" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="15" />
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="10" IsCancel="True"
Margin="1,0"/>
</Grid>
</Border>
</Window>
+42
View File
@@ -0,0 +1,42 @@
Imports EgtUILib
Public Class AboutBoxWD
' Riferimento alla MainWindow
' Private m_MainWindow As MainWindowVM = DirectCast(Application.Current.MainWindow, MainWindowVM)
Sub New(Owner As Window)
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.Owner = Owner
Me.Top = Owner.Top + (Owner.Height / 2 - Me.Height / 2)
Me.Left = Owner.Left + (Owner.Width / 2 - Me.Width / 2)
Me.ShowDialog()
End Sub
Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
DescriptionLbl.Text = My.Application.Info.Description.ToString()
' VersionLbl.Text = "Version : " & m_MainWindow.GetVersion()
Dim sKey As String = String.Empty
EgtGetKeyInfo(sKey)
' Dim sOpts As String = m_MainWindow.GetKeyOptions().ToString()
#If TRIAL Then
If sKey.Length() <= 14 Then
KeyLbl.Text = sKey & " - " & sOpts
Else
KeyLbl.Text = sKey.Substring(0, 9) & "..." & sKey.Substring(sKey.Length() - 5) & " - " & sOpts
End If
#Else
KeyLbl.Text = sKey & " - " ' & sOpts
#End If
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
'MachineLbl.Text = "Machine : " & m_MainWindow.m_CurrentMachine.sMachineName
'ProjectLbl.Text = "Project : " & m_MainWindow.m_CurrentProjectPageUC.GetCurrentProjectName()
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
End Sub
End Class
+2 -2
View File
@@ -19,7 +19,7 @@ Module ConstGen
Public Const K_DATAROOT As String = "DataRoot"
' File con dati di licenza
Public Const LIC_FILE_NAME As String = "OmagOFFICE.lic"
Public Const LIC_FILE_NAME As String = "LicenceManager.lic"
Public Const S_LICENCE As String = "Licence"
Public Const K_KEY As String = "Key"
@@ -39,7 +39,7 @@ Module ConstGen
End Enum
' File di log generale
Public Const GENLOG_FILE_NAME As String = "OmagOFFICELog#.txt"
Public Const GENLOG_FILE_NAME As String = "LicenceManagerLog#.txt"
' Sottodirettorio di configurazione
Public Const CONF_DIR As String = "Config"
+11 -1
View File
@@ -13,7 +13,7 @@
Module ConstIni
Public Const INI_FILE_NAME As String = "OmagOFFICE.ini"
Public Const INI_FILE_NAME As String = "LicenceManager.ini"
Public Const S_GENERAL As String = "General"
Public Const K_DEBUG As String = "Debug"
@@ -34,6 +34,16 @@ Module ConstIni
Public Const K_CONTOURFROMCAMERA As String = "ContourFromCamera"
Public Const K_SUPPORT As String = "Support"
Public Const S_KEYGENERATOR As String = "KeyGenerator"
Public Const K_PATH As String = "Path"
Public Const S_CONNECTION As String = "Connection"
Public Const K_SERVER As String = "Server"
Public Const K_PORT As String = "Port"
Public Const K_DATABASE As String = "Database"
Public Const K_UID As String = "Uid"
Public Const K_PWD As String = "Pwd"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
+7
View File
@@ -104,6 +104,9 @@
<Compile Include="AboutBox.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="AboutBoxWD.xaml.vb">
<DependentUpon>AboutBoxWD.xaml</DependentUpon>
</Compile>
<Compile Include="Application.xaml.vb">
<DependentUpon>Application.xaml</DependentUpon>
<SubType>Code</SubType>
@@ -273,6 +276,10 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Page Include="AboutBoxWD.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="KeyPage\KeyPageV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
+36
View File
@@ -28,6 +28,20 @@ Public Class MainWindowM
End Get
End Property
Private m_sDbConnect As String = String.Empty
Public ReadOnly Property sDbConnect As String
Get
Return m_sDbConnect
End Get
End Property
Private m_sKeygenPath As String = String.Empty
Public ReadOnly Property sKeygenPath As String
Get
Return m_sKeygenPath
End Get
End Property
Private m_nDebug As Integer = 0
Private m_objMutex As Mutex
@@ -106,6 +120,28 @@ Public Class MainWindowM
m_sDataDir = m_sDataRoot & "\" & DATA_DIR
' Impostazione path Ini file
IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
' Leggo e imposto il percorso di KeyGenerator
m_sKeygenPath = String.Empty
GetMainPrivateProfileString(S_KEYGENERATOR, K_PATH, INI_FILE_NAME, m_sKeygenPath)
Map.refNewLicencePageVM.KeygenPath = m_sKeygenPath
' Leggo e imposto la stringa di connessione al DB
m_sDbConnect = String.Empty
Dim sDbConnectBuilder As String = String.Empty
GetMainPrivateProfileString(S_CONNECTION, K_SERVER, INI_FILE_NAME, sDbConnectBuilder)
m_sDbConnect &= "Server=" & sDbConnectBuilder
GetMainPrivateProfileString(S_CONNECTION, K_PORT, INI_FILE_NAME, sDbConnectBuilder)
m_sDbConnect &= ";Port=" & sDbConnectBuilder
GetMainPrivateProfileString(S_CONNECTION, K_DATABASE, INI_FILE_NAME, sDbConnectBuilder)
m_sDbConnect &= ";Database=" & sDbConnectBuilder
GetMainPrivateProfileString(S_CONNECTION, K_UID, INI_FILE_NAME, sDbConnectBuilder)
m_sDbConnect &= ";Uid=" & sDbConnectBuilder
GetMainPrivateProfileString(S_CONNECTION, K_PWD, INI_FILE_NAME, sDbConnectBuilder)
m_sDbConnect &= ";Pwd=" & sDbConnectBuilder
ManageDb.DbPath = m_sDbConnect
ManageDb.DbConnection = New MySql.Data.MySqlClient.MySqlConnection(m_sDbConnect)
' Verifico indice di istanza
ManageInstance()
' Imposto tipo di chiave
+31 -2
View File
@@ -11,7 +11,36 @@
Icon="LogoLicenceManager.Ico"
WindowStartupLocation="CenterScreen">
<!--Pannello principale -->
<ContentControl Content="{Binding ProjectContent}"/>
<!--Pannello principale -->
<!--<ContentControl Content="{Binding ProjectContent}"/>-->
<!-- ** Definizione della Grid della MainWindow ** -->
<Grid Name="MainWindowGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="73*"/>
<ColumnDefinition Width="324*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<ContentControl Content="{Binding ProjectContent}" Grid.ColumnSpan="2" Grid.Row="1"/>
<!-- ** Definizione della Grid della Row 0 (Barra superiore) ** -->
<Grid Grid.ColumnSpan="2" Margin="0,0,-0.4,0.2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="11*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Name="LogoBrd" Background="Transparent">
<Image Source="/LicenseManager;component/LogoLicenceManager.ico" Stretch="Uniform" Margin="1"/>
</Border>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
+4
View File
@@ -33,6 +33,10 @@ Class MainWindowV
End If
End Sub
' Evento che apre AboutBox quando viene clickato il logo
Private Sub LogoBrd_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles LogoBrd.MouseDown
Dim AboutBox As New AboutBoxWD(Me)
End Sub
#End Region ' EVENTS
End Class
+46 -41
View File
@@ -1,35 +1,40 @@
Imports EgtWPFLib5
Imports LicenseManager
Public Class MainWindowVM
Inherits VMBase
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Enum ProjectModeOpt As Integer
MAINMENU = 0
NEWCLIENT = 1
NEWKEY = 2
NEWLICENCE = 3
NEWPRODUCT = 4
NEWVERSION = 5
NEWRESELLER = 6
SEARCHCLIENT = 7
SEARCHKEY = 8
SEARCHLICENCE = 9
SEARCHPRODUCT = 10
SEARCHVERSION = 11
SEARCHRESELLER = 12
UPDATECLIENT = 13
UPDATEKEY = 14
UPDATELICENCE = 15
UPDATEPRODUCT = 16
UPDATEVERSION = 17
UPDATERESELLER = 18
Friend Enum ProjectModeOpt As Integer
MAINMENU = 0
NEWCLIENT = 1
NEWKEY = 2
NEWLICENCE = 3
NEWPRODUCT = 4
NEWVERSION = 5
NEWRESELLER = 6
SEARCHCLIENT = 7
SEARCHKEY = 8
SEARCHLICENCE = 9
SEARCHPRODUCT = 10
SEARCHVERSION = 11
SEARCHRESELLER = 12
UPDATECLIENT = 13
UPDATEKEY = 14
UPDATELICENCE = 15
UPDATEPRODUCT = 16
UPDATEVERSION = 17
UPDATERESELLER = 18
End Enum
End Enum
Private m_MainWindowM As MainWindowM
Friend ReadOnly Property MainWindowM As MainWindowM
Public Shared Narrowing Operator CType(v As Window) As MainWindowVM
Throw New NotImplementedException()
End Operator
Private m_MainWindowM As MainWindowM
Friend ReadOnly Property MainWindowM As MainWindowM
Get
Return m_MainWindowM
End Get
@@ -262,26 +267,26 @@ Public Class MainWindowVM
#Region "COMMANDS"
'#Region "AboutBoxCommand"
'#Region "AboutBoxCommand"
' ' Returns a command that manage the MainWindow_Unloaded command
' Public ReadOnly Property AboutBoxCommand() As ICommand
' Get
' If m_cmdAboutBox Is Nothing Then
' m_cmdAboutBox = New Command(AddressOf AboutBox)
' End If
' Return m_cmdAboutBox
' End Get
' End Property
' ' Returns a command that manage the MainWindow_Unloaded command
' Public ReadOnly Property AboutBoxCommand() As ICommand
' Get
' If m_cmdAboutBox Is Nothing Then
' m_cmdAboutBox = New Command(AddressOf AboutBox)
' End If
' Return m_cmdAboutBox
' End Get
' End Property
' ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
' Public Sub AboutBox(ByVal param As Object)
' Dim AboutBoxWindow As New AboutBoxV
' AboutBoxWindow.Owner = Application.Current.MainWindow
' AboutBoxWindow.ShowDialog()
' End Sub
' ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
' Public Sub AboutBox(ByVal param As Object)
' Dim AboutBoxWindow As New AboutBoxV
' AboutBoxWindow.Owner = Application.Current.MainWindow
' AboutBoxWindow.ShowDialog()
' End Sub
'#End Region ' AboutBoxCommand
'#End Region ' AboutBoxCommand
#End Region ' COMMANDS
+2 -2
View File
@@ -55,5 +55,5 @@ Imports System.Windows
' usando l'asterisco '*' come illustrato di seguito:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.1.2.4")>
<Assembly: AssemblyFileVersion("2.1.2.4")>
<Assembly: AssemblyVersion("2.1.2.5")>
<Assembly: AssemblyFileVersion("2.1.2.5")>
+3
View File
@@ -156,6 +156,9 @@ Public Class NewKeyPageVM
' Carico valore di default State (InDeposito)
StateList.Remove("---ANY---")
SelState = String.Empty
KeyDate = Date.Now
NotifyPropertyChanged("KeyDate")
End Sub
#End Region ' METHODS
+7 -5
View File
@@ -66,12 +66,14 @@
Grid.Row="2"
Style="{StaticResource ParametersTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding ProductLevel}"
Grid.Column="1"
Grid.Row="2"
Style="{StaticResource ParameterTextBox}"/>
<ComboBox ItemsSource="{Binding ProductLevel}"
SelectedItem="{Binding SelProductLevel}"
SelectedIndex="-1"
Grid.Column="1"
Grid.Row="2"
Style="{StaticResource ParametersComboBox}"/>
<TextBlock Text="{Binding ProductDeadlineMsg}"
<TextBlock Text="{Binding ProductDeadlineMsg}"
Grid.Column="0"
Grid.Row="3"
Style="{StaticResource ParametersTextBlock}"/>
+53 -16
View File
@@ -7,14 +7,21 @@ Public Class NewLicencePageVM
#Region "FIELDS & PROPERTIES"
Private m_ProductLevel As String
Public Property ProductLevel As String
Private m_ProductLevel As New List(Of Integer)({1, 5, 10})
Public ReadOnly Property ProductLevel As List(Of Integer)
Get
Return m_ProductLevel
End Get
Set(value As String)
m_ProductLevel = value
NotifyPropertyChanged("ProductLevel")
End Property
Private m_SelProductLevel As Integer
Public Property SelProductLevel As Integer
Get
Return m_SelProductLevel
End Get
Set(value As Integer)
m_SelProductLevel = value
NotifyPropertyChanged("SelProductLevel")
End Set
End Property
@@ -132,7 +139,9 @@ Public Class NewLicencePageVM
If Not IsNothing(m_SelIsDongle) Then
' Carico lista numeri key
Dim nQuery As String = "SELECT * FROM " & DB_KEY & " WHERE " & DB_ISDONGLE & " = " & m_SelIsDongle
Dim nQuery As String = "SELECT * FROM " & DB_KEY &
" WHERE " & DB_ISDONGLE & " = " & m_SelIsDongle &
" ORDER BY " & DB_NUMBER
m_NumberList = ManageDb.ExecuteKeyQuery(nQuery)
End If
NotifyPropertyChanged("NumberList")
@@ -194,6 +203,16 @@ Public Class NewLicencePageVM
End Get
End Property
Private m_KeygenPath As String ' String.Empty
Public Property KeygenPath As String
Get
Return m_KeygenPath
End Get
Set(value As String)
m_KeygenPath = value
End Set
End Property
' Definizione comandi
Private m_cmdGenerate As Command
Private m_cmdCancel As Command
@@ -303,7 +322,8 @@ Public Class NewLicencePageVM
' Svuoto campi
SelVersion = Nothing
ProductLevel = String.Empty
SelProductLevel = Nothing
NotifyPropertyChanged("SelProductLevel")
ClientName = String.Empty
SelNumber = Nothing
@@ -320,6 +340,13 @@ Public Class NewLicencePageVM
m_Option1.Clear()
m_Option2.Clear()
m_ProductDeadline = Date.Now
NotifyPropertyChanged("ProductDeadline")
m_OptionDeadline = Date.Now
NotifyPropertyChanged("OptionDeadline")
m_LicenseDate = Date.Now
NotifyPropertyChanged("LicenseDate")
End Sub
Private Sub LoadOptions(nIndex As Integer, OptionList As ObservableCollection(Of KeyOption))
@@ -379,7 +406,7 @@ Public Class NewLicencePageVM
Public Sub Generate(ByVal param As Object)
If Not IsNothing(SelNumber) And Not IsNothing(m_Option1) And Not IsNothing(m_Option2) And
Not IsNothing(m_SelProduct) And Not IsNothing(m_SelVersion) And Not IsNothing(m_ProductLevel) And
Not IsNothing(m_SelProduct) And Not IsNothing(m_SelVersion) And Not IsNothing(m_SelProductLevel) And
Not IsNothing(m_ProductDeadline) And Not IsNothing(m_OptionDeadline) And Not IsNothing(m_LicenseDate) Then
'Cerco LockID associato alla chiave
Dim Query As String = "SELECT " & DB_LOCKID & " FROM " & DB_KEY & " WHERE " & DB_NUMBER & " = " & SelNumber.Number & " AND " & DB_ISDONGLE & " = " & If(GetSelIsDongle(), 1, 0)
@@ -427,16 +454,20 @@ Public Class NewLicencePageVM
StringFile.Add("Last = 1")
StringFile.Add("[Licence1]")
StringFile.Add("Data=" & Format(Now, "yyyy/MM/dd hh:mm:ss"))
Dim cName As String = String.Empty
If Not IsNothing(m_ClientName) Then
cName = m_ClientName
End If
If (GetSelIsDongle()) Then
StringFile.Add("Customer=Key-" & SelNumber.Number.ToString("D6")) ' & "-" & m_NameClient & "-" & SelProduct.ProductName)
StringFile.Add("Customer=Key-" & SelNumber.Number.ToString("D6") & "-" & cName) ' & "-" & m_NameClient & "-" & SelProduct.ProductName)
Else
StringFile.Add("Customer=Soft-" & SelNumber.Number.ToString("D6")) ' SISTEMARE CON NUMERO PROGRESSIVO
StringFile.Add("Customer=Soft-" & SelNumber.Number.ToString("D6") & "-" & cName) ' SISTEMARE CON NUMERO PROGRESSIVO
End If
StringFile.Add("LockID=" & LockID)
StringFile.Add("ClearLockId=")
StringFile.Add("Product=" & SelProduct.ProductNumber)
StringFile.Add("Ver=" & SelVersion.VersionNumber) ' & SelVersion.VersionID)
StringFile.Add("Lev=" & ProductLevel)
StringFile.Add("Lev=" & SelProductLevel)
StringFile.Add("ExpDays=" & DayProductDeadline)
StringFile.Add("Opt1=" & nDecOption1)
StringFile.Add("Opt2=" & nDecOption2)
@@ -451,7 +482,8 @@ Public Class NewLicencePageVM
fileName &= " 1"
' Process.Start("C:\Program Files\Notepad++\notepad++.exe", fileName)
Dim proc As Process = Process.Start("C:\EgtProg\KeyGenerator\KeyGeneratorR32.exe", fileName)
' Dim kgPath As String = Map.refMainWindowVM.MainWindowM.sKeygenPath
Dim proc As Process = Process.Start(KeygenPath, fileName)
'MessageBox.Show("DA INSERIRE: " & Constants.vbCrLf &
' " -Numero Prodotto: " & m_SelProduct.ProductNumber & Constants.vbCrLf &
@@ -463,13 +495,15 @@ Public Class NewLicencePageVM
System.Threading.Thread.Sleep(50)
End While
Dim ask As MsgBoxResult = MsgBox("Licenza generata correttamente?", MsgBoxStyle.YesNo)
If ask = MsgBoxResult.Yes Then
'Dim ask As MsgBoxResult = MsgBox("Licenza generata correttamente?", MsgBoxStyle.YesNo)
'If ask = MsgBoxResult.Yes Then
If proc.ExitCode = 0 Then
' Aggiungo una licenza al Db
Query = "INSERT INTO " & DB_LICENCE & " (" & DB_PRODUCTID & ", " & DB_PRODUCTVERSION & ", " & DB_PRODUCTLEVEL & ", " & DB_PRODUCTDEADLINE & ", " & DB_OPTION1 & ", " & DB_OPTION2 & ", " & DB_OPTIONDEADLINE & ", " & DB_LOCKID & ", " & DB_FILE & ", " & DB_DATE & ")" &
" VALUES ('" & m_SelProduct.ProductID & "', " &
"'" & m_SelVersion.VersionNumber & "', " & ' "'" & m_SelVersion.VersionID & "', " &
"'" & m_ProductLevel & "', " &
"'" & m_SelProductLevel & "', " &
"Date('" & (String.Format("{0:yyyy-MM-dd}", ProductDeadline)) & "'), " &
"'" & nDecOption1 & "', " &
"'" & nDecOption2 & "', " &
@@ -478,6 +512,9 @@ Public Class NewLicencePageVM
"'" & fileName.Replace("\", "\\") & "', " & ' SISTEMARE CON NOME FILE
"'" & Format(LicenseDate, "yyyy-MM-dd") & "')"
ManageDb.ExecuteQuery(Query)
Else
' C'è un errore
MessageBox.Show("La Licenza non è stata generata correttamente", "KeyGenerator Error")
End If
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
@@ -490,7 +527,7 @@ Public Class NewLicencePageVM
' MessageBox.Show("Il Number Key corrispondente non esiste")
'End If
Else
MessageBox.Show("Completare i campi presenti")
MessageBox.Show("Completare i campi presenti")
End If
End Sub
+3 -2
View File
@@ -236,8 +236,9 @@ Public Class SearchClientPageVM
If Result <> 0 Then
MsgBox("Operation executed")
End If
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
Else
' Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHCLIENT
Search(param)
Else
MessageBox.Show("Non è stato selezionato nessun cliente")
End If
End Sub
+3 -1
View File
@@ -200,6 +200,7 @@ Public Class SearchKeyPageVM
Query = Query.Substring(0, Query.Length - suffixToRemove.Length)
End If
End If
Query &= " ORDER BY " & DB_NUMBER
m_SearchResult = New ObservableCollection(Of SearchKey)(ManageDb.ExecuteSearchKeyQuery(Query))
If (m_SearchResult.Count = 0) Then
MessageBox.Show("Nessun risultato per i filtri impostati")
@@ -288,7 +289,8 @@ Public Class SearchKeyPageVM
If Result <> 0 Then
MsgBox("Operation executed")
End If
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
' Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
Search(param)
Else
MessageBox.Show("Non è stata selezionata nessuna chiave")
End If
+3 -1
View File
@@ -61,6 +61,8 @@
Grid.Row="1"
Style="{StaticResource ParametersComboBox}"/>
<TextBlock HorizontalAlignment="Right" Grid.Row="1" TextWrapping="Wrap" Text="(Immettere 0 in 'Product version' per visualizzare qualsiasi numero)" VerticalAlignment="Top" Background="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}" Margin="0,31,9.147,0" Grid.RowSpan="2"/>
<TextBlock Text="{Binding ProductLevelMsg}"
Grid.Column="0"
Grid.Row="2"
@@ -199,7 +201,7 @@
Width="1*"/>
</DataGrid.Columns>
</DataGrid>
<UniformGrid Grid.Row="7" Grid.ColumnSpan="4" Columns="4">
<Button Content="{Binding SearchMsg}"
Command="{Binding Search_Command}"
+21 -7
View File
@@ -283,18 +283,21 @@ Public Class SearchLicencePageVM
Dim Query As String
Query = "SELECT * FROM " & DB_PRODUCT
m_ProductList = ManageDb.ExecuteProductQuery(Query)
m_ProductList.Add(New Product("---ANY---", 0, 0, 0, 0))
NotifyPropertyChanged("ProductList")
' Carico lista ProductVersion
Query = "SELECT * FROM " & DB_VERSION & " GROUP BY " & DB_VERSIONNUMBER
m_VersionList = ManageDb.ExecuteVersionQuery(Query)
m_VersionList.Sort(Function(x, y) y.VersionNumber.CompareTo(x.VersionNumber))
m_VersionList.Add(New Version(0, 0, 0)) ' "---ANY---"
NotifyPropertyChanged("VersionList")
' Carico lista ProductLevel
Query = "SELECT " & DB_PRODUCTLEVEL & " FROM " & DB_LICENCE & " GROUP BY " & DB_PRODUCTLEVEL
m_ProductLevelList = ManageDb.ExecuteStringQuery(Query, DB_PRODUCTLEVEL)
m_ProductLevelList.Sort(Function(x, y) CInt(y).CompareTo(CInt(x)))
m_ProductLevelList.Add("---ANY---")
NotifyPropertyChanged("ProductLevelList")
' Cancello liste opzioni
@@ -383,16 +386,22 @@ Public Class SearchLicencePageVM
Not String.IsNullOrWhiteSpace(File) Then
Query &= " WHERE "
If Not IsNothing(m_SelProduct) Then
EvalWhere(bFirstWhere, Query)
Query &= DB_PRODUCTNAME & " LIKE '" & m_SelProduct.ProductName & "' "
If Not m_SelProduct.ProductName.Equals("---ANY---") Then
EvalWhere(bFirstWhere, Query)
Query &= DB_PRODUCTNAME & " LIKE '" & m_SelProduct.ProductName & "' "
End If
End If
If Not IsNothing(m_SelVersion) Then
EvalWhere(bFirstWhere, Query)
Query &= DB_PRODUCTVERSION & " LIKE '" & m_SelVersion.VersionNumber & "' "
If m_SelVersion.VersionNumber <> 0 Then
EvalWhere(bFirstWhere, Query)
Query &= DB_PRODUCTVERSION & " LIKE '" & m_SelVersion.VersionNumber & "' "
End If
End If
If Not String.IsNullOrWhiteSpace(m_SelProductLevel) Then
EvalWhere(bFirstWhere, Query)
Query &= DB_PRODUCTLEVEL & " LIKE '" & m_SelProductLevel & "' "
If Not m_SelProductLevel.Equals("---ANY---") Then
EvalWhere(bFirstWhere, Query)
Query &= DB_PRODUCTLEVEL & " LIKE '" & m_SelProductLevel & "' "
End If
End If
If Not IsNothing(ProductDeadline) Then
EvalWhere(bFirstWhere, Query)
@@ -423,6 +432,10 @@ Public Class SearchLicencePageVM
Query &= DB_DATE & " LIKE '%" & Format(LicenseDate, "yyyy-MM-dd") & "%' "
End If
Query = Query.TrimEnd(","c, " "c)
Dim suffixToRemove As String = " WHERE"
If Not IsNothing(Query) And Not IsNothing(suffixToRemove) And Query.EndsWith(suffixToRemove) Then
Query = Query.Substring(0, Query.Length - suffixToRemove.Length)
End If
End If
m_SearchResult = New ObservableCollection(Of SearchLicence)(ManageDb.ExecuteSearchLicenceQuery(Query))
If (m_SearchResult.Count = 0) Then
@@ -512,7 +525,8 @@ Public Class SearchLicencePageVM
If Result <> 0 Then
MsgBox("Operation executed")
End If
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
' Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
Search(param)
Else
MessageBox.Show("Non è stata selezionata nessuna licenza")
End If
+2 -1
View File
@@ -344,7 +344,8 @@ Public Class SearchProductPageVM
If Result <> 0 Then
MsgBox("Operation executed")
End If
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
' Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
Search(param)
Else
MessageBox.Show("Non è stato selezionato nessun prodotto")
End If
+2 -1
View File
@@ -210,7 +210,8 @@ Public Class SearchResellerPageVM
If Result <> 0 Then
MsgBox("Operation executed")
End If
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
' Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
Search(param)
Else
MessageBox.Show("Non è stato selezionato nessuno rivenditore")
End If
+2 -1
View File
@@ -232,7 +232,8 @@ Public Class SearchVersionPageVM
If Result <> 0 Then
MsgBox("Operation executed")
End If
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
' Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
Search(param)
Else
MessageBox.Show("Non è stata selezionata nessuna versione")
End If
+1 -1
View File
@@ -26,7 +26,7 @@ Public Class IniManager
#Region "METODO FUNZIONANTE"
Public Function ReadIni() As String
Dim reader As StreamReader = My.Computer.FileSystem.OpenTextFileReader("C:\EgtProg\LicenceManager\config.ini")
Dim reader As StreamReader = My.Computer.FileSystem.OpenTextFileReader("C:\EgtData\LicenceManager\Config\LicenceManager.ini")
Dim a As String
Dim result As String = ""
+19 -5
View File
@@ -5,16 +5,30 @@ Module ManageDb
#Region "FIELDS & PROPERTIES"
Dim Ini As New IniManager
Private m_DbPath As String = Ini.ReadIni() ' GetIniValue("Connection", "Server", "C:\\EgtDev\\LicenseManager2\\config.ini") ' DB_CONNECTIONSTRING
' Dim Ini As New IniManager
' Private m_DbPath As String = Ini.ReadIni() ' GetIniValue("Connection", "Server", "C:\\EgtDev\\LicenseManager2\\config.ini") ' DB_CONNECTIONSTRING
' Private m_DbPath As String = Map.refMainWindowVM.MainWindowM.sDbConnect ' Map.refMainWindowVM.MainWindowM.sConfigDir & "\" & INI_FILE_NAME
' Private m_DbPath As String = DB_CONNECTIONSTRING
Private m_DbConnection As MySqlConnection = New MySqlConnection(m_DbPath)
Private m_DbPath As String ' String.Empty
Public ReadOnly Property DbConnection As MySqlConnection
Public Property DbPath As String
Get
Return m_DbPath
End Get
Set(value As String)
m_DbPath = value
End Set
End Property
Private m_DbConnection As MySqlConnection = New MySqlConnection(m_DbPath)
Public Property DbConnection As MySqlConnection
Get
Return m_DbConnection
End Get
Set(value As MySqlConnection)
m_DbConnection = value
End Set
End Property
#End Region ' FIELDS & PROPERTIES
@@ -26,7 +40,7 @@ Module ManageDb
'End Sub
Friend Function ConnectToDb() As Boolean
Dim DbPath As String = DB_CONNECTIONSTRING ' Map.refMainWindowVM.MainWindowM.sDataDir & "\" & DB_FILENAME
Dim DbPath As String = Map.refMainWindowVM.MainWindowM.sDbConnect ' Map.refMainWindowVM.MainWindowM.sDataDir & "\" & DB_FILENAME
m_DbPath = DbPath
' If Not File.Exists(DbPath) Then Return False
m_DbConnection = New MySqlConnection(DbPath)