diff --git a/KeyPage/KeyPageVM.vb b/KeyPage/KeyPageVM.vb
index 85287f3..6f6337e 100644
--- a/KeyPage/KeyPageVM.vb
+++ b/KeyPage/KeyPageVM.vb
@@ -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
diff --git a/LicenseManager.vbproj b/LicenseManager.vbproj
index 5f88f38..c627f7c 100644
--- a/LicenseManager.vbproj
+++ b/LicenseManager.vbproj
@@ -199,6 +199,9 @@
Dictionary.xaml
+
+ LicenceBoxV.xaml
+
@@ -365,6 +368,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
diff --git a/MainMenu/MainMenuV.xaml b/MainMenu/MainMenuV.xaml
index ad16814..dffd19e 100644
--- a/MainMenu/MainMenuV.xaml
+++ b/MainMenu/MainMenuV.xaml
@@ -4,36 +4,37 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
DataContext="{StaticResource MainMenuVM}">
-
-
-
-
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ Grid.Row="5"/>-->
-
-
-
-
diff --git a/MainWindow/Objects.vb b/MainWindow/Objects.vb
index 40b49c8..40a79cf 100644
--- a/MainWindow/Objects.vb
+++ b/MainWindow/Objects.vb
@@ -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
diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb
index e4aea3e..90b7966 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 7b64a9b..71c72d1 100644
--- a/NewClientPage/NewClientPageVM.vb
+++ b/NewClientPage/NewClientPageVM.vb
@@ -73,7 +73,7 @@ Public Class NewClientPageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/NewKeyPage/NewKeyPageVM.vb b/NewKeyPage/NewKeyPageVM.vb
index 4172a9b..c1fc6d5 100644
--- a/NewKeyPage/NewKeyPageVM.vb
+++ b/NewKeyPage/NewKeyPageVM.vb
@@ -114,7 +114,7 @@ Public Class NewKeyPageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/NewLicencePage/NewLicencePageVM.vb b/NewLicencePage/NewLicencePageVM.vb
index 511b99d..41de0e4 100644
--- a/NewLicencePage/NewLicencePageVM.vb
+++ b/NewLicencePage/NewLicencePageVM.vb
@@ -295,7 +295,7 @@ Public Class NewLicencePageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/NewProductPage/NewProductPageVM.vb b/NewProductPage/NewProductPageVM.vb
index 7e3af59..9af9e94 100644
--- a/NewProductPage/NewProductPageVM.vb
+++ b/NewProductPage/NewProductPageVM.vb
@@ -110,7 +110,7 @@ Public Class NewProductPageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/NewResellerPage/NewResellerPageVM.vb b/NewResellerPage/NewResellerPageVM.vb
index c19698f..5b368ee 100644
--- a/NewResellerPage/NewResellerPageVM.vb
+++ b/NewResellerPage/NewResellerPageVM.vb
@@ -51,7 +51,7 @@ Public Class NewResellerPageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/NewVersionPage/NewVersionPageVM.vb b/NewVersionPage/NewVersionPageVM.vb
index 8308176..758bfa6 100644
--- a/NewVersionPage/NewVersionPageVM.vb
+++ b/NewVersionPage/NewVersionPageVM.vb
@@ -25,7 +25,7 @@ Public Class NewVersionPageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/SearchClientPage/SearchClientPageV.xaml b/SearchClientPage/SearchClientPageV.xaml
index c910003..0296c53 100644
--- a/SearchClientPage/SearchClientPageV.xaml
+++ b/SearchClientPage/SearchClientPageV.xaml
@@ -45,20 +45,23 @@
-
+
+
-
+
diff --git a/SearchClientPage/SearchClientPageVM.vb b/SearchClientPage/SearchClientPageVM.vb
index f7ed11e..2f8edd6 100644
--- a/SearchClientPage/SearchClientPageVM.vb
+++ b/SearchClientPage/SearchClientPageVM.vb
@@ -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
diff --git a/SearchKeyPage/SearchKeyPageV.xaml b/SearchKeyPage/SearchKeyPageV.xaml
index 2db6962..df97c28 100644
--- a/SearchKeyPage/SearchKeyPageV.xaml
+++ b/SearchKeyPage/SearchKeyPageV.xaml
@@ -54,20 +54,23 @@
-
+
+
-
+
\ No newline at end of file
diff --git a/SearchKeyPage/SearchKeyPageVM.vb b/SearchKeyPage/SearchKeyPageVM.vb
index 4e08f94..781c78d 100644
--- a/SearchKeyPage/SearchKeyPageVM.vb
+++ b/SearchKeyPage/SearchKeyPageVM.vb
@@ -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
diff --git a/SearchLicencePage/SearchLicencePageV.xaml b/SearchLicencePage/SearchLicencePageV.xaml
index f8e0afb..c6cff01 100644
--- a/SearchLicencePage/SearchLicencePageV.xaml
+++ b/SearchLicencePage/SearchLicencePageV.xaml
@@ -207,27 +207,18 @@
-
+
+
-
+
diff --git a/SearchLicencePage/SearchLicencePageV.xaml.vb b/SearchLicencePage/SearchLicencePageV.xaml.vb
index bf348dc..8148306 100644
--- a/SearchLicencePage/SearchLicencePageV.xaml.vb
+++ b/SearchLicencePage/SearchLicencePageV.xaml.vb
@@ -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
diff --git a/SearchLicencePage/SearchLicencePageVM.vb b/SearchLicencePage/SearchLicencePageVM.vb
index 3a37f3f..98f0746 100644
--- a/SearchLicencePage/SearchLicencePageVM.vb
+++ b/SearchLicencePage/SearchLicencePageVM.vb
@@ -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
diff --git a/SearchProductPage/SearchProductPageV.xaml b/SearchProductPage/SearchProductPageV.xaml
index 4956d62..05bf5c9 100644
--- a/SearchProductPage/SearchProductPageV.xaml
+++ b/SearchProductPage/SearchProductPageV.xaml
@@ -100,25 +100,22 @@
-
+
+
-
+
diff --git a/SearchProductPage/SearchProductPageVM.vb b/SearchProductPage/SearchProductPageVM.vb
index 82e7e9c..8f86271 100644
--- a/SearchProductPage/SearchProductPageVM.vb
+++ b/SearchProductPage/SearchProductPageVM.vb
@@ -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
diff --git a/SearchResellerPage/SearchResellerPageV.xaml b/SearchResellerPage/SearchResellerPageV.xaml
index e36e53d..38074e6 100644
--- a/SearchResellerPage/SearchResellerPageV.xaml
+++ b/SearchResellerPage/SearchResellerPageV.xaml
@@ -53,23 +53,23 @@
-
-
+
+
-
+
diff --git a/SearchResellerPage/SearchResellerPageVM.vb b/SearchResellerPage/SearchResellerPageVM.vb
index 24a9059..bbbd034 100644
--- a/SearchResellerPage/SearchResellerPageVM.vb
+++ b/SearchResellerPage/SearchResellerPageVM.vb
@@ -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
diff --git a/SearchVersionPage/SearchVersionPageV.xaml b/SearchVersionPage/SearchVersionPageV.xaml
index d8151a7..42a272c 100644
--- a/SearchVersionPage/SearchVersionPageV.xaml
+++ b/SearchVersionPage/SearchVersionPageV.xaml
@@ -44,20 +44,23 @@
-
+
+
-
+
diff --git a/SearchVersionPage/SearchVersionPageVM.vb b/SearchVersionPage/SearchVersionPageVM.vb
index 0257a74..a1bd92e 100644
--- a/SearchVersionPage/SearchVersionPageVM.vb
+++ b/SearchVersionPage/SearchVersionPageVM.vb
@@ -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
diff --git a/UpdateClientPage/UpdateClientPageVM.vb b/UpdateClientPage/UpdateClientPageVM.vb
index 3aeb6e4..cc2d80d 100644
--- a/UpdateClientPage/UpdateClientPageVM.vb
+++ b/UpdateClientPage/UpdateClientPageVM.vb
@@ -53,7 +53,7 @@ Public Class UpdateClientPageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/UpdateKeyPage/UpdateKeyPageVM.vb b/UpdateKeyPage/UpdateKeyPageVM.vb
index 81f1ad2..ed08a47 100644
--- a/UpdateKeyPage/UpdateKeyPageVM.vb
+++ b/UpdateKeyPage/UpdateKeyPageVM.vb
@@ -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")
diff --git a/UpdateLicencePage/UpdateLicencePageVM.vb b/UpdateLicencePage/UpdateLicencePageVM.vb
index 881b42e..dec6f0a 100644
--- a/UpdateLicencePage/UpdateLicencePageVM.vb
+++ b/UpdateLicencePage/UpdateLicencePageVM.vb
@@ -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)
diff --git a/UpdateProductPage/UpdateProductPageVM.vb b/UpdateProductPage/UpdateProductPageVM.vb
index fe32486..427c04d 100644
--- a/UpdateProductPage/UpdateProductPageVM.vb
+++ b/UpdateProductPage/UpdateProductPageVM.vb
@@ -96,7 +96,7 @@ Public Class UpdateProductPageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/UpdateResellerPage/UpdateResellerPageVM.vb b/UpdateResellerPage/UpdateResellerPageVM.vb
index 303d8a9..a281ba2 100644
--- a/UpdateResellerPage/UpdateResellerPageVM.vb
+++ b/UpdateResellerPage/UpdateResellerPageVM.vb
@@ -52,7 +52,7 @@ Public Class UpdateResellerPageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/UpdateVersionPage/UpdateVersionPageVM.vb b/UpdateVersionPage/UpdateVersionPageVM.vb
index d0cfbf2..3c8cd54 100644
--- a/UpdateVersionPage/UpdateVersionPageVM.vb
+++ b/UpdateVersionPage/UpdateVersionPageVM.vb
@@ -70,7 +70,7 @@ Public Class UpdateVersionPageVM
Public ReadOnly Property CancelMsg As String
Get
- Return "Cancel"
+ Return "Close"
End Get
End Property
diff --git a/Utility/LicenceBoxV.xaml b/Utility/LicenceBoxV.xaml
new file mode 100644
index 0000000..3bac15e
--- /dev/null
+++ b/Utility/LicenceBoxV.xaml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Utility/LicenceBoxV.xaml.vb b/Utility/LicenceBoxV.xaml.vb
new file mode 100644
index 0000000..bd67ca5
--- /dev/null
+++ b/Utility/LicenceBoxV.xaml.vb
@@ -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
+