LicenceManager 2.1c5:

- Aggiunti 2 nuovi Stati Chiave: Interna e InternaEgt
- Entrando in ogni SearchPage viene subito riempita la tabella dell'elemento relativo (Chiave, Licenze, ecc.) senza bisogno di premere "Search"
- Pulsante "Cancel" è diventato "Close" e spostato in fondo a destra
- Aggiunto LicenceBox: form che visualizza il contenuto del file di licenza e ne permette il download (sostituisce il MessageBox che c'era prima)
- "Update (Overwrite)" ora è seguito dalla rigenerazione della licenza
- MainMenu non include più i pulsanti "New [...]". Questi sono stati tutti spostati all'interno delle SearchPage
This commit is contained in:
Renzo Lanza
2019-03-20 15:56:23 +00:00
parent 697eaab19a
commit 80360b0306
32 changed files with 498 additions and 123 deletions
+3 -1
View File
@@ -151,7 +151,7 @@ Public Class KeyPageVM
End Set
End Property
Private m_StateList As New List(Of String)({"Consegnata", "InDeposito", "InDepositoEgt", "Guasta", "---ANY---"}) ' Key.KeyState)({Key.KeyState.Consegnata, Key.KeyState.InDeposito, Key.KeyState.Guasta, Key.KeyState.ANY})
Private m_StateList As New List(Of String)({"Consegnata", "InDeposito", "InDepositoEgt", "Guasta", "Interna", "InternaEgt", "---ANY---"}) ' Key.KeyState)({Key.KeyState.Consegnata, Key.KeyState.InDeposito, Key.KeyState.Guasta, Key.KeyState.ANY})
Public ReadOnly Property StateList As List(Of String) ' Key.KeyState)
Get
Return m_StateList
@@ -173,6 +173,8 @@ Public Class KeyPageVM
If (value.Equals("InDeposito")) Then m_SelState = Key.KeyState.InDeposito
If (value.Equals("InDepositoEgt")) Then m_SelState = Key.KeyState.InDepositoEgt
If (value.Equals("Guasta")) Then m_SelState = Key.KeyState.Guasta
If (value.Equals("Interna")) Then m_SelState = Key.KeyState.Interna
If (value.Equals("InternaEgt")) Then m_SelState = Key.KeyState.InternaEgt
If (value.Equals("---ANY---")) Then m_SelState = Key.KeyState.ANY
NotifyPropertyChanged("SelState")
End Set
+7
View File
@@ -199,6 +199,9 @@
<DependentUpon>Dictionary.xaml</DependentUpon>
</Compile>
<Compile Include="Utility\IniManager.vb" />
<Compile Include="Utility\LicenceBoxV.xaml.vb">
<DependentUpon>LicenceBoxV.xaml</DependentUpon>
</Compile>
<Compile Include="Utility\ManageDb.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="VersionPage\VersionPageV.xaml.vb">
@@ -365,6 +368,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Utility\LicenceBoxV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="VersionPage\VersionPageV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
+32 -31
View File
@@ -4,36 +4,37 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
DataContext="{StaticResource MainMenuVM}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border BorderBrush="Black"
<Border BorderBrush="Black"
BorderThickness="1"
Height="75"
Grid.Row="0">
<TextBlock Height="50"
<TextBlock Height="50"
Text="Main Menù"
FontSize="30"
TextAlignment="Center"/>
</Border>
</Border>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Button Content="Nuovo cliente"
<!--<Button Content="Nuovo cliente"
Command="{Binding NewClient_Command}"
Height="60"
Width="170"
@@ -68,42 +69,42 @@
Height="60"
Width="170"
Grid.Column="0"
Grid.Row="5"/>
Grid.Row="5"/>-->
<Button Content="Cerca cliente"
Command="{Binding SearchClient_Command}"
Height="60"
Width="170"
Grid.Column="2"
Grid.Column="1"
Grid.Row="0"/>
<Button Content="Cerca chiave"
<Button Content="Cerca chiave"
Command="{Binding SearchKey_Command}"
Height="60"
Width="170"
Grid.Column="2"
Grid.Column="1"
Grid.Row="1"/>
<Button Content="Cerca licenza"
<Button Content="Cerca licenza"
Command="{Binding SearchLicence_Command}"
Height="60"
Width="170"
Grid.Column="2"
Grid.Column="1"
Grid.Row="2"/>
<Button Content="Cerca prodotto"
<Button Content="Cerca prodotto"
Command="{Binding SearchProduct_Command}"
Height="60"
Width="170"
Grid.Column="2"
Grid.Column="1"
Grid.Row="3"/>
<Button Content="Cerca versione"
<Button Content="Cerca versione"
Command="{Binding SearchVersion_Command}"
Height="60"
Width="170"
Grid.Column="2"
Grid.Column="1"
Grid.Row="4"/>
<Button Content="Cerca rivenditore"
Command="{Binding SearchReseller_Command}"
Height="60"
Width="170"
Grid.Column="2"
Grid.Column="1"
Grid.Row="5"/>
</Grid>
+3 -1
View File
@@ -81,7 +81,9 @@ Public Class Key
InDeposito = 1
InDepositoEgt = 2
Guasta = 3
ANY = 4
Interna = 4
InternaEgt = 5
ANY = 6
End Enum
Private m_State As KeyState
+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.1.3.4")>
<Assembly: AssemblyFileVersion("2.1.3.4")>
<Assembly: AssemblyVersion("2.1.3.5")>
<Assembly: AssemblyFileVersion("2.1.3.5")>
+1 -1
View File
@@ -73,7 +73,7 @@ Public Class NewClientPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+1 -1
View File
@@ -114,7 +114,7 @@ Public Class NewKeyPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+1 -1
View File
@@ -295,7 +295,7 @@ Public Class NewLicencePageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+1 -1
View File
@@ -110,7 +110,7 @@ Public Class NewProductPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+1 -1
View File
@@ -51,7 +51,7 @@ Public Class NewResellerPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+1 -1
View File
@@ -25,7 +25,7 @@ Public Class NewVersionPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+7 -4
View File
@@ -45,20 +45,23 @@
</DataGrid>
<UniformGrid Grid.Row="3" Columns="4">
<UniformGrid Grid.Row="3" Columns="5">
<Button Content="{Binding NewMsg}"
Command="{Binding NewClient_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding SearchMsg}"
Command="{Binding SearchClient_Command}"
IsDefault="True"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding UpdateMsg}"
Command="{Binding UpdateClient_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding DeleteMsg}"
Command="{Binding DeleteClient_Command}"
Style="{StaticResource Page_Button}" Background="#FFE5AEAE"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
</UniformGrid>
</Grid>
+35 -4
View File
@@ -44,6 +44,7 @@ Public Class SearchClientPageVM
End Property
' Definizione comandi
Private m_cmdNewClient As Command
Private m_cmdSearch As Command
Private m_cmdCancel As Command
Private m_cmdUpdate As Command
@@ -57,6 +58,12 @@ Public Class SearchClientPageVM
End Get
End Property
Public ReadOnly Property NewMsg As String
Get
Return "New"
End Get
End Property
Public ReadOnly Property SearchMsg As String
Get
Return "Search"
@@ -65,7 +72,7 @@ Public Class SearchClientPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
@@ -100,11 +107,14 @@ Public Class SearchClientPageVM
MyBase.InitClientPage()
' Carico lista Reseller
Dim Query As String = "SELECT * FROM " & DB_RESELLER
m_ResellerList = ManageDb.ExecuteResellerQuery(Query)
Dim resQuery As String = "SELECT * FROM " & DB_RESELLER
m_ResellerList = ManageDb.ExecuteResellerQuery(resQuery)
NotifyPropertyChanged("ResellerList")
m_SearchResult = New ObservableCollection(Of SearchClient)()
' m_SearchResult = New ObservableCollection(Of SearchClient)()
Dim Query As String = "SELECT * FROM " & DB_CLIENT & " INNER JOIN " & DB_RESELLER &
" ON " & DB_CLIENT & "." & DB_RESELLERID & " = " & DB_RESELLER & "." & DB_RESELLERID & " "
m_SearchResult = New ObservableCollection(Of SearchClient)(ManageDb.ExecuteSearchClientQuery(Query))
NotifyPropertyChanged("SearchResult")
End Sub
@@ -113,6 +123,27 @@ Public Class SearchClientPageVM
#Region "COMMANDS"
#Region "NewClient"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property NewClient_Command As ICommand
Get
If m_cmdNewClient Is Nothing Then
m_cmdNewClient = New Command(AddressOf NewClient)
End If
Return m_cmdNewClient
End Get
End Property
Public Sub NewClient(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWCLIENT
End Sub
#End Region ' NewClient
#Region "Search"
' Returns a command that manage the MainWindow_Unloaded command
+7 -4
View File
@@ -54,20 +54,23 @@
</DataGrid.Columns>
</DataGrid>
<UniformGrid Grid.Row="3" Columns="4">
<UniformGrid Grid.Row="3" Columns="5">
<Button Content="{Binding NewMsg}"
Command="{Binding NewKey_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding SearchMsg}"
Command="{Binding SearchKey_Command}"
IsDefault="True"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding UpdateMsg}"
Command="{Binding UpdateKey_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding DeleteMsg}"
Command="{Binding DeleteKey_Command}"
Style="{StaticResource Page_Button}" Background="#FFE5AEAE"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
</UniformGrid>
</Grid>
+43 -7
View File
@@ -41,7 +41,7 @@ Public Class SearchKeyPageVM
End Get
End Property
Private m_StateList As New List(Of String)({"Consegnata", "InDeposito", "InDepositoEgt", "Guasta", "---ANY---"})
Private m_StateList As New List(Of String)({"Consegnata", "InDeposito", "InDepositoEgt", "Guasta", "Interna", "InternaEgt", "---ANY---"})
Public Overloads ReadOnly Property StateList As List(Of String)
Get
Return m_StateList
@@ -57,16 +57,20 @@ Public Class SearchKeyPageVM
Return m_SelState.ToString()
End Get
Set(value As String)
If String.IsNullOrWhiteSpace( value) Then
If String.IsNullOrWhiteSpace(value) Then
' m_SelState = Nothing
ElseIf value.Equals("Consegnata") Then
m_SelState = Key.KeyState.Consegnata
Else If value.Equals("InDeposito") Then
ElseIf value.Equals("InDeposito") Then
m_SelState = Key.KeyState.InDeposito
Else If value.Equals("InDepositoEgt") Then
ElseIf value.Equals("InDepositoEgt") Then
m_SelState = Key.KeyState.InDepositoEgt
Else If value.Equals("Guasta") Then
ElseIf value.Equals("Guasta") Then
m_SelState = Key.KeyState.Guasta
ElseIf value.Equals("Interna") Then
m_SelState = Key.KeyState.Interna
ElseIf value.Equals("InternaEgt") Then
m_SelState = Key.KeyState.InternaEgt
ElseIf value.Equals("---ANY---") Then
m_SelState = Key.KeyState.ANY
End If
@@ -75,6 +79,7 @@ Public Class SearchKeyPageVM
End Property
' Definizione comandi
Private m_cmdNewKey As Command
Private m_cmdSearch As Command
Private m_cmdCancel As Command
Private m_cmdUpdate As Command
@@ -88,6 +93,12 @@ Public Class SearchKeyPageVM
End Get
End Property
Public ReadOnly Property NewMsg As String
Get
Return "New"
End Get
End Property
Public ReadOnly Property SearchMsg As String
Get
Return "Search"
@@ -96,7 +107,7 @@ Public Class SearchKeyPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
@@ -137,7 +148,11 @@ Public Class SearchKeyPageVM
' Nascondo la GeneratedLockID
GeneratedLockID_Visibility = Visibility.Collapsed
m_SearchResult = New ObservableCollection(Of SearchKey)()
' m_SearchResult = New ObservableCollection(Of SearchKey)()
Dim Query As String = "SELECT * FROM " & DB_KEY & " LEFT JOIN " & DB_CLIENT &
" ON " & DB_KEY & "." & DB_CLIENTID & " = " & DB_CLIENT & "." & DB_CLIENTID & " " &
" ORDER BY " & DB_NUMBER
m_SearchResult = New ObservableCollection(Of SearchKey)(ManageDb.ExecuteSearchKeyQuery(Query))
NotifyPropertyChanged("SearchResult")
m_SelState = Key.KeyState.ANY
NotifyPropertyChanged("SelState")
@@ -224,6 +239,27 @@ Public Class SearchKeyPageVM
#End Region ' Search
#Region "NewKey"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property NewKey_Command As ICommand
Get
If m_cmdNewKey Is Nothing Then
m_cmdNewKey = New Command(AddressOf NewKey)
End If
Return m_cmdNewKey
End Get
End Property
Public Sub NewKey(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWKEY
End Sub
#End Region ' NewKey
#Region "Cancel"
' Returns a command that manage the MainWindow_Unloaded command
+7 -13
View File
@@ -207,27 +207,18 @@
</DataGrid.Columns>
</DataGrid>
<UniformGrid Grid.Row="7" Grid.ColumnSpan="5" Columns="6">
<UniformGrid Grid.Row="7" Grid.ColumnSpan="5" Columns="7">
<Button Content="{Binding NewMsg}"
Command="{Binding NewLicence_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding SearchMsg}"
Command="{Binding Search_Command}"
Grid.Column="0"
Grid.Row="7"
Grid.ColumnSpan="2"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Grid.Column="1"
Grid.Row="6"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding UpdateOverwriteMsg}"
Command="{Binding UpdateOverwrite_Command}"
Grid.Column="1"
Grid.Row="5"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding UpdateNewMsg}"
Command="{Binding UpdateNew_Command}"
Grid.Column="1"
Grid.Row="5"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding DeleteMsg}"
Command="{Binding DeleteLicence_Command}"
@@ -235,6 +226,9 @@
<Button Content="{Binding SendEmailMsg}"
Command="{Binding SendEmail_Command}"
Style="{StaticResource Page_Button}" Background="#FFF4FFA2"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
</UniformGrid>
</Grid>
+25 -13
View File
@@ -7,19 +7,31 @@
Private Sub Row_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
' Ensure row was clicked And Not empty space
Dim Row As DataGridRow = CType(ItemsControl.ContainerFromElement(CType(sender, DataGrid), CType(e.OriginalSource, DependencyObject)), DataGridRow)
If Not IsNothing(CType(Row.Item, Licence).LicFile) Then
Dim Mbr As MessageBoxResult = MessageBox.Show(CType(Row.Item, Licence).LicFile &
vbCrLf &
"___________________" &
vbCrLf &
"Download License?", ".lic File Content", MessageBoxButton.YesNo)
If Mbr.Equals(MessageBoxResult.Yes) Then
Dim lines As String() = CType(Row.Item, Licence).LicFile.Split(New String() {Environment.NewLine},
StringSplitOptions.None)
IO.File.WriteAllLines(IO.Path.ChangeExtension(CType(Row.Item, Licence).File, ".lic"), lines, Text.Encoding.UTF8)
MessageBox.Show("Licenza scaricata correttamente")
End If
Map.refSearchLicencePageVM.Row = CType(ItemsControl.ContainerFromElement(CType(sender, DataGrid), CType(e.OriginalSource, DependencyObject)), DataGridRow)
If Not IsNothing(CType(Map.refSearchLicencePageVM.Row.Item, Licence).LicFile) Then
Dim LicenceBox As New LicenceBoxV
LicenceBox.Owner = Application.Current.MainWindow
LicenceBox.ShowDialog()
'Dim LD As LicenceDialog = New LicenceDialog
'LD.Show(CType(Row.Item, Licence).LicFile, CType(Row.Item, Licence).File)
' vbCrLf &
' "___________________" &
' vbCrLf &
' "Download License?")
'Dim Mbr As MessageBoxResult = MessageBox.Show(CType(Row.Item, Licence).LicFile &
' vbCrLf &
' "___________________" &
' vbCrLf &
' "Download License?", ".lic File Content", MessageBoxButton.YesNo)
'If Mbr.Equals(MessageBoxResult.Yes) Then
' Dim lines As String() = CType(Row.Item, Licence).LicFile.Split(New String() {Environment.NewLine},
' StringSplitOptions.None)
' IO.File.WriteAllLines(IO.Path.ChangeExtension(CType(Row.Item, Licence).File, ".lic"), lines, Text.Encoding.UTF8)
' MessageBox.Show("Licenza scaricata correttamente")
'End If
End If
End Sub
End Class
+38 -2
View File
@@ -8,6 +8,8 @@ Public Class SearchLicencePageVM
#Region "FIELDS & PROPERTIES"
Public Row As DataGridRow
Private m_SelSearchResult As Licence
Public Property SelSearchResult As Licence
Get
@@ -161,6 +163,7 @@ Public Class SearchLicencePageVM
End Property
' Definizione comandi
Private m_cmdNewLicence As Command
Private m_cmdSearch As Command
Private m_cmdCancel As Command
Private m_cmdUpdateOverwrite As Command
@@ -236,6 +239,12 @@ Public Class SearchLicencePageVM
End Get
End Property
Public ReadOnly Property NewMsg As String
Get
Return "New"
End Get
End Property
Public ReadOnly Property SearchMsg As String
Get
Return "Search"
@@ -244,7 +253,7 @@ Public Class SearchLicencePageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
@@ -328,7 +337,13 @@ Public Class SearchLicencePageVM
m_Option1.Clear()
m_Option2.Clear()
m_SearchResult = New ObservableCollection(Of SearchLicence)()
' m_SearchResult = New ObservableCollection(Of SearchLicence)()
Dim LicQuery As String = "SELECT * FROM " & DB_LICENCE & " INNER JOIN " & DB_PRODUCT &
" ON " & DB_LICENCE & "." & DB_PRODUCTID & " = " & DB_PRODUCT & "." & DB_PRODUCTID &
" INNER JOIN " & DB_VERSION &
" ON " & DB_LICENCE & "." & DB_PRODUCTID & " = " & DB_VERSION & "." & DB_PRODUCTID &
" AND " & DB_LICENCE & "." & DB_PRODUCTVERSION & " = " & DB_VERSION & "." & DB_VERSIONNUMBER
m_SearchResult = New ObservableCollection(Of SearchLicence)(ManageDb.ExecuteSearchLicenceQuery(LicQuery))
NotifyPropertyChanged("SearchResult")
End Sub
@@ -381,6 +396,27 @@ Public Class SearchLicencePageVM
#Region "COMMANDS"
#Region "NewLicence"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property NewLicence_Command As ICommand
Get
If m_cmdNewLicence Is Nothing Then
m_cmdNewLicence = New Command(AddressOf NewLicence)
End If
Return m_cmdNewLicence
End Get
End Property
Public Sub NewLicence(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWLICENCE
End Sub
#End Region ' NewLicence
#Region "Search"
' Returns a command that manage the MainWindow_Unloaded command
+7 -10
View File
@@ -100,25 +100,22 @@
</DataGrid.Columns>
</DataGrid>
<UniformGrid Grid.Row="5" Grid.ColumnSpan="2" Columns="4">
<UniformGrid Grid.Row="5" Grid.ColumnSpan="2" Columns="5">
<Button Content="{Binding NewMsg}"
Command="{Binding NewProduct_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding SearchMsg}"
Command="{Binding SearchProduct_Command}"
Grid.Column="0"
Grid.Row="5"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Grid.Column="1"
Grid.Row="5"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding UpdateMsg}"
Command="{Binding UpdateProduct_Command}"
Grid.Column="1"
Grid.Row="5"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding DeleteMsg}"
Command="{Binding DeleteProduct_Command}"
Style="{StaticResource Page_Button}" Background="#FFE5AEAE"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
</UniformGrid>
</Grid>
+32 -2
View File
@@ -97,6 +97,7 @@ Public Class SearchProductPageVM
End Property
' Definizione comandi
Private m_cmdNewProduct As Command
Private m_cmdSearch As Command
Private m_cmdCancel As Command
Private m_cmdUpdate As Command
@@ -110,6 +111,12 @@ Public Class SearchProductPageVM
End Get
End Property
Public ReadOnly Property NewMsg As String
Get
Return "New"
End Get
End Property
Public ReadOnly Property ProductNameMsg As String
Get
Return "Name"
@@ -142,7 +149,7 @@ Public Class SearchProductPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
@@ -208,7 +215,9 @@ Public Class SearchProductPageVM
m_ProductOption2List.Sort(Function(x, y) CInt(y).CompareTo(CInt(x)))
NotifyPropertyChanged("ProductOption2List")
m_SearchResult = New ObservableCollection(Of Product)()
' m_SearchResult = New ObservableCollection(Of Product)()
Dim ProdQuery As String = "SELECT * FROM " & DB_PRODUCT & " "
m_SearchResult = New ObservableCollection(Of Product)(ManageDb.ExecuteSearchProductQuery(ProdQuery))
NotifyPropertyChanged("SearchResult")
End Sub
@@ -216,6 +225,27 @@ Public Class SearchProductPageVM
#Region "COMMANDS"
#Region "NewProduct"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property NewProduct_Command As ICommand
Get
If m_cmdNewProduct Is Nothing Then
m_cmdNewProduct = New Command(AddressOf NewProduct)
End If
Return m_cmdNewProduct
End Get
End Property
Public Sub NewProduct(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWPRODUCT
End Sub
#End Region ' NewProduct
#Region "Search"
' Returns a command that manage the MainWindow_Unloaded command
+7 -7
View File
@@ -53,23 +53,23 @@
</DataGrid.Columns>
</DataGrid>
<UniformGrid Grid.Row="3"
Columns="4"
Grid.ColumnSpan="2">
<UniformGrid Grid.Row="3" Columns="5" Grid.ColumnSpan="2">
<Button Content="{Binding NewMsg}"
Command="{Binding NewReseller_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding SearchMsg}"
Command="{Binding SearchReseller_Command}"
IsDefault="True"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding UpdateMsg}"
Command="{Binding UpdateReseller_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding DeleteMsg}"
Command="{Binding DeleteReseller_Command}"
Style="{StaticResource Page_Button}" Background="#FFE5AEAE"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
</UniformGrid>
</Grid>
+32 -2
View File
@@ -37,6 +37,7 @@ Public Class SearchResellerPageVM
End Property
' Definizione comandi
Private m_cmdNewReseller As Command
Private m_cmdSearch As Command
Private m_cmdCancel As Command
Private m_cmdUpdate As Command
@@ -56,6 +57,12 @@ Public Class SearchResellerPageVM
End Get
End Property
Public ReadOnly Property NewMsg As String
Get
Return "New"
End Get
End Property
Public ReadOnly Property SearchMsg As String
Get
Return "Search"
@@ -64,7 +71,7 @@ Public Class SearchResellerPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
@@ -100,7 +107,9 @@ Public Class SearchResellerPageVM
Name = String.Empty
NotifyPropertyChanged("Name")
m_SearchResult = New ObservableCollection(Of SearchReseller)()
' m_SearchResult = New ObservableCollection(Of SearchReseller)()
Dim Query As String = "SELECT * FROM " & DB_RESELLER
m_SearchResult = New ObservableCollection(Of SearchReseller)(ManageDb.ExecuteSearchResellerQuery(Query))
NotifyPropertyChanged("SearchResult")
End Sub
@@ -108,6 +117,27 @@ Public Class SearchResellerPageVM
#Region "COMMANDS"
#Region "NewReseller"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property NewReseller_Command As ICommand
Get
If m_cmdNewReseller Is Nothing Then
m_cmdNewReseller = New Command(AddressOf NewReseller)
End If
Return m_cmdNewReseller
End Get
End Property
Public Sub NewReseller(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWRESELLER
End Sub
#End Region ' NewReseller
#Region "SearchReseller"
' Returns a command that manage the MainWindow_Unloaded command
+7 -4
View File
@@ -44,20 +44,23 @@
</DataGrid.Columns>
</DataGrid>
<UniformGrid Grid.Row="3" Columns="4">
<UniformGrid Grid.Row="3" Columns="5">
<Button Content="{Binding NewMsg}"
Command="{Binding NewVersion_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding SearchMsg}"
Command="{Binding SearchVersion_Command}"
IsDefault="True"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding UpdateMsg}"
Command="{Binding UpdateVersion_Command}"
Style="{StaticResource Page_Button}"/>
<Button Content="{Binding DeleteMsg}"
Command="{Binding DeleteVersion_Command}"
Style="{StaticResource Page_Button}" Background="#FFE5AEAE"/>
<Button Content="{Binding CancelMsg}"
Command="{Binding Cancel_Command}"
Style="{StaticResource Page_Button}"/>
</UniformGrid>
<TextBlock HorizontalAlignment="Right" Grid.Row="1" TextWrapping="Wrap" Text="(Immettere 0 in 'Version number' per visualizzare qualsiasi numero)" VerticalAlignment="Top" Background="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}" Margin="0,11.8,51,0"/>
+34 -2
View File
@@ -44,6 +44,7 @@ Public Class SearchVersionPageVM
End Property
' Definizione comandi
Private m_cmdNewVersion As Command
Private m_cmdSearch As Command
Private m_cmdCancel As Command
Private m_cmdUpdate As Command
@@ -57,6 +58,12 @@ Public Class SearchVersionPageVM
End Get
End Property
Public ReadOnly Property NewMsg As String
Get
Return "New"
End Get
End Property
Public ReadOnly Property SearchMsg As String
Get
Return "Search"
@@ -65,7 +72,7 @@ Public Class SearchVersionPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
@@ -97,8 +104,12 @@ Public Class SearchVersionPageVM
#Region "METHODS"
Friend Sub InitSearchVersionPage()
m_SearchResult = New ObservableCollection(Of SearchVersion)()
' m_SearchResult = New ObservableCollection(Of SearchVersion)()
Dim VersQuery As String = "SELECT * FROM " & DB_VERSION & " INNER JOIN " & DB_PRODUCT &
" ON " & DB_VERSION & "." & DB_PRODUCTID & " = " & DB_PRODUCT & "." & DB_PRODUCTID & " "
m_SearchResult = New ObservableCollection(Of SearchVersion)(ManageDb.ExecuteSearchVersionQuery(VersQuery))
NotifyPropertyChanged("SearchResult")
Dim Query As String = "SELECT * FROM " & DB_PRODUCT
m_ProductList = ManageDb.ExecuteProductQuery(Query)
NotifyPropertyChanged("ProductList")
@@ -108,6 +119,27 @@ Public Class SearchVersionPageVM
#Region "COMMANDS"
#Region "NewVersion"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property NewVersion_Command As ICommand
Get
If m_cmdNewVersion Is Nothing Then
m_cmdNewVersion = New Command(AddressOf NewVersion)
End If
Return m_cmdNewVersion
End Get
End Property
Public Sub NewVersion(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWVERSION
End Sub
#End Region ' NewVersion
#Region "Search"
' Returns a command that manage the MainWindow_Unloaded command
+1 -1
View File
@@ -53,7 +53,7 @@ Public Class UpdateClientPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+3 -1
View File
@@ -121,7 +121,7 @@ Public Class UpdateKeyPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
@@ -160,6 +160,8 @@ Public Class UpdateKeyPageVM
sList.Add(Key.KeyState.InDeposito)
sList.Add(Key.KeyState.InDepositoEgt)
sList.Add(Key.KeyState.Guasta)
sList.Add(Key.KeyState.Interna)
sList.Add(Key.KeyState.InternaEgt)
m_StateList = sList
NotifyPropertyChanged("StateList")
+76 -3
View File
@@ -199,7 +199,7 @@ Public Class UpdateLicencePageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
@@ -331,9 +331,78 @@ Public Class UpdateLicencePageVM
Public Sub Update(ByVal param As Object)
Dim Query As String = String.Empty
If Overwrite Then
Dim LicQuery As String = "SELECT * FROM " & DB_LICENCE & " WHERE " & DB_LICENCEID & " = " & Licence.LicenceID
Dim LockID As String = ManageDb.ExecuteStringQuery(LicQuery, DB_LOCKID)(0)
Dim ProductID As Integer = ManageDb.ExecuteIntegerQuery(LicQuery, DB_PRODUCTID)(0)
Dim FilePath As String = ManageDb.ExecuteStringQuery(LicQuery, DB_FILE)(0)
Dim FileNameOnly As String = Path.GetFileNameWithoutExtension(FilePath)
Dim ProdQuery As String = "SELECT * FROM " & DB_PRODUCT & " WHERE " & DB_PRODUCTID & " = " & ProductID
Dim ProductNumber As Integer = ManageDb.ExecuteIntegerQuery(ProdQuery, DB_PRODUCTNUMBER)(0)
' Calcolo valore decimale opzione1
Dim nDecOption1 As Integer = CalcOptionDec(m_Option1)
Dim nDecOption2 As Integer = CalcOptionDec(m_Option2)
' Data
Dim startDate As New DateTime(1970, 1, 1)
Dim DayProductDeadline As Integer
DayProductDeadline = (ProductDeadline - startDate).Value.Days
Dim DayOptionDeadline As Integer
DayOptionDeadline = (OptionDeadline - startDate).Value.Days
' Nome licenza
Dim sLicName As String = Path.GetFileNameWithoutExtension(FilePath)
' Nome file
' Dim fileName As String = Map.refMainWindowVM.MainWindowM.sKeygenDataDir & "\" & sLicName & ".Kge"
' Scrivo il file
Dim StringFile As New List(Of String)
StringFile.Add(";")
StringFile.Add("[Index]")
StringFile.Add("Last=1")
StringFile.Add("[Licence1]")
StringFile.Add("Data=" & Format(Now, "yyyy/MM/dd HH:mm:ss"))
StringFile.Add("Customer=" & sLicName)
StringFile.Add("LockId=" & LockID)
StringFile.Add("ClearLockId=")
StringFile.Add("Product=" & ProductNumber)
StringFile.Add("Ver=" & SelVersion.VersionNumber)
StringFile.Add("Lev=" & SelProductLevel)
StringFile.Add("ExpDays=" & DayProductDeadline)
StringFile.Add("Opt1=" & nDecOption1)
StringFile.Add("Opt2=" & nDecOption2)
StringFile.Add("OptExpDays=" & DayOptionDeadline)
Try
IO.File.WriteAllLines(FilePath, StringFile, Text.Encoding.UTF8)
Catch ex As Exception
MessageBox.Show("Errore nella scrittura del file dati per licenza", "KeyGenerator Error")
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)
' Attendo il termine del processo
While Not proc.HasExited
proc.Refresh()
System.Threading.Thread.Sleep(50)
End While
' Errore nella generazione della licenza
If proc.ExitCode <> 0 Then
Dim sOut As String = "La Licenza non è stata generata correttamente (" & proc.ExitCode.ToString() & ")"
MessageBox.Show(sOut, "KeyGenerator Error")
Return
End If
Dim textLic As String = File.ReadAllText(Path.ChangeExtension(FilePath.Replace("\", "\\"), ".lic"))
'' Calcolo valore decimale opzione1
'Dim nDecOption1 As Integer = CalcOptionDec(m_Option1)
'Dim nDecOption2 As Integer = CalcOptionDec(m_Option2)
' Cerco nella tabella Licence
Query = "UPDATE " & DB_LICENCE
Dim bFirstWhere As Boolean = True
@@ -378,6 +447,10 @@ Public Class UpdateLicencePageVM
' EvalWhere(bFirstWhere, Query)
' Query &= DB_FILE & " = '" & File & "' "
'End If
If Not String.IsNullOrWhiteSpace(textLic) Then
EvalWhere(bFirstWhere, Query)
Query &= DB_LICFILE & " = '" & textLic & "' "
End If
Query &= "WHERE " & DB_LICENCEID & " = " & Licence.LicenceID
Query = Query.TrimEnd(","c, " "c)
End If
@@ -413,8 +486,8 @@ Public Class UpdateLicencePageVM
End If
Loop
Else
FilePath = FilePath.Replace(".Kge", "") & "_1.Kge"
End If
FilePath = FilePath.Replace(".Kge", "") & "_1.Kge"
End If
Dim ProdQuery As String = "SELECT * FROM " & DB_PRODUCT & " WHERE " & DB_PRODUCTID & " = " & ProductID
Dim ProductNumber As Integer = ManageDb.ExecuteIntegerQuery(ProdQuery, DB_PRODUCTNUMBER)(0)
+1 -1
View File
@@ -96,7 +96,7 @@ Public Class UpdateProductPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+1 -1
View File
@@ -52,7 +52,7 @@ Public Class UpdateResellerPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+1 -1
View File
@@ -70,7 +70,7 @@ Public Class UpdateVersionPageVM
Public ReadOnly Property CancelMsg As String
Get
Return "Cancel"
Return "Close"
End Get
End Property
+60
View File
@@ -0,0 +1,60 @@
<Window x:Class="LicenceBoxV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:LicenseManager"
mc:Ignorable="d"
Title="LicenceBoxV" Height="450" Width="500" WindowStyle="None" ResizeMode="NoResize"
WindowStartupLocation="CenterOwner" ShowInTaskbar="False">
<!-- Definizione dell'AboutBox -->
<Border BorderThickness="2" BorderBrush="LightBlue">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="0.35*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.35*"/>
</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="0" Background="White">
<Image Source="/Resources/LogoLicenceManager.ico" Stretch="Uniform"/>
</Border>
<TextBlock Grid.Column="1" Text="Licence File Content"
HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20">
</TextBlock>
</Grid>
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
<Grid Grid.Column="1" Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="DownloadBtn" Grid.Column="0"
Margin="1,0,0.8,0" Height="36" VerticalAlignment="Top"/>
<Button Name="ExitBtn" Grid.Column="2" Grid.Row="8" IsCancel="True"
Margin="1,0"/>
</Grid>
</Grid>
</Border>
</Window>
+21
View File
@@ -0,0 +1,21 @@
Imports EgtUILib
Public Class LicenceBoxV
Private Sub LicenceBoxV_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
Me.Owner = Application.Current.MainWindow
InfoLbl.Text = CType(Map.refSearchLicencePageVM.Row.Item, Licence).LicFile
DownloadBtn.Content = "Download"
ExitBtn.Content = "Close"
End Sub
Private Sub DownloadBtn_Click(sender As Object, e As RoutedEventArgs) Handles DownloadBtn.Click
Dim lines As String() = InfoLbl.Text.Split(New String() {Environment.NewLine},
StringSplitOptions.None)
IO.File.WriteAllLines(IO.Path.ChangeExtension(CType(Map.refSearchLicencePageVM.Row.Item, Licence).File, ".lic"),
lines, Text.Encoding.UTF8)
MessageBox.Show("Licenza scaricata correttamente")
End Sub
End Class