diff --git a/MainMenu/MainMenuV.xaml b/MainMenu/MainMenuV.xaml
index dffd19e..521b1d7 100644
--- a/MainMenu/MainMenuV.xaml
+++ b/MainMenu/MainMenuV.xaml
@@ -70,41 +70,41 @@
Width="170"
Grid.Column="0"
Grid.Row="5"/>-->
-
-
-
-
-
-
+
+
diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb
index 90b7966..1fed7a7 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 71c72d1..673ad16 100644
--- a/NewClientPage/NewClientPageVM.vb
+++ b/NewClientPage/NewClientPageVM.vb
@@ -134,7 +134,7 @@ Public Class NewClientPageVM
ManageDb.ExecuteQuery(Query)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHCLIENT
Else
MessageBox.Show("Completare tutti i campi presenti")
End If
@@ -156,7 +156,7 @@ Public Class NewClientPageVM
Public Sub Cancel(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHCLIENT
End Sub
#End Region ' Cancel
diff --git a/NewKeyPage/NewKeyPageVM.vb b/NewKeyPage/NewKeyPageVM.vb
index c1fc6d5..b0f0342 100644
--- a/NewKeyPage/NewKeyPageVM.vb
+++ b/NewKeyPage/NewKeyPageVM.vb
@@ -242,7 +242,7 @@ Public Class NewKeyPageVM
ManageDb.ExecuteQuery(Query)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHKEY
Else
MessageBox.Show("Completare i campi necessari")
End If
@@ -271,7 +271,7 @@ Public Class NewKeyPageVM
Public Sub Cancel(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHKEY
End Sub
diff --git a/NewLicencePage/NewLicencePageVM.vb b/NewLicencePage/NewLicencePageVM.vb
index 41de0e4..71f435d 100644
--- a/NewLicencePage/NewLicencePageVM.vb
+++ b/NewLicencePage/NewLicencePageVM.vb
@@ -511,7 +511,7 @@ Public Class NewLicencePageVM
"'" & textLic & "')"
ManageDb.ExecuteQuery(Query)
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHLICENCE
End Sub
@@ -532,7 +532,7 @@ Public Class NewLicencePageVM
Public Sub Cancel(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHLICENCE
End Sub
diff --git a/NewProductPage/NewProductPageVM.vb b/NewProductPage/NewProductPageVM.vb
index 9af9e94..1fdfe4d 100644
--- a/NewProductPage/NewProductPageVM.vb
+++ b/NewProductPage/NewProductPageVM.vb
@@ -172,7 +172,7 @@ Public Class NewProductPageVM
ManageDb.ExecuteQuery(Query)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHPRODUCT
Else
MessageBox.Show("Completare tutti i campi presenti")
End If
@@ -195,7 +195,7 @@ Public Class NewProductPageVM
Public Sub Cancel(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHPRODUCT
End Sub
diff --git a/NewResellerPage/NewResellerPageVM.vb b/NewResellerPage/NewResellerPageVM.vb
index 5b368ee..ca599fd 100644
--- a/NewResellerPage/NewResellerPageVM.vb
+++ b/NewResellerPage/NewResellerPageVM.vb
@@ -100,7 +100,7 @@ Public Class NewResellerPageVM
ManageDb.ExecuteQuery(Query)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHRESELLER
Else
MessageBox.Show("Completare il campo presente")
End If
@@ -123,7 +123,7 @@ Public Class NewResellerPageVM
Public Sub Cancel(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHRESELLER
End Sub
diff --git a/NewVersionPage/NewVersionPageVM.vb b/NewVersionPage/NewVersionPageVM.vb
index 758bfa6..96c4cb8 100644
--- a/NewVersionPage/NewVersionPageVM.vb
+++ b/NewVersionPage/NewVersionPageVM.vb
@@ -65,7 +65,7 @@ Public Class NewVersionPageVM
ManageDb.ExecuteQuery(Query)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHVERSION
End Sub
@@ -86,7 +86,7 @@ Public Class NewVersionPageVM
Public Sub Cancel(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHVERSION
End Sub
diff --git a/SearchClientPage/SearchClientPageV.xaml b/SearchClientPage/SearchClientPageV.xaml
index 0296c53..0168877 100644
--- a/SearchClientPage/SearchClientPageV.xaml
+++ b/SearchClientPage/SearchClientPageV.xaml
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:LicenseManager="clr-namespace:LicenseManager"
- DataContext="{StaticResource SearchClientPageVM}">
+ DataContext="{StaticResource SearchClientPageVM}" Loaded="Grid_Loaded">
@@ -24,7 +24,10 @@
-
diff --git a/SearchClientPage/SearchClientPageV.xaml.vb b/SearchClientPage/SearchClientPageV.xaml.vb
index 2432b1e..64a8330 100644
--- a/SearchClientPage/SearchClientPageV.xaml.vb
+++ b/SearchClientPage/SearchClientPageV.xaml.vb
@@ -1,3 +1,33 @@
Class SearchClientPageV
+ Private Sub Grid_Loaded(sender As Object, e As RoutedEventArgs)
+ Dim visibleRows As Integer = 0
+ Dim i As Integer = 0
+ If (ClientDataGrid.Height - ClientDataGrid.ColumnHeaderHeight) Mod ClientDataGrid.RowHeight <> 0 Then
+ For Each DataGridItem In ClientDataGrid.ItemContainerGenerator.Items ' ContainerFromIndex(i)
+ If IsUserVisible(CType(ClientDataGrid.ItemContainerGenerator.ContainerFromIndex(i), FrameworkElement), ClientDataGrid) Then
+ visibleRows += 1
+ Else
+ Exit For
+ End If
+ i = i + 1
+ Next
+ 'If (ClientDataGrid.Height < ClientDataGrid.ColumnHeaderHeight + ClientDataGrid.RowHeight * (visibleRows - 1)) Then
+ ClientDataGrid.Height = ClientDataGrid.ColumnHeaderHeight + ClientDataGrid.RowHeight * (visibleRows - 1)
+ 'End If
+ End If
+ End Sub
+
+ Private Function IsUserVisible(element As FrameworkElement, container As FrameworkElement) As Boolean
+ If Not IsNothing(element) Then
+ If Not element.IsVisible Then
+ Return False
+ End If
+ Dim bounds As Rect = element.TransformToAncestor(container).TransformBounds(New Rect(0.0, 0.0, element.ActualWidth, element.ActualHeight))
+ Dim Rect = New Rect(0.0, 0.0, container.ActualWidth, container.ActualHeight)
+ Return Rect.Contains(bounds.TopLeft) Or Rect.Contains(bounds.BottomRight)
+ End If
+ Return False
+ End Function
+
End Class
diff --git a/SearchKeyPage/SearchKeyPageV.xaml b/SearchKeyPage/SearchKeyPageV.xaml
index df97c28..2e1599d 100644
--- a/SearchKeyPage/SearchKeyPageV.xaml
+++ b/SearchKeyPage/SearchKeyPageV.xaml
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:LicenseManager="clr-namespace:LicenseManager"
- DataContext="{StaticResource SearchKeyPageVM}">
+ DataContext="{StaticResource SearchKeyPageVM}" Loaded="Grid_Loaded">
@@ -25,7 +25,10 @@
-
diff --git a/SearchKeyPage/SearchKeyPageV.xaml.vb b/SearchKeyPage/SearchKeyPageV.xaml.vb
index 9b8b34d..272b153 100644
--- a/SearchKeyPage/SearchKeyPageV.xaml.vb
+++ b/SearchKeyPage/SearchKeyPageV.xaml.vb
@@ -1,3 +1,33 @@
Public Class SearchKeyPageV
+ Private Sub Grid_Loaded(sender As Object, e As RoutedEventArgs)
+ Dim visibleRows As Integer = 0
+ Dim i As Integer = 0
+ If (KeyDataGrid.Height - KeyDataGrid.ColumnHeaderHeight) Mod KeyDataGrid.RowHeight <> 0 Then
+ For Each DataGridItem In KeyDataGrid.ItemContainerGenerator.Items ' ContainerFromIndex(i)
+ If IsUserVisible(CType(KeyDataGrid.ItemContainerGenerator.ContainerFromIndex(i), FrameworkElement), KeyDataGrid) Then
+ visibleRows += 1
+ Else
+ Exit For
+ End If
+ i = i + 1
+ Next
+ 'If (ClientDataGrid.Height < ClientDataGrid.ColumnHeaderHeight + ClientDataGrid.RowHeight * (visibleRows - 1)) Then
+ KeyDataGrid.Height = KeyDataGrid.ColumnHeaderHeight + KeyDataGrid.RowHeight * (visibleRows - 1)
+ 'End If
+ End If
+ End Sub
+
+ Private Function IsUserVisible(element As FrameworkElement, container As FrameworkElement) As Boolean
+ If Not IsNothing(element) Then
+ If Not element.IsVisible Then
+ Return False
+ End If
+ Dim bounds As Rect = element.TransformToAncestor(container).TransformBounds(New Rect(0.0, 0.0, element.ActualWidth, element.ActualHeight))
+ Dim Rect = New Rect(0.0, 0.0, container.ActualWidth, container.ActualHeight)
+ Return Rect.Contains(bounds.TopLeft) Or Rect.Contains(bounds.BottomRight)
+ End If
+ Return False
+ End Function
+
End Class
diff --git a/SearchLicencePage/SearchLicencePageV.xaml b/SearchLicencePage/SearchLicencePageV.xaml
index c6cff01..b587cb1 100644
--- a/SearchLicencePage/SearchLicencePageV.xaml
+++ b/SearchLicencePage/SearchLicencePageV.xaml
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
- DataContext="{StaticResource SearchLicencePageVM}">
+ DataContext="{StaticResource SearchLicencePageVM}" Loaded="Grid_Loaded">
@@ -167,13 +167,16 @@
-
+ Height="Auto"
+ ColumnHeaderHeight="25"
+ MouseDoubleClick="Row_MouseDoubleClick" >
diff --git a/SearchLicencePage/SearchLicencePageV.xaml.vb b/SearchLicencePage/SearchLicencePageV.xaml.vb
index 8148306..078a669 100644
--- a/SearchLicencePage/SearchLicencePageV.xaml.vb
+++ b/SearchLicencePage/SearchLicencePageV.xaml.vb
@@ -1,37 +1,42 @@
Class SearchLicencePageV
- 'Private Sub ExpandCell_OnSelected(sender As Object, e As DataGridCellEditEndingEventArgs) ' SelectedCellsChangedEventHandler)
- ' 'If (e.Row.EditingElement.ToString() = Column.GetCellContent(New String("sd")) And (DataGrid)e.FindName("myDataGrid")) Then
- ' MessageBox.Show(e.EditingElement.ToString())
- ' 'End If
- 'End Sub
Private Sub Row_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
- ' Ensure row was clicked And Not empty space
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()
+ End If
+ End Sub
- '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")
+ Private Sub Grid_Loaded(sender As Object, e As RoutedEventArgs)
+ Dim visibleRows As Integer = 0
+ Dim i As Integer = 0
+ If (LicenceDataGrid.Height - LicenceDataGrid.ColumnHeaderHeight) Mod LicenceDataGrid.RowHeight <> 0 Then
+ For Each DataGridItem In LicenceDataGrid.ItemContainerGenerator.Items ' ContainerFromIndex(i)
+ If IsUserVisible(CType(LicenceDataGrid.ItemContainerGenerator.ContainerFromIndex(i), FrameworkElement), LicenceDataGrid) Then
+ visibleRows += 1
+ Else
+ Exit For
+ End If
+ i = i + 1
+ Next
+ 'If (LicenceDataGrid.Height < LicenceDataGrid.ColumnHeaderHeight + LicenceDataGrid.RowHeight * (visibleRows - 1)) Then
+ LicenceDataGrid.Height = LicenceDataGrid.ColumnHeaderHeight + LicenceDataGrid.RowHeight * (visibleRows - 1)
'End If
End If
End Sub
+
+ Private Function IsUserVisible(element As FrameworkElement, container As FrameworkElement) As Boolean
+ If Not IsNothing(element) Then
+ If Not element.IsVisible Then
+ Return False
+ End If
+ Dim bounds As Rect = element.TransformToAncestor(container).TransformBounds(New Rect(0.0, 0.0, element.ActualWidth, element.ActualHeight))
+ Dim Rect = New Rect(0.0, 0.0, container.ActualWidth, container.ActualHeight)
+ Return Rect.Contains(bounds.TopLeft) Or Rect.Contains(bounds.BottomRight)
+ End If
+ Return False
+ End Function
+
End Class
diff --git a/SearchProductPage/SearchProductPageV.xaml.vb b/SearchProductPage/SearchProductPageV.xaml.vb
index 2a0ac7b..2576640 100644
--- a/SearchProductPage/SearchProductPageV.xaml.vb
+++ b/SearchProductPage/SearchProductPageV.xaml.vb
@@ -1,3 +1,33 @@
Class SearchProductV
+ 'Private Sub Grid_Loaded(sender As Object, e As RoutedEventArgs)
+ ' Dim visibleRows As Integer = 0
+ ' Dim i As Integer = 0
+ ' If (ProductDataGrid.Height - ProductDataGrid.ColumnHeaderHeight) Mod ProductDataGrid.RowHeight <> 0 Then
+ ' For Each DataGridItem In ProductDataGrid.ItemContainerGenerator.Items ' ContainerFromIndex(i)
+ ' If IsUserVisible(CType(ProductDataGrid.ItemContainerGenerator.ContainerFromIndex(i), FrameworkElement), ProductDataGrid) Then
+ ' visibleRows += 1
+ ' Else
+ ' Exit For
+ ' End If
+ ' i = i + 1
+ ' Next
+ ' 'If (ClientDataGrid.Height < ClientDataGrid.ColumnHeaderHeight + ClientDataGrid.RowHeight * (visibleRows - 1)) Then
+ ' ProductDataGrid.Height = ProductDataGrid.ColumnHeaderHeight + ProductDataGrid.RowHeight * (visibleRows - 1)
+ ' 'End If
+ ' End If
+ 'End Sub
+
+ 'Private Function IsUserVisible(element As FrameworkElement, container As FrameworkElement) As Boolean
+ ' If Not IsNothing(element) Then
+ ' If Not element.IsVisible Then
+ ' Return False
+ ' End If
+ ' Dim bounds As Rect = element.TransformToAncestor(container).TransformBounds(New Rect(0.0, 0.0, element.ActualWidth, element.ActualHeight))
+ ' Dim Rect = New Rect(0.0, 0.0, container.ActualWidth, container.ActualHeight)
+ ' Return Rect.Contains(bounds.TopLeft) Or Rect.Contains(bounds.BottomRight)
+ ' End If
+ ' Return False
+ 'End Function
+
End Class
diff --git a/SearchProductPage/SearchProductPageVM.vb b/SearchProductPage/SearchProductPageVM.vb
index 8f86271..df346cb 100644
--- a/SearchProductPage/SearchProductPageVM.vb
+++ b/SearchProductPage/SearchProductPageVM.vb
@@ -1,6 +1,7 @@
Imports System.Collections.ObjectModel
-Imports System.Windows
+Imports System.Windows.Forms
Imports EgtWPFLib5
+Imports MySql.Data.MySqlClient
Public Class SearchProductPageVM
Inherits VMBase
@@ -363,7 +364,7 @@ Public Class SearchProductPageVM
Public Sub Delete(ByVal param As Object)
If Not IsNothing(m_SelSearchResult) Then
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- If MessageBox.Show("Do you really want to delete this Product?", "Delete", MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
+ If MessageBox.Show("Do you really want to delete this Product?", "Delete", MessageBoxButtons.YesNo) = DialogResult.No Then
MsgBox("Operation cancelled")
Exit Sub
End If
diff --git a/SearchResellerPage/SearchResellerPageV.xaml b/SearchResellerPage/SearchResellerPageV.xaml
index 38074e6..87a0ce1 100644
--- a/SearchResellerPage/SearchResellerPageV.xaml
+++ b/SearchResellerPage/SearchResellerPageV.xaml
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
- DataContext="{StaticResource SearchResellerPageVM}">
+ DataContext="{StaticResource SearchResellerPageVM}" Loaded="Grid_Loaded">
@@ -40,7 +40,10 @@
Grid.Row="0"
Style="{StaticResource ParameterTextBox}"/>
- 0 Then
+ For Each DataGridItem In ResellerDataGrid.ItemContainerGenerator.Items ' ContainerFromIndex(i)
+ If IsUserVisible(CType(ResellerDataGrid.ItemContainerGenerator.ContainerFromIndex(i), FrameworkElement), ResellerDataGrid) Then
+ visibleRows += 1
+ Else
+ Exit For
+ End If
+ i = i + 1
+ Next
+ 'If (ClientDataGrid.Height < ClientDataGrid.ColumnHeaderHeight + ClientDataGrid.RowHeight * (visibleRows - 1)) Then
+ ResellerDataGrid.Height = ResellerDataGrid.ColumnHeaderHeight + ResellerDataGrid.RowHeight * (visibleRows - 1)
+ 'End If
+ End If
+ End Sub
+
+ Private Function IsUserVisible(element As FrameworkElement, container As FrameworkElement) As Boolean
+ If Not IsNothing(element) Then
+ If Not element.IsVisible Then
+ Return False
+ End If
+ Dim bounds As Rect = element.TransformToAncestor(container).TransformBounds(New Rect(0.0, 0.0, element.ActualWidth, element.ActualHeight))
+ Dim Rect = New Rect(0.0, 0.0, container.ActualWidth, container.ActualHeight)
+ Return Rect.Contains(bounds.TopLeft) Or Rect.Contains(bounds.BottomRight)
+ End If
+ Return False
+ End Function
+
End Class
diff --git a/SearchVersionPage/SearchVersionPageV.xaml b/SearchVersionPage/SearchVersionPageV.xaml
index 42a272c..385b4e6 100644
--- a/SearchVersionPage/SearchVersionPageV.xaml
+++ b/SearchVersionPage/SearchVersionPageV.xaml
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:LicenseManager="clr-namespace:LicenseManager"
- DataContext="{StaticResource SearchVersionPageVM}">
+ DataContext="{StaticResource SearchVersionPageVM}" Loaded="Grid_Loaded">
@@ -24,7 +24,10 @@
-
diff --git a/SearchVersionPage/SearchVersionPageV.xaml.vb b/SearchVersionPage/SearchVersionPageV.xaml.vb
index b131912..d098033 100644
--- a/SearchVersionPage/SearchVersionPageV.xaml.vb
+++ b/SearchVersionPage/SearchVersionPageV.xaml.vb
@@ -1,3 +1,33 @@
Class SearchVersionPageV
+ Private Sub Grid_Loaded(sender As Object, e As RoutedEventArgs)
+ Dim visibleRows As Integer = 0
+ Dim i As Integer = 0
+ If (VersionDataGrid.Height - VersionDataGrid.ColumnHeaderHeight) Mod VersionDataGrid.RowHeight <> 0 Then
+ For Each DataGridItem In VersionDataGrid.ItemContainerGenerator.Items ' ContainerFromIndex(i)
+ If IsUserVisible(CType(VersionDataGrid.ItemContainerGenerator.ContainerFromIndex(i), FrameworkElement), VersionDataGrid) Then
+ visibleRows += 1
+ Else
+ Exit For
+ End If
+ i = i + 1
+ Next
+ 'If (ClientDataGrid.Height < ClientDataGrid.ColumnHeaderHeight + ClientDataGrid.RowHeight * (visibleRows - 1)) Then
+ VersionDataGrid.Height = VersionDataGrid.ColumnHeaderHeight + VersionDataGrid.RowHeight * (visibleRows - 1)
+ 'End If
+ End If
+ End Sub
+
+ Private Function IsUserVisible(element As FrameworkElement, container As FrameworkElement) As Boolean
+ If Not IsNothing(element) Then
+ If Not element.IsVisible Then
+ Return False
+ End If
+ Dim bounds As Rect = element.TransformToAncestor(container).TransformBounds(New Rect(0.0, 0.0, element.ActualWidth, element.ActualHeight))
+ Dim Rect = New Rect(0.0, 0.0, container.ActualWidth, container.ActualHeight)
+ Return Rect.Contains(bounds.TopLeft) Or Rect.Contains(bounds.BottomRight)
+ End If
+ Return False
+ End Function
+
End Class
diff --git a/UpdateClientPage/UpdateClientPageVM.vb b/UpdateClientPage/UpdateClientPageVM.vb
index cc2d80d..4dd9b6f 100644
--- a/UpdateClientPage/UpdateClientPageVM.vb
+++ b/UpdateClientPage/UpdateClientPageVM.vb
@@ -154,7 +154,7 @@ Public Class UpdateClientPageVM
ManageDb.ExecuteQuery(Query)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHCLIENT
Else
MessageBox.Show("Completare almeno un campo")
End If
diff --git a/UpdateKeyPage/UpdateKeyPageVM.vb b/UpdateKeyPage/UpdateKeyPageVM.vb
index ed08a47..c116e98 100644
--- a/UpdateKeyPage/UpdateKeyPageVM.vb
+++ b/UpdateKeyPage/UpdateKeyPageVM.vb
@@ -230,7 +230,7 @@ Public Class UpdateKeyPageVM
End If
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHKEY
' Else
' MessageBox.Show("Completare il campo presente")
'End If
diff --git a/UpdateLicencePage/UpdateLicencePageV.xaml b/UpdateLicencePage/UpdateLicencePageV.xaml
index c36b315..94c7e82 100644
--- a/UpdateLicencePage/UpdateLicencePageV.xaml
+++ b/UpdateLicencePage/UpdateLicencePageV.xaml
@@ -34,28 +34,40 @@
+
+
+
+
+
+
+ Grid.Row="3"
+ Style="{StaticResource ParameterTextBox}" IsReadOnly="True" TextAlignment="Left" Width="Auto" />
+ Grid.Row="4" Grid.ColumnSpan="4">
@@ -130,7 +142,7 @@
+ Grid.Row="5" Grid.ColumnSpan="4">
@@ -152,14 +164,14 @@
diff --git a/UpdateLicencePage/UpdateLicencePageVM.vb b/UpdateLicencePage/UpdateLicencePageVM.vb
index dec6f0a..c652824 100644
--- a/UpdateLicencePage/UpdateLicencePageVM.vb
+++ b/UpdateLicencePage/UpdateLicencePageVM.vb
@@ -143,6 +143,12 @@ Public Class UpdateLicencePageVM
End Get
End Property
+ Public ReadOnly Property ProductNameMsg As String
+ Get
+ Return "Product name"
+ End Get
+ End Property
+
Public ReadOnly Property ProductVersionMsg As String
Get
Return "Product version"
@@ -235,6 +241,10 @@ Public Class UpdateLicencePageVM
FileName = Licence.File ' String.Empty
NotifyPropertyChanged("File")
+ Dim ProdQuery As String = "SELECT * FROM " & DB_PRODUCT & " WHERE " & DB_PRODUCTID & " = " & Licence.ProductID
+ ProductName = ManageDb.ExecuteProductQuery(ProdQuery)(0).ProductName
+ NotifyPropertyChanged("ProductName")
+
'' Carico elemento della lista Version selezionato precedentemente
'Dim selQuery As String = "SELECT " & DB_RESELLERID & " FROM " & DB_CLIENT &
'" INNER JOIN " & DB_RESELLER & " ON " & DB_CLIENT & "." & DB_CLIENTID & " = " &
@@ -601,7 +611,7 @@ Public Class UpdateLicencePageVM
Public Sub Cancel(ByVal param As Object)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHLICENCE
End Sub
diff --git a/UpdateProductPage/UpdateProductPageVM.vb b/UpdateProductPage/UpdateProductPageVM.vb
index 427c04d..790f5e1 100644
--- a/UpdateProductPage/UpdateProductPageVM.vb
+++ b/UpdateProductPage/UpdateProductPageVM.vb
@@ -234,7 +234,7 @@ Public Class UpdateProductPageVM
ManageDb.ExecuteQuery(Query)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHPRODUCT
Else
MessageBox.Show("Completare almeno un campo presente")
End If
diff --git a/UpdateResellerPage/UpdateResellerPageVM.vb b/UpdateResellerPage/UpdateResellerPageVM.vb
index a281ba2..06b329d 100644
--- a/UpdateResellerPage/UpdateResellerPageVM.vb
+++ b/UpdateResellerPage/UpdateResellerPageVM.vb
@@ -111,7 +111,7 @@ Public Class UpdateResellerPageVM
ManageDb.ExecuteQuery(Query)
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHRESELLER
Else
MessageBox.Show("Completare il campo presente")
End If
diff --git a/UpdateVersionPage/UpdateVersionPageVM.vb b/UpdateVersionPage/UpdateVersionPageVM.vb
index 3c8cd54..6aa36ff 100644
--- a/UpdateVersionPage/UpdateVersionPageVM.vb
+++ b/UpdateVersionPage/UpdateVersionPageVM.vb
@@ -147,9 +147,9 @@ Public Class UpdateVersionPageVM
End If
ManageDb.ExecuteQuery(Query)
- ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
- Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
- Else
+ ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
+ Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHVERSION
+ Else
MessageBox.Show("Compleatare il campo presente")
End If
End Sub