LicenceManager 2.1c6:
- In UpdateLicencePage viene mostrato il nome del Prodotto della Licenza che si sta aggiornando - Ogni pulsante "Close" fa ritornare alla pagina precedente (Correzione simile per i vari pulsanti Update e New, mentre Delete rimane nella stessa pagina) - Correzione pulsanti del Main Menu (non hanno più la scritta "Cerca...") - I DataGrid non tagliano più l'ultima riga visibile ma si aggiustano in base al numero intero di righe visibili (implementato per tutte le pagine Search tranne che per Product per via di errori che non riesco a risolvere
This commit is contained in:
+14
-14
@@ -70,41 +70,41 @@
|
||||
Width="170"
|
||||
Grid.Column="0"
|
||||
Grid.Row="5"/>-->
|
||||
<Button Content="Cerca cliente"
|
||||
Command="{Binding SearchClient_Command}"
|
||||
<Button Content="Licenze"
|
||||
Command="{Binding SearchLicence_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"/>
|
||||
<Button Content="Cerca chiave"
|
||||
<Button Content="Chiavi"
|
||||
Command="{Binding SearchKey_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"/>
|
||||
<Button Content="Cerca licenza"
|
||||
Command="{Binding SearchLicence_Command}"
|
||||
<Button Content="Prodotti"
|
||||
Command="{Binding SearchProduct_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"/>
|
||||
<Button Content="Cerca prodotto"
|
||||
Command="{Binding SearchProduct_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"/>
|
||||
<Button Content="Cerca versione"
|
||||
<Button Content="Versioni"
|
||||
Command="{Binding SearchVersion_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="1"
|
||||
Grid.Row="4"/>
|
||||
<Button Content="Cerca rivenditore"
|
||||
Grid.Row="3"/>
|
||||
<Button Content="Rivenditori"
|
||||
Command="{Binding SearchReseller_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="1"
|
||||
Grid.Row="4"/>
|
||||
<Button Content="Clienti"
|
||||
Command="{Binding SearchClient_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="1"
|
||||
Grid.Row="5"/>
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -59,5 +59,5 @@ Imports System.Windows
|
||||
' usando l'asterisco '*' come illustrato di seguito:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.1.3.5")>
|
||||
<Assembly: AssemblyFileVersion("2.1.3.5")>
|
||||
<Assembly: AssemblyVersion("2.1.3.6")>
|
||||
<Assembly: AssemblyFileVersion("2.1.3.6")>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -24,7 +24,10 @@
|
||||
<LicenseManager:ClientPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
<DataGrid Name="ClientDataGrid"
|
||||
ColumnHeaderHeight="25"
|
||||
RowHeight="20"
|
||||
ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="2">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -25,7 +25,10 @@
|
||||
<LicenseManager:KeyPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
<DataGrid Name="KeyDataGrid"
|
||||
ColumnHeaderHeight="25"
|
||||
RowHeight="20"
|
||||
ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="2">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -167,13 +167,16 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
<DataGrid Name="LicenceDataGrid"
|
||||
ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="6"
|
||||
Grid.ColumnSpan="4"
|
||||
RowHeight="20"
|
||||
MouseDoubleClick="Row_MouseDoubleClick">
|
||||
Height="Auto"
|
||||
ColumnHeaderHeight="25"
|
||||
MouseDoubleClick="Row_MouseDoubleClick" >
|
||||
|
||||
<DataGrid.Columns>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -40,7 +40,10 @@
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
<DataGrid Name="ResellerDataGrid"
|
||||
ColumnHeaderHeight="25"
|
||||
RowHeight="20"
|
||||
ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="1"
|
||||
|
||||
@@ -1,3 +1,33 @@
|
||||
Class SearchResellerPageV
|
||||
|
||||
Private Sub Grid_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
Dim visibleRows As Integer = 0
|
||||
Dim i As Integer = 0
|
||||
If (ResellerDataGrid.Height - ResellerDataGrid.ColumnHeaderHeight) Mod ResellerDataGrid.RowHeight <> 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
|
||||
|
||||
@@ -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">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -24,7 +24,10 @@
|
||||
<LicenseManager:VersionPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
<DataGrid Name="VersionDataGrid"
|
||||
ColumnHeaderHeight="25"
|
||||
RowHeight="20"
|
||||
ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="2">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -34,28 +34,40 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding ProductNameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding ProductName}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParameterTextBox}" IsReadOnly="True" TextAlignment="Left" Width="Auto" />
|
||||
|
||||
<TextBlock Text="{Binding ProductVersionMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding VersionList}"
|
||||
SelectedItem="{Binding SelVersion}"
|
||||
DisplayMemberPath="VersionNumber"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductLevelMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding ProductLevelList}"
|
||||
SelectedItem="{Binding SelProductLevel}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductDeadlineMsg}"
|
||||
@@ -90,13 +102,13 @@
|
||||
|
||||
<TextBlock Text="{Binding FileNameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding FileName}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParameterTextBox}" IsReadOnly="True"/>
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParameterTextBox}" IsReadOnly="True" TextAlignment="Left" Width="Auto" />
|
||||
|
||||
<TextBlock Text="{Binding LicenseDateMsg}"
|
||||
Grid.Column="2"
|
||||
@@ -110,7 +122,7 @@
|
||||
Grid.Row="2"/>
|
||||
|
||||
<GroupBox Header="{Binding Option1Msg}"
|
||||
Grid.Row="3" Grid.ColumnSpan="4">
|
||||
Grid.Row="4" Grid.ColumnSpan="4">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Option1}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
@@ -130,7 +142,7 @@
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding Option2Msg}"
|
||||
Grid.Row="4" Grid.ColumnSpan="4">
|
||||
Grid.Row="5" Grid.ColumnSpan="4">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Option2}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
@@ -152,14 +164,14 @@
|
||||
<Button Content="{Binding UpdateMsg}"
|
||||
Command="{Binding Update_Command}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="5"
|
||||
Grid.Row="6"
|
||||
Grid.ColumnSpan="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="5"
|
||||
Grid.Row="6"
|
||||
Grid.ColumnSpan="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user