LicenceManager 2.1b1 :
- Primo commit.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,9 @@
|
||||
<Application x:Class="Application"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary Source="Utility/Dictionary.xaml"/>
|
||||
</Application.Resources>
|
||||
|
||||
</Application>
|
||||
@@ -0,0 +1,14 @@
|
||||
Class Application
|
||||
|
||||
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
|
||||
' can be handled in this file.
|
||||
Protected Overrides Sub OnStartup(e As StartupEventArgs)
|
||||
MyBase.OnStartup(e)
|
||||
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
||||
' Creo la View principale
|
||||
Me.MainWindow = New MainWindowV
|
||||
' Mostro la View principale
|
||||
Me.MainWindow.Show()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,50 @@
|
||||
<Grid x:Class="ClientPageV"
|
||||
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">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding NameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Name}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ResellerNameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox Name="ResellerComboBox"
|
||||
ItemsSource="{Binding ResellerList}"
|
||||
SelectedItem="{Binding SelReseller}"
|
||||
DisplayMemberPath="ResellerName"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}" Text="E-mail address"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Email}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,5 @@
|
||||
Public Class ClientPageV
|
||||
Private Sub ResellerComboBox_Loaded(sender As Object, e As RoutedEventArgs) Handles ResellerComboBox.Loaded
|
||||
ResellerComboBox.SelectedIndex = -1
|
||||
End Sub
|
||||
End Class
|
||||
@@ -0,0 +1,90 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ClientPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
NotifyPropertyChanged("Name")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ResellerList As List(Of Reseller)
|
||||
Public ReadOnly Property ResellerList As List(Of Reseller)
|
||||
Get
|
||||
Return m_ResellerList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelReseller As Reseller
|
||||
Public Property SelReseller As Reseller
|
||||
Get
|
||||
Return m_SelReseller
|
||||
End Get
|
||||
Set(value As Reseller)
|
||||
m_SelReseller = value
|
||||
NotifyPropertyChanged("SelReseller")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Email As String
|
||||
Public Property Email As String
|
||||
Get
|
||||
Return m_Email
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Email = value
|
||||
NotifyPropertyChanged("Email")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NameMsg As String
|
||||
Get
|
||||
Return "Name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ResellerNameMsg As String
|
||||
Get
|
||||
Return "Reseller name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EmailMsg As String
|
||||
Get
|
||||
Return "E-mail address"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitClientPage()
|
||||
' Svuoto campi
|
||||
m_Name = String.Empty
|
||||
NotifyPropertyChanged("Name")
|
||||
|
||||
m_Email = String.Empty
|
||||
NotifyPropertyChanged("Email")
|
||||
|
||||
' Carico lista Reseller
|
||||
Dim Query As String = "SELECT * FROM " & DB_RESELLER
|
||||
m_ResellerList = ManageDb.ExecuteResellerQuery(Query)
|
||||
NotifyPropertyChanged("ResellerList")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,37 @@
|
||||
Module ConstDb
|
||||
|
||||
' Public Const DB_FILENAME As String = "LicenceManagerDb.sqlite"
|
||||
Public Const DB_CONNECTIONSTRING As String = "Server=192.168.1.50;Port=3307;Database=licencemanagerdb;Uid=root;Pwd=Dossena"
|
||||
Public Const DB_CLIENT As String = "ClientTable"
|
||||
Public Const DB_NAME As String = "Name"
|
||||
Public Const DB_RESELLERID As String = "ResellerID"
|
||||
Public Const DB_EMAIL As String = "Email"
|
||||
Public Const DB_CLIENTID As String = "ClientID"
|
||||
Public Const DB_KEY As String = "KeyTable"
|
||||
Public Const DB_NUMBER As String = "Number"
|
||||
Public Const DB_MAXNUMBER As String = "MaxNumber"
|
||||
Public Const DB_ISDONGLE As String = "IsDongle"
|
||||
Public Const DB_LOCKID As String = "LockID"
|
||||
Public Const DB_STATE As String = "State"
|
||||
Public Const DB_LICENCE As String = "LicenceTable"
|
||||
Public Const DB_PRODUCTID As String = "ProductID"
|
||||
Public Const DB_PRODUCTVERSION As String = "ProductVersion"
|
||||
Public Const DB_PRODUCTLEVEL As String = "ProductLevel"
|
||||
Public Const DB_PRODUCTDEADLINE As String = "ProductDeadline"
|
||||
Public Const DB_OPTION1 As String = "Option1"
|
||||
Public Const DB_OPTION2 As String = "Option2"
|
||||
Public Const DB_OPTIONDEADLINE As String = "OptionDeadline"
|
||||
Public Const DB_FILE As String = "File"
|
||||
Public Const DB_LICENCEID As String = "LicenceID"
|
||||
Public Const DB_PRODUCT As String = "ProductTable"
|
||||
Public Const DB_PRODUCTNAME As String = "ProductName"
|
||||
Public Const DB_PRODUCTNUMBER As String = "ProductNumber"
|
||||
Public Const DB_PRODUCTOPTION1 As String = "ProductOption1"
|
||||
Public Const DB_PRODUCTOPTION2 As String = "ProductOption2"
|
||||
Public Const DB_VERSION As String = "VersionTable"
|
||||
Public Const DB_VERSIONID As String = "VersionID"
|
||||
Public Const DB_VERSIONNUMBER As String = "VersionNumber"
|
||||
Public Const DB_RESELLER As String = "ResellerTable"
|
||||
Public Const DB_RESELLERNAME As String = "ResellerName"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
Module ConstDoors
|
||||
|
||||
' File contenente la lista dei nomi di geometria ammessi
|
||||
Public Const GEONAMELIST_FILE As String = "GeometryNameList.ini"
|
||||
Public Const S_GEOMETRYNAMES As String = "GeometryNames"
|
||||
|
||||
' File contenente la lista delle operazioni ammesse
|
||||
Public Const OPERATIONLIST_FILE As String = "OperationList.ini"
|
||||
Public Const S_OPERATIONS As String = "Operations"
|
||||
Public Const S_PROPERTIES As String = "Properties"
|
||||
|
||||
' File template per scrittura MTable
|
||||
Public Const MTABLETEMPLATE_FILE As String = "MTableTemplate.ini"
|
||||
|
||||
' File template per scrittura MTable
|
||||
Public Const CURRMTABLE_FILE As String = "CurrMTable.ini"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,66 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2015-2017
|
||||
'----------------------------------------------------------------------------
|
||||
' File : ConstGen.vb Data : 10.04.17 Versione : 1.8d1
|
||||
' Contenuto : Modulo costanti generali.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 10.04.17 DS Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
Module ConstGen
|
||||
|
||||
' File con direttorio radice dei dati
|
||||
Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
|
||||
Public Const S_DATA As String = "Data"
|
||||
Public Const K_DATAROOT As String = "DataRoot"
|
||||
|
||||
' File con dati di licenza
|
||||
Public Const LIC_FILE_NAME As String = "OmagOFFICE.lic"
|
||||
Public Const S_LICENCE As String = "Licence"
|
||||
Public Const K_KEY As String = "Key"
|
||||
|
||||
' Abilitazioni licenza
|
||||
Friend Enum KEY_OPT As UInteger
|
||||
CUT_BASE = 1
|
||||
MAN_MANIP = 2
|
||||
AUTO_MANIP = 4
|
||||
MAN_PHOTO = 8
|
||||
AUTO_PHOTO = 16
|
||||
AUTO_NESTING = 32
|
||||
ENABLE_MILL = 64
|
||||
PROCUCTION_LINE = 128
|
||||
OFFICE_BASE = 256
|
||||
VM_MULTI = 512
|
||||
UNDER_CUT = 1024
|
||||
End Enum
|
||||
|
||||
' File di log generale
|
||||
Public Const GENLOG_FILE_NAME As String = "OmagOFFICELog#.txt"
|
||||
|
||||
' Sottodirettorio di configurazione
|
||||
Public Const CONF_DIR As String = "Config"
|
||||
' Sottodirettorio delle risorse
|
||||
Public Const RES_DIR As String = "Resources"
|
||||
' Sottodirettorio temporaneo
|
||||
Public Const TEMP_DIR As String = "Temp"
|
||||
' Sottodirettorio per Db
|
||||
Public Const DATA_DIR As String = "Data"
|
||||
' Sottodirettorio per Cam automatico
|
||||
Public Const CAMAUTO_DIR As String = "CamAuto"
|
||||
' Sottodirettorio per Csv automatico
|
||||
Public Const CSVAUTO_DIR As String = "CsvAuto"
|
||||
' Sottodirettorio per Img automatico
|
||||
Public Const IMGAUTO_DIR As String = "ImgAuto"
|
||||
' Sottodirettorio di default per il salvataggio con nome
|
||||
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
|
||||
' Sottodirettorio di default per le macchine
|
||||
Public Const MACHINES_DFL_DIR As String = "Machines"
|
||||
' Nome file Lua con le funzioni di attrezzaggio
|
||||
Public Const SETUP_LUA As String = "SetUp.lua"
|
||||
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,154 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2015-2015
|
||||
'----------------------------------------------------------------------------
|
||||
' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
|
||||
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 12.02.15 DS Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
Module ConstIni
|
||||
|
||||
Public Const INI_FILE_NAME As String = "OmagOFFICE.ini"
|
||||
|
||||
Public Const S_GENERAL As String = "General"
|
||||
Public Const K_DEBUG As String = "Debug"
|
||||
Public Const K_LICENCE As String = "Licence"
|
||||
Public Const K_USERLEVEL As String = "UserLevel"
|
||||
Public Const K_MAXINST As String = "MaxInstances"
|
||||
Public Const K_INSTANCES As String = "Instances"
|
||||
Public Const K_COMMANDLOG As String = "CommandLog"
|
||||
Public Const K_MESSAGESDIR As String = "MessagesDir"
|
||||
Public Const K_MESSAGES As String = "Messages"
|
||||
Public Const K_WINPLACE As String = "WinPlace"
|
||||
Public Const K_CSVWINPLACE As String = "CsvWinPlace"
|
||||
Public Const K_MMUNITS As String = "MmUnits"
|
||||
Public Const K_LASTPROJ As String = "LastProj"
|
||||
Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
|
||||
Public Const K_IMAGEDIR As String = "ImageDir"
|
||||
Public Const K_EXPORTDIR As String = "ExportDir"
|
||||
Public Const K_CONTOURFROMCAMERA As String = "ContourFromCamera"
|
||||
Public Const K_SUPPORT As String = "Support"
|
||||
|
||||
Public Const S_LANGUAGES As String = "Languages"
|
||||
Public Const K_LANGUAGE As String = "Language"
|
||||
|
||||
Public Const S_LUA As String = "Lua"
|
||||
Public Const K_LIBSDIR As String = "LibsDir"
|
||||
Public Const K_BASELIB As String = "BaseLib"
|
||||
|
||||
Public Const S_GEOMDB As String = "GeomDB"
|
||||
Public Const K_DEFAULTFONT As String = "DefaultFont"
|
||||
Public Const K_NFEFONTDIR As String = "NfeFontDir"
|
||||
Public Const K_DEFAULTCOLOR As String = "DefaultColor"
|
||||
Public Const K_SAVETYPE As String = "SaveType"
|
||||
|
||||
Public Const S_OPENGL As String = "OpenGL"
|
||||
Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
|
||||
Public Const K_COLORBITS As String = "ColorBits"
|
||||
Public Const K_DEPTHBITS As String = "DepthBits"
|
||||
Public Const K_DRIVER As String = "Driver"
|
||||
|
||||
Public Const S_SCENE As String = "Scene"
|
||||
Public Const K_BACKTOP As String = "BackTop"
|
||||
Public Const K_BACKBOTTOM As String = "BackBottom"
|
||||
Public Const K_SHOWGFRAME As String = "ShowGFrame"
|
||||
Public Const K_MARK As String = "Mark"
|
||||
Public Const K_SELSURF As String = "SelSurf"
|
||||
Public Const K_SHOWMODE As String = "ShowMode"
|
||||
Public Const K_CURVEDIR As String = "CurveDir"
|
||||
Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
|
||||
Public Const K_SHOWZMAP As String = "ShowZmap"
|
||||
Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
|
||||
Public Const K_ZOOMWIN As String = "ZoomWin"
|
||||
Public Const K_DISTLINE As String = "DistLine"
|
||||
|
||||
Public Const S_GRID As String = "Grid"
|
||||
Public Const K_SHOWGRID As String = "ShowGrid"
|
||||
Public Const K_SHOWFRAME As String = "ShowFrame"
|
||||
Public Const K_SNAPSTEP As String = "SnapStep"
|
||||
Public Const K_SNAPSTEPINCH As String = "SnapStepInch"
|
||||
Public Const K_MINLINESSTEP As String = "MinLineSStep"
|
||||
Public Const K_MAJLINESSTEP As String = "MajLineSStep"
|
||||
Public Const K_EXTSSTEP As String = "ExtSStep"
|
||||
Public Const K_MINLNCOLOR As String = "MinLnColor"
|
||||
Public Const K_MAJLNCOLOR As String = "MajLnColor"
|
||||
|
||||
Public Const S_COMPO As String = "Compo"
|
||||
Public Const K_COMPODIR As String = "CompoDir"
|
||||
Public Const K_SIDEMODE As String = "SideMode"
|
||||
|
||||
Public Const S_FLATPARTS As String = "FlatParts"
|
||||
Public Const K_FLPCURRDIR As String = "CurrDir"
|
||||
|
||||
Public Const S_SIDES As String = "Sides"
|
||||
Public Const K_SIDEANGLE As String = "SideAngle"
|
||||
Public Const K_DRIPOFFSET As String = "DripOffset"
|
||||
Public Const K_DRIPDEPTH As String = "DripDepth"
|
||||
Public Const K_DRIPSHORT As String = "DripShort"
|
||||
|
||||
Public Const S_NEST As String = "Nest"
|
||||
Public Const K_DIRECT As String = "Direct"
|
||||
Public Const K_STEP As String = "Step"
|
||||
Public Const K_ANGSTEP As String = "AngStep"
|
||||
Public Const K_RESTRADIUS As String = "RestRadius"
|
||||
Public Const K_SNAPDIST As String = "SnapDist"
|
||||
|
||||
Public Const S_CSV As String = "Csv"
|
||||
Public Const K_CSVDIRECT As String = "Direct"
|
||||
Public Const K_MAXDIMONX As String = "MaxDimOnX"
|
||||
Public Const K_READER As String = "Reader"
|
||||
Public Const K_CSVCURRDIR As String = "CurrDir"
|
||||
Public Const K_CSVLASTFILE As String = "LastFile"
|
||||
|
||||
Public Const S_RAWPART As String = "RawPart"
|
||||
Public Const K_RAWCOLOR As String = "RawColor"
|
||||
Public Const K_KERFCOLOR As String = "KerfColor"
|
||||
Public Const K_RAWLENGTH As String = "Length"
|
||||
Public Const K_RAWWIDTH As String = "Width"
|
||||
Public Const K_RAWHEIGHT As String = "Height"
|
||||
Public Const K_RAWOFFSX As String = "OffsX"
|
||||
Public Const K_RAWOFFSY As String = "OffsY"
|
||||
Public Const K_RAWKERF As String = "Kerf"
|
||||
|
||||
Public Const S_RAWMOVE As String = "RawMove"
|
||||
Public Const K_RAWSTEP As String = "Step"
|
||||
Public Const K_RAWROTATION As String = "Rotation"
|
||||
Public Const K_PERPENDICULAR As String = "Perpendicular"
|
||||
|
||||
Public Const S_CAMERA As String = "Camera"
|
||||
Public Const K_CAM_COUNT As String = "Count"
|
||||
Public Const K_CAM_EXEPATH As String = "ExePath"
|
||||
Public Const K_CAM_IMAGE As String = "Image"
|
||||
Public Const K_CAM_INFO As String = "Info"
|
||||
Public Const K_CAM_RESULT As String = "Result"
|
||||
Public Const K_CAM_CONTOUR As String = "Contour"
|
||||
Public Const K_CAM_EXEPATH2 As String = "ExePath2"
|
||||
Public Const K_CAM_IMAGE2 As String = "Image2"
|
||||
Public Const K_CAM_INFO2 As String = "Info2"
|
||||
Public Const K_CAM_RESULT2 As String = "Result2"
|
||||
Public Const K_CAM_CONTOUR2 As String = "Contour2"
|
||||
Public Const K_CAM_THRESHOLD As String = "Threshold"
|
||||
Public Const K_CAM_TOLERANCE As String = "Tolerance"
|
||||
Public Const K_CAM_TIMEOUT As String = "Timeout"
|
||||
|
||||
Public Const S_MACH As String = "Mach"
|
||||
Public Const K_MACHINESDIR As String = "MachinesDir"
|
||||
Public Const K_TOOLMAKERSDIR As String = "ToolMakersDir"
|
||||
Public Const K_CURRMACH As String = "CurrMach"
|
||||
|
||||
Public Const S_SIMUL As String = "Simul"
|
||||
Public Const K_SLIDERX As String = "SliderX"
|
||||
Public Const K_SLIDERVAL As String = "SliderVal"
|
||||
|
||||
Public Const S_VEINMATCHING As String = "VeinMatching"
|
||||
Public Const K_VEINMA_ENABLE As String = "Enable"
|
||||
Public Const K_VEINMA_PLACE As String = "WinPlace"
|
||||
Public Const K_VEINMA_IMGWIDTH As String = "ImgWidth"
|
||||
Public Const K_VEINMA_IMGHEIGHT As String = "ImgHeight"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,57 @@
|
||||
Module ConstMachIni
|
||||
|
||||
Public Const S_TOOLS As String = "Tools"
|
||||
Public Const K_DRILLBIT As String = "Drillbit"
|
||||
Public Const K_SAWBLADE As String = "Sawblade"
|
||||
Public Const K_MILL As String = "Mill"
|
||||
Public Const K_MORTISE As String = "Mortise"
|
||||
Public Const K_CHISEL As String = "Chisel"
|
||||
Public Const K_COMPO As String = "Compo"
|
||||
Public Const K_SHOWTOOLCHANGER As String = "ShowToolChanger"
|
||||
Public Const K_SHOWHEADEXIT As String = "ShowHeadExit"
|
||||
Public Const K_DRILLHOLDER As String = "DrillHolder"
|
||||
Public Const K_SAWBLADEHOLDER As String = "SawBladeHolder"
|
||||
Public Const K_MILLHOLDER As String = "MillHolder"
|
||||
Public Const K_DRILLMAKER As String = "DrillMaker"
|
||||
Public Const K_SAWBLADEMAKER As String = "SawbladeMaker"
|
||||
Public Const K_MILLMAKER As String = "MillMaker"
|
||||
Public Const K_MORTISEMAKER As String = "MortiseMaker"
|
||||
Public Const K_CHISELMAKER As String = "ChiselMaker"
|
||||
Public Const K_MOUNTEDTOOLCONFIG As String = "MountedToolConfig"
|
||||
|
||||
Public Const S_TOOLHOLDER As String = "ToolHolder"
|
||||
|
||||
Public Const S_MACHININGS As String = "Machinings"
|
||||
Public Const K_SAWING As String = "Sawing"
|
||||
Public Const K_DRILLING As String = "Drilling"
|
||||
Public Const K_MILLING As String = "Milling"
|
||||
Public Const K_POCKETING As String = "Pocketing"
|
||||
Public Const K_MORTISING As String = "Mortising"
|
||||
Public Const K_SAWROUGHING As String = "SawRoughing"
|
||||
Public Const K_SAWFINISHING As String = "SawFinishing"
|
||||
Public Const K_GENMACHINING As String = "GenMachining"
|
||||
Public Const K_CHISELING As String = "Chiseling"
|
||||
Public Const K_SAWINGONARCS As String = "SawingOnArcs"
|
||||
|
||||
Public Const S_GENMACHINING As String = "GenMachining"
|
||||
Public Const K_GENSCRIPT As String = "GenScript"
|
||||
|
||||
Public Const S_TOOLCHANGER As String = "ToolChanger"
|
||||
Public Const K_NUMBER As String = "Number"
|
||||
Public Const K_POS As String = "Pos"
|
||||
Public Const K_NAME As String = "Name"
|
||||
Public Const K_MANUALNUMBER As String = "ManualNumber"
|
||||
Public Const K_MANUALPOS As String = "ManualPos"
|
||||
Public Const K_MANUALNAME As String = "ManualName"
|
||||
|
||||
Public Const S_DISPOSITION As String = "Disposition"
|
||||
Public Const K_INITSCRIPT As String = "InitScript"
|
||||
|
||||
Public Const S_FIXTURES As String = "Fixtures"
|
||||
|
||||
Public Const S_HEADS As String = "Heads"
|
||||
|
||||
Public Const S_SETUP As String = "SetUp"
|
||||
Public Const K_DEFAULT As String = "Default"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,52 @@
|
||||
Module ConstMsg
|
||||
|
||||
Public Const MSG_SETUPERRORS As Integer = 5000 + 1470
|
||||
|
||||
Public Const MSG_MISSINGKEYWD As Integer = 10100
|
||||
Public Const MSG_NUMERICKEYBOARDWD As Integer = 10200
|
||||
Public Const MSG_MESSAGEBOX As Integer = 15000
|
||||
|
||||
Public Const MSG_OMAGCUT As Integer = 90000
|
||||
Public Const MSG_GENERAL As Integer = MSG_OMAGCUT
|
||||
Public Const MSG_WORKINPROGRESSPAGEUC As Integer = MSG_OMAGCUT + 100
|
||||
Public Const MSG_DIRECTCUTPAGEUC As Integer = MSG_OMAGCUT + 200
|
||||
Public Const MSG_MANUALAXESMOVEPAGEUC As Integer = MSG_OMAGCUT + 220
|
||||
Public Const MSG_CADCUTPAGEUC As Integer = MSG_OMAGCUT + 300
|
||||
Public Const MSG_NESTPAGEUC As Integer = MSG_OMAGCUT + 330
|
||||
Public Const MSG_SPLITPAGEUC As Integer = MSG_OMAGCUT + 340
|
||||
Public Const MSG_MOVERAWPAGEUC As Integer = MSG_OMAGCUT + 360
|
||||
Public Const MSG_DRAWPAGEUC As Integer = MSG_OMAGCUT + 380
|
||||
Public Const MSG_COMPONENTPAGEUC As Integer = MSG_OMAGCUT + 400
|
||||
Public Const MSG_IMPORTPAGEUC As Integer = MSG_OMAGCUT + 450
|
||||
Public Const MSG_OPENPAGEUC As Integer = MSG_OMAGCUT + 490
|
||||
Public Const MSG_RAWPARTPAGEUC As Integer = MSG_OMAGCUT + 500
|
||||
Public Const MSG_CHOOSEMACHININGPAGEUC As Integer = MSG_OMAGCUT + 535
|
||||
Public Const MSG_SIMULATIONPAGEUC As Integer = MSG_OMAGCUT + 550
|
||||
Public Const MSG_FRAMECUTPAGEUC As Integer = MSG_OMAGCUT + 600
|
||||
Public Const MSG_MACHINEPAGEUC As Integer = MSG_OMAGCUT + 700
|
||||
Public Const MSG_TOOLSDBPAGEUC As Integer = MSG_OMAGCUT + 720
|
||||
Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760
|
||||
Public Const MSG_COMBOBOXPARAM As Integer = MSG_OMAGCUT + 800
|
||||
Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 900
|
||||
Public Const MSG_MACHINECNPAGEUC As Integer = MSG_OMAGCUT + 950
|
||||
Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 980
|
||||
Public Const MSG_EGTMSGBOX As Integer = MSG_OMAGCUT + 1100
|
||||
Public Const MSG_CSVPAGEUC As Integer = MSG_OMAGCUT + 1200
|
||||
|
||||
Public Const MSG_OMAGOFFICE As Integer = 91400
|
||||
Public Const MSG_OPTIONPANEL As Integer = MSG_OMAGOFFICE
|
||||
Public Const MSG_MYMACHININGDBWINDOW As Integer = MSG_OMAGOFFICE + 50
|
||||
Public Const MSG_TOPCMDBAR As Integer = MSG_OMAGOFFICE + 100
|
||||
Public Const MSG_RAWPARTTAB As Integer = MSG_OMAGOFFICE + 150
|
||||
Public Const MSG_VEINMATCHING As Integer = MSG_OMAGOFFICE + 200
|
||||
|
||||
Public Const MSG_EGTWPFLIB5 As Integer = 30000
|
||||
Public Const MSG_TOPCOMMANDBAR As Integer = MSG_EGTWPFLIB5 + 500
|
||||
Public Const MSG_GRIDVIEWPANEL As Integer = MSG_EGTWPFLIB5 + 800
|
||||
Public Const MSG_TOOLDB As Integer = MSG_EGTWPFLIB5 + 1000
|
||||
Public Const MSG_TOOLDBERRORS As Integer = MSG_EGTWPFLIB5 + 1100
|
||||
Public Const MSG_MACHININGDB As Integer = MSG_EGTWPFLIB5 + 1200
|
||||
Public Const MSG_MACHININGDBERRORS As Integer = MSG_EGTWPFLIB5 + 1400
|
||||
Public Const MSG_SIMULATION As Integer = MSG_EGTWPFLIB5 + 1600
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,78 @@
|
||||
<Grid x:Class="KeyPageV"
|
||||
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">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding IsDongleMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox Name="IsDongleComboBox"
|
||||
ItemsSource="{Binding IsDongleList}"
|
||||
SelectedIndex="{Binding SelIsDongle}"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersComboBox}" />
|
||||
|
||||
<TextBlock Text="{Binding NumberMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding Number_Visibility}"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Number}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding Number_Visibility}"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding LockIDMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding LockID_Visibility}"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding LockID, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding LockID_Visibility}"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ClientNameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}" />
|
||||
|
||||
<ComboBox ItemsSource="{Binding ClientList}"
|
||||
SelectedItem="{Binding SelClient}"
|
||||
DisplayMemberPath="Name"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersComboBox}" SelectedIndex="-1"/>
|
||||
|
||||
<TextBlock Text="{Binding StateMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParametersTextBlock}" />
|
||||
|
||||
<ComboBox Name="StateComboBox"
|
||||
ItemsSource="{Binding StateList}"
|
||||
SelectedItem="{Binding SelState}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParametersComboBox}" SelectedIndex="2"/>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,10 @@
|
||||
Public Class KeyPageV
|
||||
Private Sub StateComboBox_Loaded(sender As Object, e As RoutedEventArgs) Handles StateComboBox.Loaded
|
||||
StateComboBox.SelectedIndex = -1
|
||||
End Sub
|
||||
|
||||
Private Sub IsDongleComboBox_Loaded(sender As Object, e As RoutedEventArgs) Handles IsDongleComboBox.Loaded
|
||||
IsDongleComboBox.SelectedIndex = 3
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,190 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class KeyPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_IsDongleList As New List(Of String)({"Hardware", "Software", "---ANY---", " "})
|
||||
Public ReadOnly Property IsDongleList As List(Of String)
|
||||
Get
|
||||
Return m_IsDongleList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelIsDongle As Integer
|
||||
Public Property SelIsDongle As Integer
|
||||
Get
|
||||
If (m_SelIsDongle = 1) Then
|
||||
Return 0
|
||||
End If
|
||||
If (m_SelIsDongle = 0) Then
|
||||
Return 1
|
||||
Else
|
||||
Return 2
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value = 0 Then
|
||||
m_SelIsDongle = 1 ' True
|
||||
' Rendo visibile Number
|
||||
Number_Visibility = Visibility.Visible
|
||||
LockID_Visibility = Visibility.Collapsed
|
||||
ElseIf value = 1 Then ' Else
|
||||
m_SelIsDongle = 0 ' False
|
||||
' Rendo visibile LockID
|
||||
Number_Visibility = Visibility.Collapsed
|
||||
LockID_Visibility = Visibility.Visible
|
||||
ElseIf value > 1 Then
|
||||
m_SelIsDongle = 2
|
||||
Number_Visibility = Visibility.Collapsed
|
||||
LockID_Visibility = Visibility.Visible
|
||||
End If
|
||||
NotifyPropertyChanged("SelIsDongle")
|
||||
End Set
|
||||
End Property
|
||||
Friend Function GetSelIsDongle() As Integer
|
||||
Return m_SelIsDongle
|
||||
End Function
|
||||
|
||||
Private m_Number_Visibility As Visibility
|
||||
Public Property Number_Visibility As Visibility
|
||||
Get
|
||||
Return m_Number_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_Number_Visibility = value
|
||||
NotifyPropertyChanged("Number_Visibility")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LockID As String
|
||||
Public Property LockID As String
|
||||
Get
|
||||
Return m_LockID
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_LockID = value
|
||||
NotifyPropertyChanged("LockID")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LockID_Visibility As Visibility
|
||||
Public Property LockID_Visibility As Visibility
|
||||
Get
|
||||
Return m_LockID_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_LockID_Visibility = value
|
||||
NotifyPropertyChanged("LockID_Visibility")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ClientList As List(Of Client)
|
||||
Public ReadOnly Property ClientList As List(Of Client)
|
||||
Get
|
||||
Return m_ClientList
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetClientList(value As List(Of Client))
|
||||
m_ClientList = value
|
||||
End Sub
|
||||
|
||||
Private m_SelClient As Client
|
||||
Public Property SelClient As Client
|
||||
Get
|
||||
Return m_SelClient
|
||||
End Get
|
||||
Set(value As Client)
|
||||
m_SelClient = value
|
||||
NotifyPropertyChanged("SelClient")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_StateList As New List(Of String)({" ", "Consegnata", "InDeposito", "Guasta", "---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
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetStateList(value As List(Of String)) ' Key.KeyState))
|
||||
m_StateList = value
|
||||
End Sub
|
||||
|
||||
Private m_SelState As Key.KeyState
|
||||
Public Property SelState As String
|
||||
Get
|
||||
Return m_SelState.ToString()
|
||||
End Get
|
||||
Set(value As String) ' Key.KeyState)
|
||||
'm_SelState = value
|
||||
If (value.Equals(" ")) Then m_SelState = Nothing
|
||||
If (value.Equals("Consegnata")) Then m_SelState = Key.KeyState.Consegnata
|
||||
If (value.Equals("InDeposito")) Then m_SelState = Key.KeyState.InDeposito
|
||||
If (value.Equals("Guasta")) Then m_SelState = Key.KeyState.Guasta
|
||||
If (value.Equals("---ANY---")) Then m_SelState = Key.KeyState.ANY
|
||||
NotifyPropertyChanged("SelState")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property IsDongleMsg As String
|
||||
Get
|
||||
Return "Is dongle"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property NumberMsg As String
|
||||
Get
|
||||
Return "Number"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LockIDMsg As String
|
||||
Get
|
||||
Return "LockID"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ClientNameMsg As String
|
||||
Get
|
||||
Return "Client name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property StateMsg As String
|
||||
Get
|
||||
Return "State"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitKeyPage()
|
||||
|
||||
' Svuoto campi
|
||||
m_LockID = String.Empty
|
||||
NotifyPropertyChanged("LockID")
|
||||
|
||||
' Carico valore di default IsDongle
|
||||
SelIsDongle = 0
|
||||
|
||||
' Carico lista Client
|
||||
Dim Query As String = "SELECT * FROM " & DB_CLIENT
|
||||
m_ClientList = ManageDb.ExecuteClientQuery(Query)
|
||||
m_ClientList.Add(New Client("---ANY---", 0, 0, ""))
|
||||
NotifyPropertyChanged("ClientList")
|
||||
|
||||
' Carico valore di default State (InDeposito)
|
||||
' m_SelState = Key.KeyState.Guasta
|
||||
NotifyPropertyChanged("StateList")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27004.2009
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "LicenseManager", "LicenseManager.vbproj", "{B21F637B-C515-45A2-B088-6709D7EAC948}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B21F637B-C515-45A2-B088-6709D7EAC948}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{B21F637B-C515-45A2-B088-6709D7EAC948}.Debug|x86.Build.0 = Debug|x86
|
||||
{B21F637B-C515-45A2-B088-6709D7EAC948}.Release|x86.ActiveCfg = Release|x86
|
||||
{B21F637B-C515-45A2-B088-6709D7EAC948}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2DC09E9B-6A75-42ED-B879-416A4B470194}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,368 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B21F637B-C515-45A2-B088-6709D7EAC948}</ProjectGuid>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>LicenseManager</RootNamespace>
|
||||
<AssemblyName>LicenseManager</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<MyType>Custom</MyType>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DocumentationFile>LicenseManager.xml</DocumentationFile>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DocumentationFile>LicenseManager.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>My Project\app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EgtUILib">
|
||||
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtWPFLib5">
|
||||
<HintPath>..\..\EgtProg\DllD32\EgtWPFLib5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.10.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\MySql.Data\v4.0_6.10.8.0__c5687fc88969c44d\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.106.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\EgtProg\LicenceManager\System.Data.SQLite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="UIAutomationProvider" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="WindowsFormsIntegration" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="Application.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Application.xaml.vb">
|
||||
<DependentUpon>Application.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ClientPage\ClientPageVM.vb" />
|
||||
<Compile Include="Constants\ConstDb.vb" />
|
||||
<Compile Include="Constants\ConstDoors.vb" />
|
||||
<Compile Include="Constants\ConstGen.vb" />
|
||||
<Compile Include="Constants\ConstIni.vb" />
|
||||
<Compile Include="Constants\ConstMsg.vb" />
|
||||
<Compile Include="KeyPage\KeyPageV.xaml.vb">
|
||||
<DependentUpon>KeyPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="KeyPage\KeyPageVM.vb" />
|
||||
<Compile Include="MainMenu\MainMenuV.xaml.vb">
|
||||
<DependentUpon>MainMenuV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainMenu\MainMenuVM.vb" />
|
||||
<Compile Include="MainWindow\MainWindowM.vb" />
|
||||
<Compile Include="MainWindow\Objects.vb" />
|
||||
<Compile Include="ClientPage\ClientPageV.xaml.vb">
|
||||
<DependentUpon>ClientPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NewClientPage\NewClientPageV.xaml.vb">
|
||||
<DependentUpon>NewClientPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NewClientPage\NewClientPageVM.vb" />
|
||||
<Compile Include="NewKeyPage\NewKeyPageV.xaml.vb">
|
||||
<DependentUpon>NewKeyPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NewKeyPage\NewKeyPageVM.vb" />
|
||||
<Compile Include="NewLicencePage\NewLicencePageV.xaml.vb">
|
||||
<DependentUpon>NewLicencePageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NewLicencePage\NewLicencePageVM.vb" />
|
||||
<Compile Include="NewProductPage\NewProductPageV.xaml.vb">
|
||||
<DependentUpon>NewProductPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NewProductPage\NewProductPageVM.vb" />
|
||||
<Compile Include="NewResellerPage\NewResellerPageV.xaml.vb">
|
||||
<DependentUpon>NewResellerPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NewResellerPage\NewResellerPageVM.vb" />
|
||||
<Compile Include="NewVersionPage\NewVersionPageV.xaml.vb">
|
||||
<DependentUpon>NewVersionPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NewVersionPage\NewVersionPageVM.vb" />
|
||||
<Compile Include="SearchClientPage\SearchClientPageV.xaml.vb">
|
||||
<DependentUpon>SearchClientPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SearchClientPage\SearchClientPageVM.vb" />
|
||||
<Compile Include="SearchKeyPage\SearchKeyPageV.xaml.vb">
|
||||
<DependentUpon>SearchKeyPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SearchKeyPage\SearchKeyPageVM.vb" />
|
||||
<Compile Include="SearchLicencePage\SearchLicencePageV.xaml.vb">
|
||||
<DependentUpon>SearchLicencePageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SearchLicencePage\SearchLicencePageVM.vb" />
|
||||
<Compile Include="SearchProductPage\SearchProductPageV.xaml.vb">
|
||||
<DependentUpon>SearchProductPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SearchProductPage\SearchProductPageVM.vb" />
|
||||
<Compile Include="SearchResellerPage\SearchResellerPageV.xaml.vb">
|
||||
<DependentUpon>SearchResellerPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SearchResellerPage\SearchResellerPageVM.vb" />
|
||||
<Compile Include="SearchVersionPage\SearchVersionPageV.xaml.vb">
|
||||
<DependentUpon>SearchVersionPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SearchVersionPage\SearchVersionPageVM.vb" />
|
||||
<Compile Include="Settings.vb" />
|
||||
<Compile Include="UpdateClientPage\UpdateClientPageV.xaml.vb">
|
||||
<DependentUpon>UpdateClientPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UpdateClientPage\UpdateClientPageVM.vb" />
|
||||
<Compile Include="UpdateKeyPage\UpdateKeyPageV.xaml.vb">
|
||||
<DependentUpon>UpdateKeyPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UpdateKeyPage\UpdateKeyPageVM.vb" />
|
||||
<Compile Include="UpdateLicencePage\UpdateLicencePageV.xaml.vb">
|
||||
<DependentUpon>UpdateLicencePageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UpdateLicencePage\UpdateLicencePageVM.vb" />
|
||||
<Compile Include="UpdateProductPage\UpdateProductPageV.xaml.vb">
|
||||
<DependentUpon>UpdateProductPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UpdateProductPage\UpdateProductPageVM.vb" />
|
||||
<Compile Include="UpdateResellerPage\UpdateResellerPageV.xaml.vb">
|
||||
<DependentUpon>UpdateResellerPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UpdateResellerPage\UpdateResellerPageVM.vb" />
|
||||
<Compile Include="UpdateVersionPage\UpdateVersionPageV.xaml.vb">
|
||||
<DependentUpon>UpdateVersionPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UpdateVersionPage\UpdateVersionPageVM.vb" />
|
||||
<Compile Include="Utility\Dictionary.xaml.vb">
|
||||
<DependentUpon>Dictionary.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\IniManager.vb" />
|
||||
<Compile Include="Utility\ManageDb.vb" />
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
<Compile Include="VersionPage\VersionPageV.xaml.vb">
|
||||
<DependentUpon>VersionPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VersionPage\VersionPageVM.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows" />
|
||||
<Import Include="System.Windows.Controls" />
|
||||
<Import Include="System.Windows.Data" />
|
||||
<Import Include="System.Windows.Documents" />
|
||||
<Import Include="System.Windows.Input" />
|
||||
<Import Include="System.Windows.Shapes" />
|
||||
<Import Include="System.Windows.Media" />
|
||||
<Import Include="System.Windows.Media.Imaging" />
|
||||
<Import Include="System.Windows.Navigation" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow\MainWindowV.xaml.vb">
|
||||
<DependentUpon>MainWindowV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainWindow\MainWindowVM.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="My Project\MyExtensions\MyWpfExtension.vb">
|
||||
<VBMyExtensionTemplateID>Microsoft.VisualBasic.WPF.MyExtension</VBMyExtensionTemplateID>
|
||||
<VBMyExtensionTemplateVersion>1.0.0.0</VBMyExtensionTemplateVersion>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<None Include="My Project\app.manifest">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="KeyPage\KeyPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainMenu\MainMenuV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow\MainWindowV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ClientPage\ClientPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="NewClientPage\NewClientPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="NewKeyPage\NewKeyPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="NewLicencePage\NewLicencePageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="NewProductPage\NewProductPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="NewResellerPage\NewResellerPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="NewVersionPage\NewVersionPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SearchClientPage\SearchClientPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SearchKeyPage\SearchKeyPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SearchLicencePage\SearchLicencePageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SearchProductPage\SearchProductPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SearchResellerPage\SearchResellerPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SearchVersionPage\SearchVersionPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UpdateClientPage\UpdateClientPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UpdateKeyPage\UpdateKeyPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UpdateLicencePage\UpdateLicencePageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UpdateProductPage\UpdateProductPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UpdateResellerPage\UpdateResellerPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UpdateVersionPage\UpdateVersionPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Utility\Dictionary.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="VersionPage\VersionPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\LicenceManager\LicenceManagerR32.exe
|
||||
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\LicenceManager\LicenceManagerD32.exe
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,113 @@
|
||||
<Grid x:Class="MainMenuV"
|
||||
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 MainMenuVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="Main Menù"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</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.RowDefinitions>
|
||||
<Button Content="Nuovo cliente"
|
||||
Command="{Binding NewClient_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"/>
|
||||
<Button Content="Nuova chiave"
|
||||
Command="{Binding NewKey_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"/>
|
||||
<Button Content="Nuova licenza"
|
||||
Command="{Binding NewLicence_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"/>
|
||||
<Button Content="Nuovo prodotto"
|
||||
Command="{Binding NewProduct_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="0"
|
||||
Grid.Row="3"/>
|
||||
<Button Content="Nuova versione"
|
||||
Command="{Binding NewVersion_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="0"
|
||||
Grid.Row="4"/>
|
||||
<Button Content="Nuovo rivenditore"
|
||||
Command="{Binding NewReseller_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="0"
|
||||
Grid.Row="5"/>
|
||||
|
||||
|
||||
<Button Content="Cerca cliente"
|
||||
Command="{Binding SearchClient_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="2"
|
||||
Grid.Row="0"/>
|
||||
<Button Content="Cerca chiave"
|
||||
Command="{Binding SearchKey_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="2"
|
||||
Grid.Row="1"/>
|
||||
<Button Content="Cerca licenza"
|
||||
Command="{Binding SearchLicence_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="2"
|
||||
Grid.Row="2"/>
|
||||
<Button Content="Cerca prodotto"
|
||||
Command="{Binding SearchProduct_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="2"
|
||||
Grid.Row="3"/>
|
||||
<Button Content="Cerca versione"
|
||||
Command="{Binding SearchVersion_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="2"
|
||||
Grid.Row="4"/>
|
||||
<Button Content="Cerca rivenditore"
|
||||
Command="{Binding SearchReseller_Command}"
|
||||
Height="60"
|
||||
Width="170"
|
||||
Grid.Column="2"
|
||||
Grid.Row="5"/>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class MainMenuV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,376 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MainMenuVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdNewClient As Command
|
||||
Private m_cmdNewKey As Command
|
||||
Private m_cmdNewLicence As Command
|
||||
Private m_cmdNewProduct As Command
|
||||
Private m_cmdNewVersion As Command
|
||||
Private m_cmdNewReseller As Command
|
||||
Private m_cmdSearchClient As Command
|
||||
Private m_cmdSearchKey As Command
|
||||
Private m_cmdSearchLicence As Command
|
||||
Private m_cmdSearchProduct As Command
|
||||
Private m_cmdSearchVersion As Command
|
||||
Private m_cmdSearchReseller As Command
|
||||
Private m_cmdUpdateClient As Command
|
||||
Private m_cmdUpdateKey As Command
|
||||
Private m_cmdUpdateLicence As Command
|
||||
Private m_cmdUpdateProduct As Command
|
||||
Private m_cmdUpdateVersion As Command
|
||||
Private m_cmdUpdateReseller As Command
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#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
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub NewClient(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWCLIENT
|
||||
End Sub
|
||||
|
||||
#End Region ' NewClient
|
||||
|
||||
#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
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub NewKey(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWKEY
|
||||
End Sub
|
||||
|
||||
#End Region ' NewKey
|
||||
|
||||
#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
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub NewLicence(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWLICENCE
|
||||
End Sub
|
||||
|
||||
#End Region ' NewLicence
|
||||
|
||||
#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
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub NewProduct(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWPRODUCT
|
||||
End Sub
|
||||
|
||||
#End Region ' NewProduct
|
||||
|
||||
#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
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub NewVersion(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWVERSION
|
||||
End Sub
|
||||
|
||||
#End Region ' NewVersion
|
||||
|
||||
#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
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub NewReseller(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.NEWRESELLER
|
||||
End Sub
|
||||
|
||||
#End Region ' NewReseller
|
||||
|
||||
#Region "SearchClient"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchClient_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearchClient Is Nothing Then
|
||||
m_cmdSearchClient = New Command(AddressOf SearchClient)
|
||||
End If
|
||||
Return m_cmdSearchClient
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub SearchClient(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHCLIENT
|
||||
End Sub
|
||||
|
||||
#End Region ' SearchCLient
|
||||
|
||||
#Region "SearchKey"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchKey_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearchKey Is Nothing Then
|
||||
m_cmdSearchKey = New Command(AddressOf SearchKey)
|
||||
End If
|
||||
Return m_cmdSearchKey
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub SearchKey(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHKEY
|
||||
End Sub
|
||||
|
||||
#End Region ' SearchKey
|
||||
|
||||
#Region "SearchLicence"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchLicence_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearchLicence Is Nothing Then
|
||||
m_cmdSearchLicence = New Command(AddressOf SearchLicence)
|
||||
End If
|
||||
Return m_cmdSearchLicence
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub SearchLicence(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHLICENCE
|
||||
End Sub
|
||||
|
||||
#End Region ' SearchLicence
|
||||
|
||||
#Region "SearchProduct"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchProduct_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearchProduct Is Nothing Then
|
||||
m_cmdSearchProduct = New Command(AddressOf SearchProduct)
|
||||
End If
|
||||
Return m_cmdSearchProduct
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub SearchProduct(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHPRODUCT
|
||||
End Sub
|
||||
|
||||
#End Region ' SearchProduct
|
||||
|
||||
#Region "SearchVersion"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchVersion_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearchVersion Is Nothing Then
|
||||
m_cmdSearchVersion = New Command(AddressOf SearchVersion)
|
||||
End If
|
||||
Return m_cmdSearchVersion
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub SearchVersion(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHVERSION
|
||||
End Sub
|
||||
|
||||
#End Region ' SearchVersion
|
||||
|
||||
#Region "SearchReseller"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchReseller_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearchReseller Is Nothing Then
|
||||
m_cmdSearchReseller = New Command(AddressOf SearchReseller)
|
||||
End If
|
||||
Return m_cmdSearchReseller
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub SearchReseller(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.SEARCHRESELLER
|
||||
End Sub
|
||||
|
||||
#End Region ' SearchReseller
|
||||
|
||||
#Region "UpdateClient"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateClient_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdateClient Is Nothing Then
|
||||
m_cmdUpdateClient = New Command(AddressOf UpdateClient)
|
||||
End If
|
||||
Return m_cmdUpdateClient
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub UpdateClient(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATECLIENT
|
||||
End Sub
|
||||
|
||||
#End Region ' UpdateClient
|
||||
|
||||
#Region "UpdateKey"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateKey_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdateKey Is Nothing Then
|
||||
m_cmdUpdateKey = New Command(AddressOf UpdateKey)
|
||||
End If
|
||||
Return m_cmdUpdateKey
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub UpdateKey(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATEKEY
|
||||
End Sub
|
||||
|
||||
#End Region ' UpdateKey
|
||||
|
||||
#Region "UpdateLicence"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateLicence_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdateLicence Is Nothing Then
|
||||
m_cmdUpdateLicence = New Command(AddressOf UpdateLicence)
|
||||
End If
|
||||
Return m_cmdUpdateLicence
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub UpdateLicence(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATELICENCE
|
||||
End Sub
|
||||
|
||||
#End Region ' UpdateKey
|
||||
|
||||
#Region "UpdateProduct"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateProduct_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdateProduct Is Nothing Then
|
||||
m_cmdUpdateProduct = New Command(AddressOf UpdateProduct)
|
||||
End If
|
||||
Return m_cmdUpdateProduct
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub UpdateProduct(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATEPRODUCT
|
||||
End Sub
|
||||
|
||||
#End Region ' UpdateProduct
|
||||
|
||||
#Region "UpdateVersion"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateVersion_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdateVersion Is Nothing Then
|
||||
m_cmdUpdateVersion = New Command(AddressOf UpdateVersion)
|
||||
End If
|
||||
Return m_cmdUpdateVersion
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub UpdateVersion(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATEVERSION
|
||||
End Sub
|
||||
|
||||
#End Region ' UpdateVersion
|
||||
|
||||
#Region "UpdateReseller"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateReseller_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdateReseller Is Nothing Then
|
||||
m_cmdUpdateReseller = New Command(AddressOf UpdateReseller)
|
||||
End If
|
||||
Return m_cmdUpdateReseller
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub UpdateReseller(ByVal param As Object)
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATERESELLER
|
||||
End Sub
|
||||
|
||||
#End Region ' SearchReseller
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,255 @@
|
||||
Imports System.Threading
|
||||
Imports System.Math
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MainWindowM
|
||||
|
||||
#Region "FIELDS"
|
||||
|
||||
Private m_sDataRoot As String = String.Empty
|
||||
Friend ReadOnly Property sDataRoot As String
|
||||
Get
|
||||
Return m_sDataRoot
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sConfigDir As String = String.Empty
|
||||
Public ReadOnly Property sConfigDir As String
|
||||
Get
|
||||
Return m_sConfigDir
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sDataDir As String = String.Empty
|
||||
Public ReadOnly Property sDataDir As String
|
||||
Get
|
||||
Return m_sDataDir
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nDebug As Integer = 0
|
||||
|
||||
Private m_objMutex As Mutex
|
||||
|
||||
Private m_bFirstInstance As Boolean = False
|
||||
Friend ReadOnly Property bFirstInstance As Boolean
|
||||
Get
|
||||
Return m_bFirstInstance
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nInstance As Integer = 0
|
||||
Friend ReadOnly Property nInstance As Integer
|
||||
Get
|
||||
Return m_nInstance
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nUserLevel As Integer = 1
|
||||
Friend ReadOnly Property nUserLevel As Integer
|
||||
Get
|
||||
Return m_nUserLevel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nKeyLevel As Integer = 0
|
||||
Friend ReadOnly Property nKeyLevel As Integer
|
||||
Get
|
||||
Return m_nKeyLevel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nKeyOptions As UInteger = 0
|
||||
Friend ReadOnly Property nKeyOptions As Integer
|
||||
Get
|
||||
Return m_nKeyOptions
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sTempDir As String
|
||||
Friend ReadOnly Property sTempDir As String
|
||||
Get
|
||||
Return m_sTempDir
|
||||
End Get
|
||||
End Property
|
||||
Private m_sLogFile As String
|
||||
Friend ReadOnly Property sLogFile As String
|
||||
Get
|
||||
Return m_sLogFile
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
InitializeEgtEnvironment()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub InitializeEgtEnvironment()
|
||||
' Impostazione path radice per i dati
|
||||
m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
|
||||
If EgtUILib.GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
|
||||
m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
|
||||
End If
|
||||
' Impostazione direttorio di configurazione
|
||||
m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
||||
' Impostazione direttorio per file temporanei
|
||||
m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
|
||||
' Impostazione direttorio che contiene il Db
|
||||
m_sDataDir = m_sDataRoot & "\" & DATA_DIR
|
||||
' Impostazione path Ini file
|
||||
IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
|
||||
' Verifico indice di istanza
|
||||
ManageInstance()
|
||||
' Imposto tipo di chiave
|
||||
EgtSetLockType(KEY_TYPE.HW)
|
||||
' Leggo e imposto chiave di protezione
|
||||
Dim sLicFileName As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
|
||||
Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
|
||||
Dim sKey As String = String.Empty
|
||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
EgtSetKey(sKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 18, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 18, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
Dim sLogMsg As String = "User " & Environment.MachineName & "\" & Environment.UserName & " (" & m_nInstance.ToString() & ")" & vbLf &
|
||||
My.Application.Info.Title.ToString() & " ver. " &
|
||||
My.Application.Info.Version.Major.ToString() &
|
||||
"." & My.Application.Info.Version.Minor.ToString() &
|
||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
||||
My.Application.Info.Version.Revision.ToString()
|
||||
EgtInit(m_nDebug, m_sLogFile, sLogMsg)
|
||||
EgtSetTempDir(m_sTempDir)
|
||||
EgtSetIniFile(IniFile.m_sIniFile)
|
||||
' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione)
|
||||
Dim sMsgDir As String = String.Empty
|
||||
If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
|
||||
sMsgDir = m_sConfigDir
|
||||
End If
|
||||
' Leggo lingua corrente
|
||||
Dim sLanguage As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage)
|
||||
' Recupero nome file dei messaggi della lingua corrente
|
||||
Dim sMsgName As String = "EgalTechIta.txt"
|
||||
Dim nIndex As Integer = 1
|
||||
While True
|
||||
Dim ReadLanguage As Language = GetMainPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
|
||||
If IsNothing(ReadLanguage) Then Exit While
|
||||
If String.Compare(ReadLanguage.Name, sLanguage, True) = 0 Then
|
||||
sMsgName = ReadLanguage.FilePath
|
||||
Exit While
|
||||
End If
|
||||
nIndex += 1
|
||||
End While
|
||||
' Leggo file messaggi
|
||||
Dim sMsgFilePath As String = sMsgDir & "\" & sMsgName
|
||||
If Not EgtLoadMessages(sMsgFilePath) Then
|
||||
EgtOutLog("Error in EgtLoadMessages")
|
||||
End If
|
||||
' Leggo e imposto livello utilizzatore
|
||||
m_nUserLevel = Math.Min(m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
|
||||
' Imposto dir font Nfe e font default
|
||||
Dim sNfeDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
|
||||
Dim sDefFont As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", sDefFont)
|
||||
EgtSetFont(sNfeDir, sDefFont)
|
||||
' Creo connessione al Db
|
||||
'If Not ManageDb.ConnectToDb(m_sDataDir & "\" & DB_FILENAME) Then
|
||||
' MessageBox.Show("Impossibile collegarsi al Db", EgtMsg(MSG_EGTMSGBOX + 15), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' End
|
||||
'End If
|
||||
' Info su opzioni chiave
|
||||
EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString() & " " & bProd.ToString())
|
||||
End Sub
|
||||
|
||||
Private Sub ManageInstance()
|
||||
Dim bCreated As Boolean
|
||||
Try
|
||||
m_objMutex = New Mutex(False, "Global\OmagPHOTO", bCreated)
|
||||
Catch
|
||||
bCreated = False
|
||||
End Try
|
||||
m_bFirstInstance = bCreated
|
||||
If bCreated Then
|
||||
' Prima istanza
|
||||
m_nInstance = 1
|
||||
' Aggiorno stato istanze attive
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString())
|
||||
Else
|
||||
' Leggo il massimo numero di istanze ammesse
|
||||
Const MAX_INST As Integer = 32
|
||||
Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
|
||||
nMaxInst = Max(1, Min(nMaxInst, MAX_INST))
|
||||
' Cerco il primo indice di istanza libero
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
m_nInstance = 1
|
||||
Dim nMask As Integer = 1
|
||||
While (nTmp And nMask) <> 0 And m_nInstance < MAX_INST
|
||||
m_nInstance += 1
|
||||
nMask *= 2
|
||||
End While
|
||||
' Se l'indice supera il massimo
|
||||
If m_nInstance > nMaxInst Then
|
||||
' porto in primo piano la prima istanza
|
||||
Dim bFound As Boolean = False
|
||||
' processi del programma a 32 bit
|
||||
Dim localProc As Process() = Process.GetProcessesByName("OmagPHOTOR32")
|
||||
For Each p As Process In localProc
|
||||
If p.Id <> Process.GetCurrentProcess().Id Then
|
||||
bFound = True
|
||||
ShowWindow(p.MainWindowHandle, 1)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' se non trovati processi a 32 bit provo a 64 bit
|
||||
If Not bFound Then
|
||||
localProc = Process.GetProcessesByName("OmagPHOTOR64")
|
||||
For Each p As Process In localProc
|
||||
If p.Id <> Process.GetCurrentProcess().Id Then
|
||||
bFound = True
|
||||
ShowWindow(p.MainWindowHandle, SW.RESTORE)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' esco dal programma
|
||||
End
|
||||
End If
|
||||
' Aggiorno stato istanze attive
|
||||
nTmp += (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Function GetKeyOption(nKeyOpt As KEY_OPT) As Boolean
|
||||
Return ((m_nKeyOptions And nKeyOpt) <> 0)
|
||||
End Function
|
||||
|
||||
Friend Sub Close()
|
||||
' Terminazione generale di EgtInterface
|
||||
EgtExit()
|
||||
' Rilascio mutex
|
||||
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
|
||||
' Aggiorno istanze usate
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
nTmp -= (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,17 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="MainWindowV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:LicenceManager="clr-namespace:LicenseManager"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
DataContext="{StaticResource MainWindowVM}"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Title="{Binding Title}"
|
||||
MinHeight="300" MinWidth="400"
|
||||
Width="800" Height="550"
|
||||
|
||||
WindowStartupLocation="CenterScreen">
|
||||
|
||||
<!--Pannello principale -->
|
||||
<ContentControl Content="{Binding ProjectContent}"/>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,38 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Class MainWindowV
|
||||
|
||||
Private m_MainWindowVM As MainWindowVM
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Funzione che interpreta l'xaml
|
||||
InitializeComponent()
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_MainWindowVM = DirectCast(Me.DataContext, MainWindowVM)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' Carico e imposto posizione finestra
|
||||
WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
|
||||
m_MainWindowVM.ContentRendered()
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
|
||||
' Salvo posizione finestra (se non minimizzata)
|
||||
If WindowState <> WindowState.Minimized Then
|
||||
WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,282 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MainWindowVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Enum ProjectModeOpt As Integer
|
||||
MAINMENU = 0
|
||||
NEWCLIENT = 1
|
||||
NEWKEY = 2
|
||||
NEWLICENCE = 3
|
||||
NEWPRODUCT = 4
|
||||
NEWVERSION = 5
|
||||
NEWRESELLER = 6
|
||||
SEARCHCLIENT = 7
|
||||
SEARCHKEY = 8
|
||||
SEARCHLICENCE = 9
|
||||
SEARCHPRODUCT = 10
|
||||
SEARCHVERSION = 11
|
||||
SEARCHRESELLER = 12
|
||||
UPDATECLIENT = 13
|
||||
UPDATEKEY = 14
|
||||
UPDATELICENCE = 15
|
||||
UPDATEPRODUCT = 16
|
||||
UPDATEVERSION = 17
|
||||
UPDATERESELLER = 18
|
||||
|
||||
End Enum
|
||||
|
||||
Private m_MainWindowM As MainWindowM
|
||||
Friend ReadOnly Property MainWindowM As MainWindowM
|
||||
Get
|
||||
Return m_MainWindowM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Variabile che indica che il programma è stato avviato correttamente (sia la mappa che l'ambiente Egt)
|
||||
Private m_bInitStatus As Boolean
|
||||
Friend ReadOnly Property InitStatus As Boolean
|
||||
Get
|
||||
Return m_bInitStatus
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Titolo
|
||||
Private m_Title As String
|
||||
Public Property Title As String
|
||||
Get
|
||||
Return m_Title
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Title = value
|
||||
NotifyPropertyChanged("Title")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelProjectMode As ProjectModeOpt
|
||||
Friend Property SelProjectMode As ProjectModeOpt
|
||||
Get
|
||||
Return m_SelProjectMode
|
||||
End Get
|
||||
Set(value As ProjectModeOpt)
|
||||
' Esco dallo stato corrente
|
||||
Select Case m_SelProjectMode
|
||||
Case ProjectModeOpt.MAINMENU
|
||||
|
||||
Case ProjectModeOpt.NEWCLIENT
|
||||
|
||||
Case ProjectModeOpt.NEWKEY
|
||||
|
||||
Case ProjectModeOpt.NEWLICENCE
|
||||
|
||||
Case ProjectModeOpt.NEWPRODUCT
|
||||
|
||||
Case ProjectModeOpt.NEWVERSION
|
||||
|
||||
Case ProjectModeOpt.NEWRESELLER
|
||||
|
||||
Case ProjectModeOpt.SEARCHCLIENT
|
||||
|
||||
Case ProjectModeOpt.SEARCHKEY
|
||||
|
||||
Case ProjectModeOpt.SEARCHLICENCE
|
||||
|
||||
Case ProjectModeOpt.SEARCHPRODUCT
|
||||
|
||||
Case ProjectModeOpt.SEARCHVERSION
|
||||
|
||||
Case ProjectModeOpt.SEARCHRESELLER
|
||||
|
||||
Case ProjectModeOpt.UPDATECLIENT
|
||||
|
||||
Case ProjectModeOpt.UPDATEKEY
|
||||
|
||||
Case ProjectModeOpt.UPDATELICENCE
|
||||
|
||||
Case ProjectModeOpt.UPDATEPRODUCT
|
||||
|
||||
Case ProjectModeOpt.UPDATEVERSION
|
||||
|
||||
Case ProjectModeOpt.UPDATERESELLER
|
||||
|
||||
End Select
|
||||
' Entro nel nuovo stato
|
||||
m_SelProjectMode = value
|
||||
Select Case m_SelProjectMode
|
||||
Case ProjectModeOpt.MAINMENU
|
||||
|
||||
Case ProjectModeOpt.NEWCLIENT
|
||||
Try
|
||||
Map.refNewClientPageVM.InitNewClientPage()
|
||||
Catch ex As Exception
|
||||
MsgBox("Eccezione generata" & vbCrLf & ex.Message)
|
||||
End Try
|
||||
Case ProjectModeOpt.NEWKEY
|
||||
Map.refNewKeyPageVM.InitNewKeyPage()
|
||||
Case ProjectModeOpt.NEWLICENCE
|
||||
Map.refNewLicencePageVM.InitNewLicencePage()
|
||||
Case ProjectModeOpt.NEWPRODUCT
|
||||
Map.refNewProductPageVM.InitNewProductPage()
|
||||
Case ProjectModeOpt.NEWVERSION
|
||||
Map.refNewVersionPageVM.InitVersionPage()
|
||||
Case ProjectModeOpt.NEWRESELLER
|
||||
Map.refNewResellerPageVM.InitNewResellerPage()
|
||||
Case ProjectModeOpt.SEARCHCLIENT
|
||||
Map.refSearchClientPageVM.InitSearchClientPage()
|
||||
Case ProjectModeOpt.SEARCHKEY
|
||||
Map.refSearchKeyPageVM.InitSearchKeyPage()
|
||||
Case ProjectModeOpt.SEARCHLICENCE
|
||||
Map.refSearchLicencePageVM.InitSearchLicencePage()
|
||||
Case ProjectModeOpt.SEARCHPRODUCT
|
||||
Map.refSearchProductPageVM.InitSearchProductPage()
|
||||
Case ProjectModeOpt.SEARCHVERSION
|
||||
Map.refSearchVersionPageVM.InitSearchVersionPage()
|
||||
Case ProjectModeOpt.SEARCHRESELLER
|
||||
Map.refSearchResellerPageVM.InitSearchResellerPage()
|
||||
Case ProjectModeOpt.UPDATECLIENT
|
||||
Map.refUpdateClientPageVM.InitUpdateClientPage()
|
||||
Case ProjectModeOpt.UPDATEKEY
|
||||
Map.refUpdateKeyPageVM.InitUpdateKeyPage()
|
||||
Case ProjectModeOpt.UPDATELICENCE
|
||||
Map.refUpdateLicencePageVM.InitUpdateLicencePage()
|
||||
Case ProjectModeOpt.UPDATEPRODUCT
|
||||
Map.refUpdateProductPageVM.InitUpdateProductPage()
|
||||
Case ProjectModeOpt.UPDATEVERSION
|
||||
Map.refUpdateVersionPageVM.InitUpdateVersionPage()
|
||||
Case ProjectModeOpt.UPDATERESELLER
|
||||
Map.refUpdateResellerPageVM.InitUpdateResellerPage()
|
||||
End Select
|
||||
NotifyPropertyChanged("ProjectContent")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MainMenuV As New MainMenuV
|
||||
Private m_NewClientPageV As New NewClientPageV
|
||||
Private m_NewKeyPageV As New NewKeyPageV
|
||||
Private m_NewLicencePageV As New NewLicencePageV
|
||||
Private m_NewProductPageV As New NewProductPageV
|
||||
Private m_NewVersionPageV As New NewVersionPageV
|
||||
Private m_NewResellerPageV As New NewResellerPageV
|
||||
Private m_SearchClientPageV As New SearchClientPageV
|
||||
Private m_SearchKeyPageV As New SearchKeyPageV
|
||||
Private m_SearchLicencePageV As New SearchLicencePageV
|
||||
Private m_SearchProductPageV As New SearchProductPageV
|
||||
Private m_SearchVersionPageV As New SearchVersionPageV
|
||||
Private m_SearchResellerPageV As New SearchResellerPageV
|
||||
Private m_UpdateClientPageV As New UpdateClientPageV
|
||||
Private m_UpdateKeyPageV As New UpdateKeyPageV
|
||||
Private m_UpdateLicencePageV As New UpdateLicencePageV
|
||||
Private m_UpdateProductPageV As New UpdateProductPageV
|
||||
Private m_UpdateVersionPageV As New UpdateVersionPageV
|
||||
Private m_UpdateResellerPageV As New UpdateResellerPageV
|
||||
|
||||
Public ReadOnly Property ProjectContent As FrameworkElement
|
||||
Get
|
||||
Select Case m_SelProjectMode
|
||||
Case ProjectModeOpt.MAINMENU
|
||||
Return m_MainMenuV
|
||||
Case ProjectModeOpt.NEWCLIENT
|
||||
Return m_NewClientPageV
|
||||
Case ProjectModeOpt.NEWKEY
|
||||
Return m_NewKeyPageV
|
||||
Case ProjectModeOpt.NEWLICENCE
|
||||
Return m_NewLicencePageV
|
||||
Case ProjectModeOpt.NEWPRODUCT
|
||||
Return m_NewProductPageV
|
||||
Case ProjectModeOpt.NEWVERSION
|
||||
Return m_NewVersionPageV
|
||||
Case ProjectModeOpt.NEWRESELLER
|
||||
Return m_NewResellerPageV
|
||||
Case ProjectModeOpt.SEARCHCLIENT
|
||||
Return m_SearchClientPageV
|
||||
Case ProjectModeOpt.SEARCHKEY
|
||||
Return m_SearchKeyPageV
|
||||
Case ProjectModeOpt.SEARCHLICENCE
|
||||
Return m_SearchLicencePageV
|
||||
Case ProjectModeOpt.SEARCHPRODUCT
|
||||
Return m_SearchProductPageV
|
||||
Case ProjectModeOpt.SEARCHVERSION
|
||||
Return m_SearchVersionPageV
|
||||
Case ProjectModeOpt.SEARCHRESELLER
|
||||
Return m_SearchResellerPageV
|
||||
Case ProjectModeOpt.UPDATECLIENT
|
||||
Return m_UpdateClientPageV
|
||||
Case ProjectModeOpt.UPDATEKEY
|
||||
Return m_UpdateKeyPageV
|
||||
Case ProjectModeOpt.UPDATELICENCE
|
||||
Return m_UpdateLicencePageV
|
||||
Case ProjectModeOpt.UPDATEPRODUCT
|
||||
Return m_UpdateProductPageV
|
||||
Case ProjectModeOpt.UPDATEVERSION
|
||||
Return m_UpdateVersionPageV
|
||||
Case ProjectModeOpt.UPDATERESELLER
|
||||
Return m_UpdateResellerPageV
|
||||
Case Else
|
||||
Return m_MainMenuV
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Avvio l'inizializzazione della mappa passandogli il riferimento al MainWindowVM
|
||||
Map.BeginInit(Me)
|
||||
' Costruisco model della MainWindow
|
||||
m_MainWindowM = New MainWindowM
|
||||
' Imposto pagina MainMenu all'avvio
|
||||
SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub SetTitle(sTitle As String)
|
||||
m_Title = sTitle
|
||||
NotifyPropertyChanged("Title")
|
||||
End Sub
|
||||
|
||||
Friend Sub ContentRendered()
|
||||
' Verifico che l'inizializzazione di tutte le parti del programma sia andata a buon fine
|
||||
If Map.EndInit() Then
|
||||
m_bInitStatus = True
|
||||
' altrimenti chiudo il programma
|
||||
Else
|
||||
m_bInitStatus = False
|
||||
End If
|
||||
'ManageDb.CreateTable()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
'#Region "AboutBoxCommand"
|
||||
|
||||
' ' Returns a command that manage the MainWindow_Unloaded command
|
||||
' Public ReadOnly Property AboutBoxCommand() As ICommand
|
||||
' Get
|
||||
' If m_cmdAboutBox Is Nothing Then
|
||||
' m_cmdAboutBox = New Command(AddressOf AboutBox)
|
||||
' End If
|
||||
' Return m_cmdAboutBox
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
' Public Sub AboutBox(ByVal param As Object)
|
||||
' Dim AboutBoxWindow As New AboutBoxV
|
||||
' AboutBoxWindow.Owner = Application.Current.MainWindow
|
||||
' AboutBoxWindow.ShowDialog()
|
||||
' End Sub
|
||||
|
||||
'#End Region ' AboutBoxCommand
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,333 @@
|
||||
Imports System.Data.SQLite
|
||||
Imports MySql.Data.MySqlClient
|
||||
|
||||
Public Class Client
|
||||
|
||||
Private m_Name As String
|
||||
Public ReadOnly Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Email As String
|
||||
Public ReadOnly Property Email As String
|
||||
Get
|
||||
Return m_Email
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ResellerID As Integer
|
||||
Public ReadOnly Property ResellerID As Integer
|
||||
Get
|
||||
Return m_ResellerID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ClientID As Integer
|
||||
Public ReadOnly Property ClientID As Integer
|
||||
Get
|
||||
Return m_ClientID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(Name As String, ResellerID As Integer, ClientID As Integer, Email As String)
|
||||
m_Name = Name
|
||||
m_ResellerID = ResellerID
|
||||
m_ClientID = ClientID
|
||||
m_Email = Email
|
||||
End Sub
|
||||
|
||||
Sub New(ClientReader As MySqlDataReader)
|
||||
m_Name = CType(ClientReader(DB_NAME), String)
|
||||
m_ResellerID = CInt(ClientReader(DB_RESELLERID))
|
||||
m_ClientID = CInt(ClientReader(DB_CLIENTID))
|
||||
m_Email = CType(ClientReader(DB_EMAIL), String)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Key
|
||||
|
||||
Private m_Number As Integer
|
||||
Public ReadOnly Property Number As Integer
|
||||
Get
|
||||
Return m_Number
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ClientID As Integer
|
||||
Public ReadOnly Property ClientID As Integer
|
||||
Get
|
||||
Return m_ClientID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_IsDongle As Integer
|
||||
Public ReadOnly Property IsDongle As Integer
|
||||
Get
|
||||
Return m_IsDongle
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_LockID As String
|
||||
Public ReadOnly Property LockID As String
|
||||
Get
|
||||
Return m_LockID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Enum KeyState
|
||||
Consegnata = 0
|
||||
InDeposito = 1
|
||||
Guasta = 2
|
||||
ANY = 3
|
||||
End Enum
|
||||
|
||||
Private m_State As KeyState
|
||||
Public ReadOnly Property State As KeyState
|
||||
Get
|
||||
Return m_State
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(Number As Integer, ClientID As Integer, IsDongle As Integer, LockID As String, State As KeyState)
|
||||
m_Number = Number
|
||||
m_ClientID = ClientID
|
||||
m_IsDongle = IsDongle
|
||||
m_LockID = LockID
|
||||
m_State = State
|
||||
End Sub
|
||||
|
||||
Sub New(KeyReader As MySqlDataReader)
|
||||
m_Number = CInt(KeyReader(DB_NUMBER))
|
||||
m_ClientID = CInt(KeyReader(DB_CLIENTID))
|
||||
m_IsDongle = CInt(KeyReader(DB_ISDONGLE))
|
||||
m_LockID = CType(KeyReader(DB_LOCKID), String)
|
||||
m_State = DirectCast([Enum].Parse(GetType(KeyState), KeyReader(DB_STATE)), KeyState)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Licence
|
||||
|
||||
Private m_ProductID As Integer
|
||||
Public ReadOnly Property ProductID As Integer
|
||||
Get
|
||||
Return m_ProductID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProductVersion As String
|
||||
Public ReadOnly Property ProductVersion As String
|
||||
Get
|
||||
Return m_ProductVersion
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProductLevel As Integer
|
||||
Public ReadOnly Property ProductLevel As Integer
|
||||
Get
|
||||
Return m_ProductLevel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProductDeadline As Date
|
||||
Public ReadOnly Property ProductDeadline As Date
|
||||
Get
|
||||
Return m_ProductDeadline
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Option1 As Integer
|
||||
Public ReadOnly Property Option1 As Integer
|
||||
Get
|
||||
Return m_Option1
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Option2 As Integer
|
||||
Public ReadOnly Property Option2 As Integer
|
||||
Get
|
||||
Return m_Option2
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_OptionDeadline As Date
|
||||
Public ReadOnly Property OptionDeadline As Date
|
||||
Get
|
||||
Return m_OptionDeadline
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_LockID As String
|
||||
Public ReadOnly Property Number As String
|
||||
Get
|
||||
Return m_LockID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_File As String
|
||||
Public ReadOnly Property File As String
|
||||
Get
|
||||
Return m_File
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_LicenceID As String
|
||||
Public ReadOnly Property LicenceID As String
|
||||
Get
|
||||
Return m_LicenceID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(ProductID As Integer, ProductVersion As String, ProductLevel As Integer, ProductDeadline As Date, Option1 As Integer, Option2 As Integer, OptionDeadline As Date, LockID As String, File As String, LicenceID As String)
|
||||
m_ProductID = ProductID
|
||||
m_ProductVersion = ProductVersion
|
||||
m_ProductLevel = ProductLevel
|
||||
m_ProductDeadline = ProductDeadline
|
||||
m_Option1 = Option1
|
||||
m_Option2 = Option2
|
||||
m_OptionDeadline = OptionDeadline
|
||||
m_LockID = LockID
|
||||
m_File = File
|
||||
m_LicenceID = LicenceID
|
||||
End Sub
|
||||
|
||||
Sub New(LicenceReader As MySqlDataReader)
|
||||
m_ProductID = CInt(LicenceReader(DB_PRODUCTID))
|
||||
m_ProductVersion = CType(LicenceReader(DB_PRODUCTVERSION), String)
|
||||
m_ProductLevel = CInt(LicenceReader(DB_PRODUCTLEVEL))
|
||||
m_ProductDeadline = CDate(LicenceReader(DB_PRODUCTDEADLINE))
|
||||
m_Option1 = CInt(LicenceReader(DB_OPTION1))
|
||||
m_Option2 = CInt(LicenceReader(DB_OPTION2))
|
||||
m_OptionDeadline = CDate(LicenceReader(DB_OPTIONDEADLINE))
|
||||
m_LockID = CType(LicenceReader(DB_LOCKID), String)
|
||||
m_File = CType(LicenceReader(DB_FILE), String)
|
||||
m_LicenceID = CType(LicenceReader(DB_LICENCEID), String)
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Product
|
||||
|
||||
Private m_ProductName As String
|
||||
Public ReadOnly Property ProductName As String
|
||||
Get
|
||||
Return m_ProductName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProductID As Integer
|
||||
Public ReadOnly Property ProductID As Integer
|
||||
Get
|
||||
Return m_ProductID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProductNumber As Integer
|
||||
Public ReadOnly Property ProductNumber As Integer
|
||||
Get
|
||||
Return m_ProductNumber
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProductOption1 As Integer
|
||||
Public ReadOnly Property ProductOption1 As Integer
|
||||
Get
|
||||
Return m_ProductOption1
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProductOption2 As Integer
|
||||
Public ReadOnly Property ProductOption2 As Integer
|
||||
Get
|
||||
Return m_ProductOption2
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(ProductName As String, ProductID As Integer, ProductNumber As Integer, ProductOption1 As Integer, ProductOption2 As Integer)
|
||||
m_ProductName = ProductName
|
||||
m_ProductID = ProductID
|
||||
m_ProductNumber = ProductNumber
|
||||
m_ProductOption1 = ProductOption1
|
||||
m_ProductOption2 = ProductOption2
|
||||
End Sub
|
||||
|
||||
Sub New(ProductReader As MySqlDataReader)
|
||||
m_ProductName = CType(ProductReader(DB_PRODUCTNAME), String)
|
||||
m_ProductID = CInt(ProductReader(DB_PRODUCTID))
|
||||
m_ProductNumber = CInt(ProductReader(DB_PRODUCTNUMBER))
|
||||
m_ProductOption1 = CInt(ProductReader(DB_PRODUCTOPTION1))
|
||||
m_ProductOption2 = CInt(ProductReader(DB_PRODUCTOPTION2))
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Version
|
||||
|
||||
Private m_VersionID As Integer
|
||||
Public ReadOnly Property VersionID As Integer
|
||||
Get
|
||||
Return m_VersionID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProductID As Integer
|
||||
Public ReadOnly Property ProductID As Integer
|
||||
Get
|
||||
Return m_ProductID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_VersionNumber As Integer
|
||||
Public ReadOnly Property VersionNumber As Integer
|
||||
Get
|
||||
Return m_VersionNumber
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(VersionID As String, ProductID As String, VersionNumber As Integer)
|
||||
m_VersionID = CInt(VersionID)
|
||||
m_ProductID = CInt(ProductID)
|
||||
m_VersionNumber = VersionNumber
|
||||
End Sub
|
||||
|
||||
Sub New(VersionReader As MySqlDataReader)
|
||||
m_VersionID = CInt(VersionReader(DB_VERSIONID))
|
||||
m_ProductID = CInt(VersionReader(DB_PRODUCTID))
|
||||
m_VersionNumber = CInt(VersionReader(DB_VERSIONNUMBER))
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Reseller
|
||||
|
||||
Private m_ResellerName As String
|
||||
Public ReadOnly Property ResellerName As String
|
||||
Get
|
||||
Return m_ResellerName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ResellerID As Integer
|
||||
Public ReadOnly Property ResellerID As Integer
|
||||
Get
|
||||
Return m_ResellerID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(ResellerName As String, ResellerID As Integer)
|
||||
m_ResellerName = ResellerName
|
||||
m_ResellerID = ResellerID
|
||||
End Sub
|
||||
|
||||
Sub New(ResellerReader As MySqlDataReader)
|
||||
m_ResellerName = CType(ResellerReader(DB_RESELLERNAME), String)
|
||||
m_ResellerID = CInt(ResellerReader(DB_RESELLERID))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,59 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Globalization
|
||||
Imports System.Resources
|
||||
Imports System.Windows
|
||||
|
||||
' Le informazioni generali relative a un assembly sono controllate dal seguente
|
||||
' set di attributi. Modificare i valori di questi attributi per modificare le informazioni
|
||||
' associate a un assembly.
|
||||
|
||||
' Controllare i valori degli attributi degli assembly
|
||||
|
||||
<Assembly: AssemblyTitle("LicenseManager")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Egaltech srl")>
|
||||
<Assembly: AssemblyProduct("LicenseManager")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2018-2019")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
'Per iniziare a creare applicazioni localizzabili, impostare
|
||||
'<UICulture>CultureYouAreCodingWith</UICulture> nel file VBPROJ
|
||||
'all'interno di un <PropertyGroup>. Ad esempio, se si utilizza l'inglese (Stati Uniti)
|
||||
'nei file di origine, impostare <UICulture> su "en-US". Rimuovere quindi il commento
|
||||
'dall'attributo NeutralResourceLanguage seguente. Aggiornare "en-US" nella riga
|
||||
'seguente in modo che corrisponda all'impostazione di UICulture nel file di progetto.
|
||||
|
||||
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)>
|
||||
|
||||
|
||||
'L'attributo ThemeInfo indica la possibile posizione dei dizionari risorse generici e specifici del tema.
|
||||
'Primo parametro: posizione dei dizionari risorse specifici del tema
|
||||
'(da usare se nella pagina non viene trovata una risorsa,
|
||||
' oppure nei dizionari delle risorse dell'applicazione)
|
||||
|
||||
'Parametro 2: posizione del dizionario risorse generico
|
||||
'(da usare se nella pagina non viene trovata una risorsa,
|
||||
'un'applicazione e alcun dizionario risorse specifico del tema)
|
||||
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
|
||||
|
||||
|
||||
|
||||
'Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
|
||||
<Assembly: Guid("64de646a-3bd2-42cd-a09b-240d71113cff")>
|
||||
|
||||
' Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
|
||||
'
|
||||
' Versione principale
|
||||
' Versione secondaria
|
||||
' Numero di build
|
||||
' Revisione
|
||||
'
|
||||
' È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
|
||||
' usando l'asterisco '*' come illustrato di seguito:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.1.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.1.2.1")>
|
||||
@@ -0,0 +1,121 @@
|
||||
#If _MyType <> "Empty" Then
|
||||
|
||||
Namespace My
|
||||
''' <summary>
|
||||
''' Modulo utilizzato per definire le proprietà disponibili nello spazio dei nomi My per WPF
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
<Global.Microsoft.VisualBasic.HideModuleName()>
|
||||
Module MyWpfExtension
|
||||
Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
|
||||
Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
|
||||
Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
|
||||
Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
|
||||
''' <summary>
|
||||
''' Restituisce l'oggetto applicazione per l'applicazione in esecuzione
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")>
|
||||
Friend ReadOnly Property Application() As Application
|
||||
Get
|
||||
Return CType(Global.System.Windows.Application.Current, Application)
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Restituisce le informazioni sul computer host.
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")>
|
||||
Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
|
||||
Get
|
||||
Return s_Computer.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Restituisce le informazioni per l'utente corrente. Se si desidera eseguire l'applicazione con le
|
||||
''' credenziali utente di Windows correnti, chiamare My.User.InitializeWithWindowsUser().
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")>
|
||||
Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
|
||||
Get
|
||||
Return s_User.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Restituisce il registro applicazioni. I listener possono essere configurati dal file di configurazione dell'applicazione.
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")>
|
||||
Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
|
||||
Get
|
||||
Return s_Log.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Restituisce la raccolta di oggetti Window definiti nel progetto.
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")>
|
||||
Friend ReadOnly Property Windows() As MyWindows
|
||||
<Global.System.Diagnostics.DebuggerHidden()>
|
||||
Get
|
||||
Return s_Windows.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)>
|
||||
<Global.Microsoft.VisualBasic.MyGroupCollection("System.Windows.Window", "Create__Instance__", "Dispose__Instance__", "My.MyWpfExtenstionModule.Windows")>
|
||||
Friend NotInheritable Class MyWindows
|
||||
<Global.System.Diagnostics.DebuggerHidden()>
|
||||
Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
|
||||
If Instance Is Nothing Then
|
||||
If s_WindowBeingCreated IsNot Nothing Then
|
||||
If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
|
||||
Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
|
||||
End If
|
||||
Else
|
||||
s_WindowBeingCreated = New Global.System.Collections.Hashtable()
|
||||
End If
|
||||
s_WindowBeingCreated.Add(GetType(T), Nothing)
|
||||
Return New T()
|
||||
s_WindowBeingCreated.Remove(GetType(T))
|
||||
Else
|
||||
Return Instance
|
||||
End If
|
||||
End Function
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")>
|
||||
<Global.System.Diagnostics.DebuggerHidden()>
|
||||
Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
|
||||
instance = Nothing
|
||||
End Sub
|
||||
<Global.System.Diagnostics.DebuggerHidden()>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)>
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
End Sub
|
||||
<Global.System.ThreadStatic()> Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function Equals(ByVal o As Object) As Boolean
|
||||
Return MyBase.Equals(o)
|
||||
End Function
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function GetHashCode() As Integer
|
||||
Return MyBase.GetHashCode
|
||||
End Function
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")>
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)>
|
||||
Friend Overloads Function [GetType]() As Global.System.Type
|
||||
Return GetType(MyWindows)
|
||||
End Function
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function ToString() As String
|
||||
Return MyBase.ToString
|
||||
End Function
|
||||
End Class
|
||||
End Module
|
||||
End Namespace
|
||||
Partial Class Application
|
||||
Inherits Global.System.Windows.Application
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")>
|
||||
Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
|
||||
<Global.System.Diagnostics.DebuggerHidden()>
|
||||
Get
|
||||
Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
#End If
|
||||
Generated
+63
@@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Il codice è stato generato da uno strumento.
|
||||
' Versione runtime:4.0.30319.42000
|
||||
'
|
||||
' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
|
||||
' il codice viene rigenerato.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder.
|
||||
'tramite uno strumento quale ResGen o Visual Studio.
|
||||
'Per aggiungere o rimuovere un membro, modificare il file con estensione ResX ed eseguire nuovamente ResGen
|
||||
'con l'opzione /str oppure ricompilare il progetto VS.
|
||||
'''<summary>
|
||||
''' Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("LicenseManager.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte le
|
||||
''' ricerche di risorse eseguite utilizzando questa classe di risorse fortemente tipizzata.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Generated
+71
@@ -0,0 +1,71 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Il codice è stato generato da uno strumento.
|
||||
' Versione runtime:4.0.30319.42000
|
||||
'
|
||||
' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
|
||||
' il codice viene rigenerato.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "Funzionalità di salvataggio automatico My.Settings"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.LicenseManager.MySettings
|
||||
Get
|
||||
Return Global.LicenseManager.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<!-- Opzioni manifesto di Controllo dell'account utente
|
||||
Per modificare il livello di Controllo dell'account utente di Windows, sostituire il
|
||||
nodo requestedExecutionLevel con uno dei seguenti.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
Se si specifica l'elemento requestedExecutionLevel, la funzionalità Virtualizzazione file system e registro di sistema verrà disabilitata.
|
||||
Rimuovere questo elemento se l'applicazione richiede questa virtualizzazione per
|
||||
compatibilità con le versioni precedenti.
|
||||
-->
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- Elenco delle versioni di Windows in cui è stata testata questa applicazione e
|
||||
per cui è stato previsto l'uso. Rimuovere il commento dagli elementi appropriati per
|
||||
fare in modo che Windows selezioni automaticamente l'ambiente più compatibile. -->
|
||||
|
||||
<!-- Windows Vista -->
|
||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
||||
|
||||
<!-- Windows 7 -->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
|
||||
|
||||
<!-- Windows 8 -->
|
||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
|
||||
|
||||
<!-- Windows 8.1 -->
|
||||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
|
||||
|
||||
<!-- Windows 10 -->
|
||||
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
|
||||
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<!-- Indica che l'applicazione è sensibile ai valori DPI e non verrà scalata automaticamente da Windows in caso di
|
||||
valori DPI maggiori. Le applicazioni Windows Presentation Foundation (WPF) sono automaticamente sensibili ai valori DPI, pertanto non è necessario
|
||||
acconsentire esplicitamente. Con le applicazioni Windows Form destinate a .NET Framework 4.6 per cui è stato acconsentito esplicitamente a questa impostazione,
|
||||
è anche necessario impostare 'EnableWindowsFormsHighDpiAutoResizing' su 'true' nel relativo file app.config. -->
|
||||
<!--
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
-->
|
||||
|
||||
<!-- Abilita i temi per finestre di dialogo e controlli comuni di Windows (Windows XP e versioni successive) -->
|
||||
<!--
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
-->
|
||||
|
||||
</assembly>
|
||||
@@ -0,0 +1,43 @@
|
||||
<Grid x:Class="NewClientPageV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:LicenseManager="clr-namespace:LicenseManager"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
DataContext="{StaticResource NewClientPageVM}">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.ColumnSpan="2">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding NewClientMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<LicenseManager:ClientPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<Button Content="{Binding AddMsg}"
|
||||
Command="{Binding AddClient_Command}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class NewClientPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,166 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class NewClientPageVM
|
||||
Inherits ClientPageVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private Shadows m_Name As String
|
||||
Public Overloads Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If Not String.IsNullOrWhiteSpace(value) Then
|
||||
' Verifico se valore inserito già esistente
|
||||
Dim Query As String = "SELECT COUNT(" & DB_NAME & ") AS " & DB_MAXNUMBER & " FROM " & DB_CLIENT & " WHERE " & DB_NAME & " = '" & value & "'" ' COLLATE NOCASE"
|
||||
If ExecuteNumberQuery(Query) = 0 Then
|
||||
m_Name = value
|
||||
Else
|
||||
MessageBox.Show("Il cliente inserito esiste già!!")
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("Name")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ResellerList As List(Of Reseller)
|
||||
Public ReadOnly Property ResellerList As List(Of Reseller)
|
||||
Get
|
||||
Return m_ResellerList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelReseller As Reseller
|
||||
Public Property SelReseller As Reseller
|
||||
Get
|
||||
Return m_SelReseller
|
||||
End Get
|
||||
Set(value As Reseller)
|
||||
m_SelReseller = value
|
||||
NotifyPropertyChanged("SelReseller")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Email As String
|
||||
Public Property Email As String
|
||||
Get
|
||||
Return m_Email
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Email = value
|
||||
NotifyPropertyChanged("Email")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdAddClient As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NewClientMsg As String
|
||||
Get
|
||||
Return "New client"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AddMsg As String
|
||||
Get
|
||||
Return "Add"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitNewClientPage()
|
||||
' Svuoto campi
|
||||
m_Name = String.Empty
|
||||
NotifyPropertyChanged("Name")
|
||||
|
||||
m_Email = String.Empty
|
||||
NotifyPropertyChanged("Email")
|
||||
|
||||
' Carico lista Reseller
|
||||
Dim Query As String = "SELECT * FROM " & DB_RESELLER
|
||||
m_ResellerList = ManageDb.ExecuteResellerQuery(Query)
|
||||
NotifyPropertyChanged("ResellerList")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefNewClientPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "AddClient"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property AddClient_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddClient Is Nothing Then
|
||||
m_cmdAddClient = New Command(AddressOf AddClient)
|
||||
End If
|
||||
Return m_cmdAddClient
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub AddClient(ByVal param As Object)
|
||||
If Not String.IsNullOrWhiteSpace(Name) And
|
||||
Not String.IsNullOrWhiteSpace(Email) And
|
||||
Not IsNothing(SelReseller) Then
|
||||
' Aggiungo un rivenditore al Db
|
||||
Dim Query As String = "INSERT INTO " & DB_CLIENT & " (" & DB_NAME & ", " & DB_RESELLERID & ", " & DB_EMAIL & ")" &
|
||||
" VALUES ('" & m_Name & "', " &
|
||||
"'" & SelReseller.ResellerID & "', " &
|
||||
"'" & m_Email & "')"
|
||||
ManageDb.ExecuteQuery(Query)
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
Else
|
||||
MessageBox.Show("Completare tutti i campi presenti")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' AddClient
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,41 @@
|
||||
<Grid x:Class="NewKeyPageV"
|
||||
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"
|
||||
xmlns:LicenseManager="clr-namespace:LicenseManager"
|
||||
DataContext="{StaticResource NewKeyPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding NewKeyMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<LicenseManager:KeyPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<UniformGrid Grid.Row="2" Columns="2">
|
||||
<Button Content="{Binding AddMsg}"
|
||||
Command="{Binding AddKey_Command}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class NewKeyPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,196 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class NewKeyPageVM
|
||||
Inherits KeyPageVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private Shadows m_Number As Integer
|
||||
Public Overloads Property Number As String
|
||||
Get
|
||||
Return m_Number.ToString()
|
||||
End Get
|
||||
Set(value As String)
|
||||
If Not String.IsNullOrWhiteSpace(value) AndAlso Not Integer.TryParse(value, m_Number) Then m_Number = 0
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LockID As String
|
||||
Public Shadows Property LockID As String
|
||||
Get
|
||||
Return m_LockID
|
||||
End Get
|
||||
Set(value As String)
|
||||
' Se chiave software
|
||||
If (GetSelIsDongle() = 0) And Not String.IsNullOrWhiteSpace(value) Then
|
||||
' Verifico se valore inserito già esistente
|
||||
Dim Query As String = "SELECT COUNT(" & DB_LOCKID & ") AS " & DB_MAXNUMBER & " FROM " & DB_KEY & " WHERE " & DB_LOCKID & " = '" & value & "'"
|
||||
Dim MaxLockID As Integer = ExecuteNumberQuery(Query)
|
||||
If ExecuteNumberQuery(Query) = 0 Then
|
||||
m_LockID = value
|
||||
Else
|
||||
MessageBox.Show("Il numero di chiave inserito esiste già!!")
|
||||
m_LockID = ""
|
||||
MyBase.NotifyPropertyChanged("LockID")
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("LockID")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdAddKey As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NewKeyMsg As String
|
||||
Get
|
||||
Return "New key"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AddMsg As String
|
||||
Get
|
||||
Return "Add"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefNewKeyPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitNewKeyPage()
|
||||
|
||||
' Svuoto campi
|
||||
Number = Nothing
|
||||
NotifyPropertyChanged("Number")
|
||||
m_LockID = String.Empty
|
||||
NotifyPropertyChanged("LockID")
|
||||
|
||||
' Carico valore di default IsDongle
|
||||
SelIsDongle = 0
|
||||
|
||||
' Carico lista Client
|
||||
Dim Query As String = "SELECT * FROM " & DB_CLIENT
|
||||
SetClientList(ManageDb.ExecuteClientQuery(Query))
|
||||
NotifyPropertyChanged("ClientList")
|
||||
|
||||
' Carico valore di default State (InDeposito)
|
||||
SelState = 1
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "AddKey"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property AddKey_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddKey Is Nothing Then
|
||||
m_cmdAddKey = New Command(AddressOf AddKey)
|
||||
End If
|
||||
Return m_cmdAddKey
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub AddKey(ByVal param As Object)
|
||||
Dim Query As String = String.Empty
|
||||
' Se chiave hardware
|
||||
If (GetSelIsDongle() = 1) Then
|
||||
' Costruisco lockId
|
||||
Dim sCompleteNumber As String = m_Number.ToString("D6")
|
||||
Dim sCompleteChar As String = sCompleteNumber
|
||||
sCompleteChar = sCompleteChar.Replace("0"c, "o"c)
|
||||
sCompleteChar = sCompleteChar.Replace("1"c, "a"c)
|
||||
sCompleteChar = sCompleteChar.Replace("2"c, "b"c)
|
||||
sCompleteChar = sCompleteChar.Replace("3"c, "c"c)
|
||||
sCompleteChar = sCompleteChar.Replace("4"c, "d"c)
|
||||
sCompleteChar = sCompleteChar.Replace("5"c, "e"c)
|
||||
sCompleteChar = sCompleteChar.Replace("6"c, "f"c)
|
||||
sCompleteChar = sCompleteChar.Replace("7"c, "g"c)
|
||||
sCompleteChar = sCompleteChar.Replace("8"c, "h"c)
|
||||
sCompleteChar = sCompleteChar.Replace("9"c, "i"c)
|
||||
Dim CompleteChar() As Char = sCompleteChar.ToCharArray()
|
||||
For I = 0 To sCompleteChar.Count - 1
|
||||
If I Mod 2 = 1 Then
|
||||
CompleteChar(I) = Char.ToUpper(CompleteChar(I))
|
||||
Else
|
||||
CompleteChar(I) = Char.ToLower(CompleteChar(I))
|
||||
End If
|
||||
Next
|
||||
m_LockID = "EGTECH-" & sCompleteNumber & "-" & CompleteChar
|
||||
' Se chiave software
|
||||
Else
|
||||
' Recupero ultimo Number di chiave software usato
|
||||
Query = "SELECT MAX(" & DB_NUMBER & ") AS " & DB_MAXNUMBER & " FROM " & DB_KEY & " WHERE " & DB_ISDONGLE & " = 0"
|
||||
m_Number = ExecuteNumberQuery(Query)
|
||||
' Setto number
|
||||
m_Number += 1
|
||||
End If
|
||||
'Verifico che valore LockID si a valido
|
||||
If Not String.IsNullOrWhiteSpace(m_LockID) And
|
||||
Not IsNothing(SelClient) Then
|
||||
' Aggiungo un rivenditore al Db
|
||||
Dim dongleValue As Integer = 0
|
||||
If (GetSelIsDongle() = 0) Then dongleValue = 0
|
||||
If (GetSelIsDongle() = 1) Then dongleValue = 1
|
||||
Query = "INSERT INTO " & DB_KEY & " (" & DB_NUMBER & ", " & DB_CLIENTID & ", " & DB_ISDONGLE & ", " & DB_LOCKID & ", " & DB_STATE & ")" &
|
||||
" VALUES ('" & Number & "', " &
|
||||
" '" & SelClient.ClientID & "', " &
|
||||
" '" & dongleValue & "', " &
|
||||
" '" & m_LockID & "', " &
|
||||
" '" & SelState.ToString() & "')"
|
||||
ManageDb.ExecuteQuery(Query)
|
||||
Else
|
||||
MessageBox.Show("Completare i campi presenti")
|
||||
End If
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
End Sub
|
||||
|
||||
#End Region ' AddKey
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,190 @@
|
||||
<Grid x:Class="NewLicencePageV"
|
||||
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 NewLicencePageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding NewLicenceMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<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*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding ProductNameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding ProductList}"
|
||||
SelectedItem="{Binding SelProduct}"
|
||||
DisplayMemberPath="ProductName"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductVersionMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding VersionList}"
|
||||
SelectedItem="{Binding SelVersion}"
|
||||
DisplayMemberPath="VersionNumber"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductLevelMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding ProductLevel}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductDeadlineMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<DatePicker SelectedDate="{Binding ProductDeadline}"
|
||||
Height="30"
|
||||
Width="170"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"/>
|
||||
|
||||
<TextBlock Text="{Binding OptionDeadlineMsg}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<DatePicker SelectedDate="{Binding OptionDeadline}"
|
||||
Height="30"
|
||||
Width="170"
|
||||
Grid.Column="3"
|
||||
Grid.Row="0"/>
|
||||
|
||||
<TextBlock Text="{Binding IsDongleMsg}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding IsDongleList}"
|
||||
SelectedIndex="{Binding SelIsDongle}"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
Grid.Column="3"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding KeyNumberMsg}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<!--<EgtWPFLib5:EgtTextBox Text="{Binding Number}"
|
||||
Grid.Column="3"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParameterTextBox}"/>-->
|
||||
<ComboBox ItemsSource="{Binding NumberList}"
|
||||
SelectedItem="{Binding SelNumber}"
|
||||
DisplayMemberPath="Number"
|
||||
Grid.Column="3"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ClientNameMsg}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding ClientName}"
|
||||
Grid.Column="3"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<GroupBox Header="{Binding Option1Msg}"
|
||||
Grid.Row="4" Grid.ColumnSpan="4">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Option1}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsChecked}"
|
||||
Content="{Binding Msg}"
|
||||
IsEnabled="{Binding IsEnabled}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding Option2Msg}"
|
||||
Grid.Row="5" Grid.ColumnSpan="4">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Option2}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsChecked}"
|
||||
Content="{Binding Msg}"
|
||||
IsEnabled="{Binding IsEnabled}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
|
||||
<Button Content="{Binding GenerateMsg}"
|
||||
Command="{Binding Generate_Command}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="6"
|
||||
Grid.ColumnSpan="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="6"
|
||||
Grid.ColumnSpan="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class NewLicencePageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,544 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtWPFLib5
|
||||
Imports System.IO
|
||||
|
||||
Public Class NewLicencePageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_ProductLevel As String
|
||||
Public Property ProductLevel As String
|
||||
Get
|
||||
Return m_ProductLevel
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ProductLevel = value
|
||||
NotifyPropertyChanged("ProductLevel")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ClientName As String
|
||||
Public Property ClientName As String
|
||||
Get
|
||||
Return m_ClientName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ClientName = value
|
||||
NotifyPropertyChanged("ClientName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductList As List(Of Product)
|
||||
Public ReadOnly Property ProductList As List(Of Product)
|
||||
Get
|
||||
Return m_ProductList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProduct As Product
|
||||
Public Property SelProduct As Product
|
||||
Get
|
||||
Return m_SelProduct
|
||||
End Get
|
||||
Set(value As Product)
|
||||
m_SelProduct = value
|
||||
NotifyPropertyChanged("SelProduct")
|
||||
' Se valore non nullo
|
||||
If Not IsNothing(m_SelProduct) Then
|
||||
' Carico lista versioni
|
||||
Dim Query As String = "SELECT * FROM " & DB_VERSION & " WHERE " & DB_PRODUCTID & " = " & m_SelProduct.ProductID
|
||||
m_VersionList = ManageDb.ExecuteVersionQuery(Query)
|
||||
m_VersionList.Sort(Function(x, y) y.VersionNumber.CompareTo(x.VersionNumber))
|
||||
NotifyPropertyChanged("VersionList")
|
||||
' Carico lista numeri key
|
||||
Dim nQuery As String = "SELECT * FROM " & DB_KEY & " WHERE " & DB_ISDONGLE & " = " & m_SelIsDongle
|
||||
m_NumberList = ManageDb.ExecuteKeyQuery(nQuery)
|
||||
NotifyPropertyChanged("NumberList")
|
||||
' Carico opzioni1
|
||||
LoadOptions(1, m_Option1)
|
||||
LoadOptions(2, m_Option2)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_VersionList As List(Of Version)
|
||||
Public ReadOnly Property VersionList As List(Of Version)
|
||||
Get
|
||||
Return m_VersionList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelVersion As Version
|
||||
Public Property SelVersion As Version
|
||||
Get
|
||||
Return m_SelVersion
|
||||
End Get
|
||||
Set(value As Version)
|
||||
m_SelVersion = value
|
||||
NotifyPropertyChanged("SelVersion")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductDeadline As Nullable(Of Date)
|
||||
Public Property ProductDeadline As Nullable(Of Date)
|
||||
Get
|
||||
Return m_ProductDeadline
|
||||
End Get
|
||||
Set(value As Nullable(Of Date))
|
||||
m_ProductDeadline = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_OptionDeadline As Nullable(Of Date)
|
||||
Public Property OptionDeadline As Nullable(Of Date)
|
||||
Get
|
||||
Return m_OptionDeadline
|
||||
End Get
|
||||
Set(value As Nullable(Of Date))
|
||||
m_OptionDeadline = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsDongleList As New List(Of String)({"Hardware", "Software"})
|
||||
Public ReadOnly Property IsDongleList As List(Of String)
|
||||
Get
|
||||
Return m_IsDongleList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelIsDongle As Boolean
|
||||
Public Property SelIsDongle As Integer
|
||||
Get
|
||||
Return If(m_SelIsDongle, 0, 1)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value = 0 Then
|
||||
m_SelIsDongle = True
|
||||
Else
|
||||
m_SelIsDongle = False
|
||||
End If
|
||||
NotifyPropertyChanged("SelIsDongle")
|
||||
|
||||
If Not IsNothing(m_SelIsDongle) Then
|
||||
' Carico lista numeri key
|
||||
Dim nQuery As String = "SELECT * FROM " & DB_KEY & " WHERE " & DB_ISDONGLE & " = " & m_SelIsDongle
|
||||
m_NumberList = ManageDb.ExecuteKeyQuery(nQuery)
|
||||
End If
|
||||
NotifyPropertyChanged("NumberList")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Function GetSelIsDongle() As Boolean
|
||||
Return m_SelIsDongle
|
||||
End Function
|
||||
|
||||
'Private m_Number As Integer
|
||||
'Public Property Number As String
|
||||
' Get
|
||||
' Return m_Number.ToString()
|
||||
' End Get
|
||||
' Set(value As String)
|
||||
' If Not String.IsNullOrWhiteSpace(value) AndAlso Not Integer.TryParse(value, m_Number) Then m_Number = 0
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Private m_NumberList As List(Of Key)
|
||||
Public ReadOnly Property NumberList As List(Of Key)
|
||||
Get
|
||||
Return m_NumberList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelNumber As Key
|
||||
Public Property SelNumber As Key
|
||||
Get
|
||||
Return m_SelNumber
|
||||
End Get
|
||||
Set(value As Key)
|
||||
m_SelNumber = value
|
||||
NotifyPropertyChanged("SelNumber")
|
||||
' Se valore non nullo
|
||||
If Not IsNothing(m_SelNumber) Then
|
||||
' Carico cliente associato
|
||||
Dim Query As String = "SELECT * FROM " & DB_CLIENT & " INNER JOIN " & DB_KEY &
|
||||
" ON " & DB_CLIENT & "." & DB_CLIENTID & " = " & DB_KEY & "." & DB_CLIENTID &
|
||||
" WHERE " & DB_LOCKID & " = " & "'" & m_SelNumber.LockID & "'"
|
||||
m_ClientName = ManageDb.ExecuteStringQuery(Query, DB_NAME)(0)
|
||||
NotifyPropertyChanged("ClientName")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Option1 As New ObservableCollection(Of KeyOption)
|
||||
Public ReadOnly Property Option1 As ObservableCollection(Of KeyOption)
|
||||
Get
|
||||
Return m_Option1
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Option2 As New ObservableCollection(Of KeyOption)
|
||||
Public ReadOnly Property Option2 As ObservableCollection(Of KeyOption)
|
||||
Get
|
||||
Return m_Option2
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdGenerate As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NewLicenceMsg As String
|
||||
Get
|
||||
Return "New licence"
|
||||
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"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductLevelMsg As String
|
||||
Get
|
||||
Return "Product level"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductDeadlineMsg As String
|
||||
Get
|
||||
Return "Product deadline"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Option1Msg As String
|
||||
Get
|
||||
Return "Option 1"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Option2Msg As String
|
||||
Get
|
||||
Return "Option 2"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OptionDeadlineMsg As String
|
||||
Get
|
||||
Return "Option deadline"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsDongleMsg As String
|
||||
Get
|
||||
Return "Is dongle"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property KeyNumberMsg As String
|
||||
Get
|
||||
Return "Key number"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ClientNameMsg As String
|
||||
Get
|
||||
Return "Client name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GenerateMsg As String
|
||||
Get
|
||||
Return "Generate"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefNewLicencePageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitNewLicencePage()
|
||||
|
||||
' Svuoto campi
|
||||
SelVersion = Nothing
|
||||
ProductLevel = String.Empty
|
||||
ClientName = String.Empty
|
||||
SelNumber = Nothing
|
||||
|
||||
' Carico valore di default IsDongle
|
||||
SelIsDongle = 0
|
||||
|
||||
' Carico lista Product
|
||||
Dim Query As String
|
||||
Query = "SELECT * FROM " & DB_PRODUCT
|
||||
m_ProductList = ManageDb.ExecuteProductQuery(Query)
|
||||
NotifyPropertyChanged("ProductList")
|
||||
|
||||
' Cancello liste opzioni
|
||||
m_Option1.Clear()
|
||||
m_Option2.Clear()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadOptions(nIndex As Integer, OptionList As ObservableCollection(Of KeyOption))
|
||||
' Cancello opzioni
|
||||
OptionList.Clear()
|
||||
' Carico opzioni
|
||||
Dim OptionIndex As Integer = 1
|
||||
Dim OptionName As String = String.Empty
|
||||
GetMainPrivateProfileString(m_SelProduct.ProductName & " - Option" & nIndex, "Option" & OptionIndex, "", OptionName)
|
||||
While Not String.IsNullOrWhiteSpace(OptionName)
|
||||
OptionList.Add(New KeyOption(False, True, OptionName))
|
||||
OptionIndex += 1
|
||||
GetMainPrivateProfileString(m_SelProduct.ProductName & " - Option" & nIndex, "Option" & OptionIndex, "", OptionName)
|
||||
End While
|
||||
' Se ho caricato delle opzioni
|
||||
If OptionList.Count > 0 Then
|
||||
' Verifico se ci sono opzioni del prodotto
|
||||
Dim ProductOption As Integer = If(nIndex = 1, m_SelProduct.ProductOption1, m_SelProduct.ProductOption2)
|
||||
Dim nBinaryIndex As Integer = 1
|
||||
For I = 0 To 15
|
||||
If (ProductOption And nBinaryIndex) <> 0 Then
|
||||
OptionList(I).IsChecked = True
|
||||
OptionList(I).IsEnabled = False
|
||||
End If
|
||||
nBinaryIndex *= 2
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CalcOptionDec(OptionList As ObservableCollection(Of KeyOption)) As Integer
|
||||
Dim nDecOption As Integer = 0
|
||||
Dim nBinaryIndex As Integer = 1
|
||||
For I As Integer = 0 To OptionList.Count() - 1
|
||||
If OptionList(I).IsChecked Then
|
||||
nDecOption += nBinaryIndex
|
||||
End If
|
||||
nBinaryIndex *= 2
|
||||
Next
|
||||
Return nDecOption
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Generate"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Generate_Command As ICommand
|
||||
Get
|
||||
If m_cmdGenerate Is Nothing Then
|
||||
m_cmdGenerate = New Command(AddressOf Generate)
|
||||
End If
|
||||
Return m_cmdGenerate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Generate(ByVal param As Object)
|
||||
If Not IsNothing(SelNumber) And Not IsNothing(m_Option1) And Not IsNothing(m_Option2) And
|
||||
Not IsNothing(m_SelProduct) And Not IsNothing(m_SelVersion) And Not IsNothing(m_ProductLevel) And
|
||||
Not IsNothing(m_ProductDeadline) And Not IsNothing(m_OptionDeadline) Then
|
||||
'Cerco LockID associato alla chiave
|
||||
Dim Query As String = "SELECT " & DB_LOCKID & " FROM " & DB_KEY & " WHERE " & DB_NUMBER & " = " & SelNumber.Number & " AND " & DB_ISDONGLE & " = " & If(GetSelIsDongle(), 1, 0)
|
||||
Dim LockID As String = ManageDb.ExecuteStringQuery(Query, DB_LOCKID)(0)
|
||||
If Not LockID.Equals(String.Empty) Then
|
||||
' Calcolo valore decimale opzione1
|
||||
Dim nDecOption1 As Integer = CalcOptionDec(m_Option1)
|
||||
Dim nDecOption2 As Integer = CalcOptionDec(m_Option2)
|
||||
'' Aggiungo una licenza al Db
|
||||
'Query = "INSERT INTO " & DB_LICENCE & " (" & DB_PRODUCTID & ", " & DB_PRODUCTVERSION & ", " & DB_PRODUCTLEVEL & ", " & DB_PRODUCTDEADLINE & ", " & DB_OPTION1 & ", " & DB_OPTION2 & ", " & DB_OPTIONDEADLINE & ", " & DB_LOCKID & ", " & DB_FILE & ")" &
|
||||
' " VALUES ('" & m_SelProduct.ProductID & "', " &
|
||||
' "'" & m_SelVersion.VersionNumber & "', " & ' "'" & m_SelVersion.VersionID & "', " &
|
||||
' "'" & m_ProductLevel & "', " &
|
||||
' "Date('" & (String.Format("{0:yyyy-MM-dd}", ProductDeadline)) & "'), " &
|
||||
' "'" & nDecOption1 & "', " &
|
||||
' "'" & nDecOption2 & "', " &
|
||||
' "Date('" & (String.Format("{0:yyyy-MM-dd}", OptionDeadline)) & "'), " &
|
||||
' "'" & LockID & "', " &
|
||||
' "'" & m_ClientName & "')" ' SISTEMARE CON NOME FILE
|
||||
'ManageDb.ExecuteQuery(Query)
|
||||
|
||||
'' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
'Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
|
||||
'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
|
||||
|
||||
'Cerco ClientID associato alla chiave scelta
|
||||
Query = "SELECT " & DB_CLIENTID & " FROM " & DB_KEY & " WHERE " & DB_LOCKID & " = '" & LockID & "'"
|
||||
Dim ClientID As Integer = ManageDb.ExecuteIntegerQuery(Query, DB_CLIENTID)(0)
|
||||
'Cerco NameClient associato a ClientID
|
||||
Query = "SELECT " & DB_NAME & " FROM " & DB_CLIENT & " WHERE " & DB_CLIENTID & " = " & ClientID
|
||||
Dim NameResult As List(Of String) = ManageDb.ExecuteStringQuery(Query, DB_NAME)
|
||||
If NameResult.Count > 0 Then
|
||||
Dim m_NameClient As String = NameResult(0)
|
||||
'Apro 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"))
|
||||
If (GetSelIsDongle()) Then
|
||||
StringFile.Add("Customer=Key-" & SelNumber.Number.ToString("D6")) ' & "-" & m_NameClient & "-" & SelProduct.ProductName)
|
||||
Else
|
||||
StringFile.Add("Customer=Soft-" & SelNumber.Number.ToString("D6")) ' SISTEMARE CON NUMERO PROGRESSIVO
|
||||
End If
|
||||
StringFile.Add("LockID=" & LockID)
|
||||
StringFile.Add("ClearLockId=")
|
||||
StringFile.Add("Product=" & SelProduct.ProductNumber)
|
||||
StringFile.Add("Ver=" & SelVersion.VersionNumber) ' & SelVersion.VersionID)
|
||||
StringFile.Add("Lev=" & ProductLevel)
|
||||
StringFile.Add("ExpDays=" & DayProductDeadline)
|
||||
StringFile.Add("Opt1=" & nDecOption1)
|
||||
StringFile.Add("Opt2=" & nDecOption2)
|
||||
StringFile.Add("OptExpDays=" & DayOptionDeadline)
|
||||
Dim fileName As String
|
||||
If (GetSelIsDongle()) Then
|
||||
fileName = "C:\EgtProg\Key-" & SelNumber.Number.ToString("D6") & "-" & SelProduct.ProductName & ".Kge"
|
||||
Else
|
||||
fileName = "C:\EgtProg\Soft-" & SelNumber.Number.ToString("D6") & "-" & SelProduct.ProductName & ".Kge" ' SISTEMARE CON NUMERO PROGRESSIVO
|
||||
End If
|
||||
IO.File.WriteAllLines(fileName, StringFile, Text.Encoding.UTF8)
|
||||
|
||||
' Process.Start("C:\Program Files\Notepad++\notepad++.exe", fileName)
|
||||
Dim proc As Process = Process.Start("C:\EgtProg\KeyGenerator\KeyGeneratorR32.exe", fileName)
|
||||
|
||||
'MessageBox.Show("DA INSERIRE: " & Constants.vbCrLf &
|
||||
' " -Numero Prodotto: " & m_SelProduct.ProductNumber & Constants.vbCrLf &
|
||||
' " -Numero Versione: " & m_SelVersion.VersionNumber)
|
||||
|
||||
' Attendo il termine del processo
|
||||
While (Not proc.HasExited)
|
||||
proc.Refresh()
|
||||
System.Threading.Thread.Sleep(50)
|
||||
End While
|
||||
|
||||
Dim ask As MsgBoxResult = MsgBox("Licenza generata correttamente?", MsgBoxStyle.YesNo)
|
||||
If ask = MsgBoxResult.Yes Then
|
||||
' Aggiungo una licenza al Db
|
||||
Query = "INSERT INTO " & DB_LICENCE & " (" & DB_PRODUCTID & ", " & DB_PRODUCTVERSION & ", " & DB_PRODUCTLEVEL & ", " & DB_PRODUCTDEADLINE & ", " & DB_OPTION1 & ", " & DB_OPTION2 & ", " & DB_OPTIONDEADLINE & ", " & DB_LOCKID & ", " & DB_FILE & ")" &
|
||||
" VALUES ('" & m_SelProduct.ProductID & "', " &
|
||||
"'" & m_SelVersion.VersionNumber & "', " & ' "'" & m_SelVersion.VersionID & "', " &
|
||||
"'" & m_ProductLevel & "', " &
|
||||
"Date('" & (String.Format("{0:yyyy-MM-dd}", ProductDeadline)) & "'), " &
|
||||
"'" & nDecOption1 & "', " &
|
||||
"'" & nDecOption2 & "', " &
|
||||
"Date('" & (String.Format("{0:yyyy-MM-dd}", OptionDeadline)) & "'), " &
|
||||
"'" & LockID & "', " &
|
||||
"'" & fileName.Replace("\", "\\") & "')" ' SISTEMARE CON NOME FILE
|
||||
ManageDb.ExecuteQuery(Query)
|
||||
End If
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
|
||||
Else
|
||||
MessageBox.Show("Errore")
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show("Il Number Key corrispondente non esiste")
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show("Completare i campi presenti")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Generate
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class KeyOption
|
||||
Inherits VMBase
|
||||
|
||||
Private m_IsChecked As Boolean
|
||||
Public Property IsChecked As Boolean
|
||||
Get
|
||||
Return m_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsChecked = value
|
||||
NotifyPropertyChanged("IsChecked")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsEnabled As Boolean
|
||||
Public Property IsEnabled As Boolean
|
||||
Get
|
||||
Return m_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsEnabled = value
|
||||
NotifyPropertyChanged("IsEnabled")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Msg As String
|
||||
Public ReadOnly Property Msg As String
|
||||
Get
|
||||
Return m_Msg
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(bIsChecked As Boolean, bIsEnabled As Boolean, sMsg As String)
|
||||
m_IsChecked = bIsChecked
|
||||
m_IsEnabled = bIsEnabled
|
||||
m_Msg = sMsg
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
<Grid x:Class="NewProductPageV"
|
||||
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 NewProductPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding NewProductMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</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*"/>
|
||||
</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}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductNumberMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding ProductNumber}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductOption1Msg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding ProductOption1}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductOption2Msg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding ProductOption2}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<Button Content="{Binding AddMsg}"
|
||||
Command="{Binding AddProduct_Command}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="4"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,5 @@
|
||||
Public Class NewProductPageV
|
||||
Private Sub ComboBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
@@ -0,0 +1,205 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class NewProductPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_ProductName As String
|
||||
Public Property ProductName As String
|
||||
Get
|
||||
Return m_ProductName
|
||||
End Get
|
||||
Set(value As String)
|
||||
If Not String.IsNullOrWhiteSpace(value) Then
|
||||
' Verifico se valore inserito già esistente
|
||||
Dim Query As String = "SELECT COUNT(" & DB_PRODUCTNAME & ") AS " & DB_MAXNUMBER & " FROM " & DB_PRODUCT & " WHERE " & DB_PRODUCTNAME & " = '" & value & "'" ' COLLATE NOCASE"
|
||||
If ExecuteNumberQuery(Query) = 0 Then
|
||||
m_ProductName = value
|
||||
Else
|
||||
MessageBox.Show("Il nome del prodotto inserito esiste già!!")
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("ProductName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductNumber As String
|
||||
Public Property ProductNumber As String
|
||||
Get
|
||||
Return m_ProductNumber
|
||||
End Get
|
||||
Set(value As String)
|
||||
If Not String.IsNullOrWhiteSpace(value) Then
|
||||
' Verifico se valore inserito già esistente
|
||||
Dim Query As String = "SELECT COUNT(" & DB_PRODUCTNUMBER & ") AS " & DB_MAXNUMBER & " FROM " & DB_PRODUCT & " WHERE " & DB_PRODUCTNUMBER & " = '" & value & "'" ' COLLATE NOCASE"
|
||||
If ExecuteNumberQuery(Query) = 0 Then
|
||||
m_ProductNumber = value
|
||||
Else
|
||||
MessageBox.Show("Il numero del prodotto inserito esiste già!!")
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("ProductNumber")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductOption1 As String
|
||||
Public Property ProductOption1 As String
|
||||
Get
|
||||
Return m_ProductOption1
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ProductOption1 = value
|
||||
NotifyPropertyChanged("ProductOption1")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductOption2 As String
|
||||
Public Property ProductOption2 As String
|
||||
Get
|
||||
Return m_ProductOption2
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ProductOption2 = value
|
||||
NotifyPropertyChanged("ProductOption2")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdAddProduct As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NewProductMsg As String
|
||||
Get
|
||||
Return "New product"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductNameMsg As String
|
||||
Get
|
||||
Return "Name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductNumberMsg As String
|
||||
Get
|
||||
Return "Number"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductOption1Msg As String
|
||||
Get
|
||||
Return "Option 1"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductOption2Msg As String
|
||||
Get
|
||||
Return "Option 2"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AddMsg As String
|
||||
Get
|
||||
Return "Add"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefNewProductPageVM(Me)
|
||||
End Sub
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitNewProductPage()
|
||||
|
||||
' Svuoto campi
|
||||
ProductName = String.Empty
|
||||
NotifyPropertyChanged("ProductName")
|
||||
ProductNumber = String.Empty
|
||||
NotifyPropertyChanged("ProductNumber")
|
||||
ProductOption1 = String.Empty
|
||||
NotifyPropertyChanged("ProductOption1")
|
||||
ProductOption2 = String.Empty
|
||||
NotifyPropertyChanged("ProductOption2")
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "AddProduct"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property AddProduct_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddProduct Is Nothing Then
|
||||
m_cmdAddProduct = New Command(AddressOf AddProduct)
|
||||
End If
|
||||
Return m_cmdAddProduct
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub AddProduct(ByVal param As Object)
|
||||
If Not String.IsNullOrWhiteSpace(ProductName) And
|
||||
Not String.IsNullOrWhiteSpace(ProductNumber) And
|
||||
Not String.IsNullOrWhiteSpace(ProductOption1) And
|
||||
Not String.IsNullOrWhiteSpace(ProductOption2) Then
|
||||
' Aggiungo un rivenditore al Db
|
||||
Dim Query As String = "INSERT INTO " & DB_PRODUCT & " (" & DB_PRODUCTNAME & ", " & DB_PRODUCTNUMBER & "," & DB_PRODUCTOPTION1 & ", " & DB_PRODUCTOPTION2 & ")" &
|
||||
" VALUES ('" & m_ProductName & "', " &
|
||||
"'" & m_ProductNumber & "', " &
|
||||
"'" & m_ProductOption1 & "', " &
|
||||
"'" & m_ProductOption2 & "')"
|
||||
ManageDb.ExecuteQuery(Query)
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
Else
|
||||
MessageBox.Show("Completare tutti i campi presenti")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' AddProduct
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,56 @@
|
||||
<Grid x:Class="NewResellerPageV"
|
||||
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 NewResellerPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding NewResellerMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding NameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Name}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<Button Content="{Binding AddMsg}"
|
||||
Command="{Binding AddReseller_Command}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class NewResellerPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,134 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class NewResellerPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If Not String.IsNullOrWhiteSpace(value) Then
|
||||
' Verifico se valore inserito già esistente
|
||||
Dim Query As String = "SELECT COUNT(" & DB_RESELLERNAME & ") AS " & DB_MAXNUMBER & " FROM " & DB_RESELLER & " WHERE " & DB_RESELLERNAME & " = '" & value & "'" ' COLLATE NOCASE"
|
||||
If ExecuteNumberQuery(Query) = 0 Then
|
||||
m_Name = value
|
||||
Else
|
||||
MessageBox.Show("Il Rivenditore inserito esiste già!!")
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("Name")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdAddReseller As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NewResellerMsg As String
|
||||
Get
|
||||
Return "New reseller"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property NameMsg As String
|
||||
Get
|
||||
Return "Name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AddMsg As String
|
||||
Get
|
||||
Return "Add"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefNewResellerPageVM(Me)
|
||||
End Sub
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitNewResellerPage()
|
||||
' Svuoto campi
|
||||
Name = String.Empty
|
||||
NotifyPropertyChanged("Name")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "AddReseller"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property AddReseller_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddReseller Is Nothing Then
|
||||
m_cmdAddReseller = New Command(AddressOf AddReseller)
|
||||
End If
|
||||
Return m_cmdAddReseller
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub AddReseller(ByVal param As Object)
|
||||
If Not String.IsNullOrWhiteSpace(Name) Then
|
||||
' Aggiungo un rivenditore al Db
|
||||
Dim Query As String = "INSERT INTO " & DB_RESELLER & " (" & DB_RESELLERNAME & ")" &
|
||||
" VALUES ('" & m_Name & "')"
|
||||
ManageDb.ExecuteQuery(Query)
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
Else
|
||||
MessageBox.Show("Completare il campo presente")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' AddReseller
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,37 @@
|
||||
<Grid x:Class="NewVersionPageV"
|
||||
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 NewVersionPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.ColumnSpan="2">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding NewVersionMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<LicenseManager:VersionPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<UniformGrid Grid.Row="3" Columns="2">
|
||||
<Button Content="{Binding AddMsg}"
|
||||
Command="{Binding AddVersion_Command}"
|
||||
IsDefault="True"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class NewVersionPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,97 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class NewVersionPageVM
|
||||
Inherits VersionPageVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdAddVersion As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NewVersionMsg As String
|
||||
Get
|
||||
Return "New version"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AddMsg As String
|
||||
Get
|
||||
Return "Add"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefNewVersionPageVM(Me)
|
||||
End Sub
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "AddVersion"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property AddVersion_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddVersion Is Nothing Then
|
||||
m_cmdAddVersion = New Command(AddressOf AddVersion)
|
||||
End If
|
||||
Return m_cmdAddVersion
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub AddVersion(ByVal param As Object)
|
||||
|
||||
' Aggiungo un rivenditore al Db
|
||||
Dim Query As String = "INSERT INTO " & DB_VERSION & " (" & DB_VERSIONNUMBER & ", " & DB_PRODUCTID & ")" &
|
||||
" VALUES ('" & VersionNumber & "', " &
|
||||
"'" & SelProduct.ProductID & "')"
|
||||
ManageDb.ExecuteQuery(Query)
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' AddVersion
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,61 @@
|
||||
<Grid x:Class="SearchClientPageV"
|
||||
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}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.ColumnSpan="2">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding SearchClientMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<LicenseManager:ClientPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="2">
|
||||
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="Name"
|
||||
Binding="{Binding Name, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Reseller Name"
|
||||
Binding="{Binding ResellerName, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="E-mail address"
|
||||
Binding="{Binding Email, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
<UniformGrid Grid.Row="3" Columns="3">
|
||||
<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}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class SearchClientPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,227 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Data.SQLite
|
||||
Imports EgtWPFLib5
|
||||
Imports MySql.Data.MySqlClient
|
||||
|
||||
Public Class SearchClientPageVM
|
||||
Inherits ClientPageVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_SelSearchResult As SearchClient
|
||||
Public Property SelSearchResult As SearchClient
|
||||
Get
|
||||
Return m_SelSearchResult
|
||||
End Get
|
||||
Set(value As SearchClient)
|
||||
m_SelSearchResult = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SearchResult As ObservableCollection(Of SearchClient)
|
||||
Public ReadOnly Property SearchResult As ObservableCollection(Of SearchClient)
|
||||
Get
|
||||
Return m_SearchResult
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ResellerList As List(Of Reseller)
|
||||
Public ReadOnly Property ResellerList As List(Of Reseller)
|
||||
Get
|
||||
Return m_ResellerList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelReseller As Reseller
|
||||
Public Property SelReseller As Reseller
|
||||
Get
|
||||
Return m_SelReseller
|
||||
End Get
|
||||
Set(value As Reseller)
|
||||
m_SelReseller = value
|
||||
NotifyPropertyChanged("SelReseller")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSearch As Command
|
||||
Private m_cmdCancel As Command
|
||||
Private m_cmdUpdate As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SearchClientMsg As String
|
||||
Get
|
||||
Return "Search client"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SearchMsg As String
|
||||
Get
|
||||
Return "Search"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefSearchClientPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitSearchClientPage()
|
||||
MyBase.InitClientPage()
|
||||
|
||||
' Carico lista Reseller
|
||||
Dim Query As String = "SELECT * FROM " & DB_RESELLER
|
||||
m_ResellerList = ManageDb.ExecuteResellerQuery(Query)
|
||||
NotifyPropertyChanged("ResellerList")
|
||||
|
||||
m_SearchResult = New ObservableCollection(Of SearchClient)()
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Search"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchClient_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearch Is Nothing Then
|
||||
m_cmdSearch = New Command(AddressOf Search)
|
||||
End If
|
||||
Return m_cmdSearch
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Search(ByVal param As Object)
|
||||
' Cerco nella tabella Client
|
||||
Dim Query As String = "SELECT * FROM " & DB_CLIENT & " INNER JOIN " & DB_RESELLER &
|
||||
" ON " & DB_CLIENT & "." & DB_RESELLERID & " = " & DB_RESELLER & "." & DB_RESELLERID & " "
|
||||
Dim bFirstWhere As Boolean = True
|
||||
If Not String.IsNullOrWhiteSpace(Name) OrElse
|
||||
Not String.IsNullOrWhiteSpace(Email) OrElse
|
||||
Not IsNothing(SelReseller) Then
|
||||
Query &= "WHERE "
|
||||
If Not String.IsNullOrWhiteSpace(Name) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_NAME & " LIKE '" & Name & "%' "
|
||||
End If
|
||||
If Not IsNothing(SelReseller) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_RESELLERNAME & " LIKE '" & SelReseller.ResellerName & "%' "
|
||||
End If
|
||||
If Not IsNothing(Email) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_EMAIL & " LIKE '" & Email & "%' "
|
||||
End If
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
End If
|
||||
m_SearchResult = New ObservableCollection(Of SearchClient)(ManageDb.ExecuteSearchClientQuery(Query))
|
||||
If (m_SearchResult.Count = 0) Then
|
||||
MessageBox.Show("Nessun risultato per i filtri impostati")
|
||||
End If
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
Private Sub EvalWhere(ByRef bFirst As Boolean, ByRef Query As String)
|
||||
If bFirst Then
|
||||
bFirst = False
|
||||
Else
|
||||
Query &= " AND "
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Search
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateClient_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
If Not IsNothing(m_SelSearchResult) Then
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refUpdateClientPageVM.IdToUpdate = m_SelSearchResult.ClientID
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATECLIENT
|
||||
Else
|
||||
MessageBox.Show("Non è stato selezionato nessun cliente")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Public Class SearchClient
|
||||
Inherits Client
|
||||
|
||||
Private m_ResellerName As String
|
||||
Public ReadOnly Property ResellerName As String
|
||||
Get
|
||||
Return m_ResellerName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(ClientReader As MySqlDataReader)
|
||||
MyBase.New(ClientReader)
|
||||
m_ResellerName = CType(ClientReader(DB_RESELLERNAME), String)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,67 @@
|
||||
<Grid x:Class="SearchKeyPageV"
|
||||
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}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.ColumnSpan="2">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding SearchKeyMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<LicenseManager:KeyPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="2">
|
||||
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="Number"
|
||||
Binding="{Binding Number, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Client Name"
|
||||
Binding="{Binding ClientName, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Is Dongle"
|
||||
Binding="{Binding IsDongle, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="LockID"
|
||||
Binding="{Binding LockID, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="State"
|
||||
Binding="{Binding State, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<UniformGrid Grid.Row="3" Columns="3">
|
||||
<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}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class SearchKeyPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,265 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Data.SQLite
|
||||
Imports EgtWPFLib5
|
||||
Imports MySql.Data.MySqlClient
|
||||
|
||||
Public Class SearchKeyPageVM
|
||||
Inherits KeyPageVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_SelSearchResult As SearchKey
|
||||
Public Property SelSearchResult As SearchKey
|
||||
Get
|
||||
Return m_SelSearchResult
|
||||
End Get
|
||||
Set(value As SearchKey)
|
||||
m_SelSearchResult = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Number As Integer
|
||||
Public Property Number As String
|
||||
Get
|
||||
Return If(m_Number <> 0, m_Number.ToString(), "")
|
||||
End Get
|
||||
Set(value As String)
|
||||
If Not String.IsNullOrWhiteSpace(value) Then
|
||||
If Not Integer.TryParse(value, m_Number) Then
|
||||
m_Number = Nothing
|
||||
End If
|
||||
Else
|
||||
m_Number = Nothing
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SearchResult As ObservableCollection(Of SearchKey)
|
||||
Public ReadOnly Property SearchResult As ObservableCollection(Of SearchKey)
|
||||
Get
|
||||
Return m_SearchResult
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_StateList As New List(Of String)({" ", "Consegnata", "InDeposito", "Guasta", "---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
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetStateList(value As List(Of String)) ' Key.KeyState))
|
||||
m_StateList = value
|
||||
End Sub
|
||||
|
||||
Private m_SelState As Key.KeyState
|
||||
Public Property SelState As String
|
||||
Get
|
||||
Return m_SelState.ToString()
|
||||
End Get
|
||||
Set(value As String) ' Key.KeyState)
|
||||
'm_SelState = value
|
||||
If (value.Equals(" ")) Then m_SelState = Nothing
|
||||
If (value.Equals("Consegnata")) Then m_SelState = Key.KeyState.Consegnata
|
||||
If (value.Equals("InDeposito")) Then m_SelState = Key.KeyState.InDeposito
|
||||
If (value.Equals("Guasta")) Then m_SelState = Key.KeyState.Guasta
|
||||
If (value.Equals("---ANY---")) Then m_SelState = Key.KeyState.ANY
|
||||
NotifyPropertyChanged("SelState")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSearch As Command
|
||||
Private m_cmdCancel As Command
|
||||
Private m_cmdUpdate As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SearchKeyMsg As String
|
||||
Get
|
||||
Return "Search key"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SearchMsg As String
|
||||
Get
|
||||
Return "Search"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
MyBase.New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefSearchKeyPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitSearchKeyPage()
|
||||
MyBase.InitKeyPage()
|
||||
' Svuoto campi
|
||||
m_Number = 0
|
||||
NotifyPropertyChanged("Number")
|
||||
m_SearchResult = New ObservableCollection(Of SearchKey)()
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
m_SelState = Key.KeyState.ANY
|
||||
NotifyPropertyChanged("SelState")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Search"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchKey_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearch Is Nothing Then
|
||||
m_cmdSearch = New Command(AddressOf Search)
|
||||
End If
|
||||
Return m_cmdSearch
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Search(ByVal param As Object)
|
||||
' Cerco nella tabella Key
|
||||
Dim Query As String = "SELECT * FROM " & DB_KEY & " INNER JOIN " & DB_CLIENT & " ON " & DB_KEY & "." & DB_CLIENTID & " = " & DB_CLIENT & "." & DB_CLIENTID & " "
|
||||
Dim bFirstWhere As Boolean = True
|
||||
If Not String.IsNullOrWhiteSpace(Number) OrElse
|
||||
Not IsNothing(SelClient) OrElse
|
||||
Not IsNothing(SelIsDongle) OrElse
|
||||
Not IsNothing(SelState) OrElse
|
||||
Not String.IsNullOrWhiteSpace(LockID) Then
|
||||
Query &= "WHERE "
|
||||
If Not IsNothing(SelIsDongle) And Not (SelIsDongle > 1) Then ' If Not IsNothing(SelIsDongle) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_ISDONGLE & " = "
|
||||
If (GetSelIsDongle() = 1) Then Query &= 1 & " " Else Query &= 0 & " "
|
||||
End If
|
||||
If m_Number <> 0 Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_NUMBER & " LIKE '%" & Number & "%' "
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(LockID) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_LOCKID & " LIKE '%" & LockID & "%' "
|
||||
End If
|
||||
If Not IsNothing(SelClient) Then
|
||||
If Not SelClient.Name.Equals("---ANY---") Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_NAME & " LIKE '" & SelClient.Name & "%' "
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(SelState) And Not SelState.Equals(Key.KeyState.ANY.ToString()) Then ' If Not IsNothing(SelState) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_STATE & " LIKE '" & SelState.ToString() & "%' "
|
||||
End If
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
Dim suffixToRemove As String = " WHERE"
|
||||
If Not IsNothing(Query) And Not IsNothing(suffixToRemove) And Query.EndsWith(suffixToRemove) Then
|
||||
Query = Query.Substring(0, Query.Length - suffixToRemove.Length)
|
||||
End If
|
||||
End If
|
||||
m_SearchResult = New ObservableCollection(Of SearchKey)(ManageDb.ExecuteSearchKeyQuery(Query))
|
||||
If (m_SearchResult.Count = 0) Then
|
||||
MessageBox.Show("Nessun risultato per i filtri impostati")
|
||||
End If
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
Private Sub EvalWhere(ByRef bFirst As Boolean, ByRef Query As String)
|
||||
If bFirst Then
|
||||
bFirst = False
|
||||
Else
|
||||
Query &= " AND "
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Search
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateKey_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
If Not IsNothing(m_SelSearchResult) Then
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATEKEY
|
||||
Map.refUpdateKeyPageVM.Key = m_SelSearchResult
|
||||
Else
|
||||
MessageBox.Show("Non è stata selezionata nessuna chiave")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class SearchKey
|
||||
Inherits Key
|
||||
|
||||
Private m_ClientName As String
|
||||
Public ReadOnly Property ClientName As String
|
||||
Get
|
||||
Return m_ClientName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(ClientReader As MySqlDataReader)
|
||||
MyBase.New(ClientReader)
|
||||
m_ClientName = CType(ClientReader(DB_NAME), String)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,211 @@
|
||||
<Grid x:Class="SearchLicencePageV"
|
||||
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}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding SearchLicenceMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<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*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding ProductNameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding ProductList}"
|
||||
SelectedItem="{Binding SelProduct}"
|
||||
DisplayMemberPath="ProductName"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductVersionMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding VersionList}"
|
||||
SelectedItem="{Binding SelVersion}"
|
||||
DisplayMemberPath="VersionNumber"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductLevelMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding ProductLevelList}"
|
||||
SelectedItem="{Binding SelProductLevel}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductDeadlineMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<DatePicker SelectedDate="{Binding ProductDeadline}"
|
||||
Height="30"
|
||||
Width="170"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"/>
|
||||
|
||||
<TextBlock Text="{Binding OptionDeadlineMsg}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<DatePicker SelectedDate="{Binding OptionDeadline}"
|
||||
Height="30"
|
||||
Width="170"
|
||||
Grid.Column="3"
|
||||
Grid.Row="0"/>
|
||||
|
||||
<TextBlock Text="{Binding LockIDMsg}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding LockID}"
|
||||
Grid.Column="3"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding FileMsg}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding File}"
|
||||
Grid.Column="3"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<GroupBox Header="{Binding Option1Msg}"
|
||||
Grid.Row="4" Grid.ColumnSpan="4">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Option1}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsChecked}"
|
||||
Content="{Binding Msg}"
|
||||
IsEnabled="{Binding IsEnabled}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding Option2Msg}"
|
||||
Grid.Row="5" Grid.ColumnSpan="4">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Option2}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsChecked}"
|
||||
Content="{Binding Msg}"
|
||||
IsEnabled="{Binding IsEnabled}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="6"
|
||||
Grid.ColumnSpan="4">
|
||||
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="ProductName"
|
||||
Binding="{Binding ProductName, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="ProductVersion"
|
||||
Binding="{Binding ProductVersion, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="ProductLevel"
|
||||
Binding="{Binding ProductLevel, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Option 1"
|
||||
Binding="{Binding Option1, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Option 2"
|
||||
Binding="{Binding Option2, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="LockID"
|
||||
Binding="{Binding Number, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="File"
|
||||
Binding="{Binding File, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<UniformGrid Grid.Row="7" Grid.ColumnSpan="4" Columns="3">
|
||||
<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 UpdateMsg}"
|
||||
Command="{Binding Update_Command}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class SearchLicencePageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,473 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Data.SQLite
|
||||
Imports EgtWPFLib5
|
||||
Imports MySql.Data.MySqlClient
|
||||
|
||||
Public Class SearchLicencePageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_SelSearchResult As Licence
|
||||
Public Property SelSearchResult As Licence
|
||||
Get
|
||||
Return m_SelSearchResult
|
||||
End Get
|
||||
Set(value As Licence)
|
||||
m_SelSearchResult = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductLevelList As List(Of String)
|
||||
Public ReadOnly Property ProductLevelList As List(Of String)
|
||||
Get
|
||||
Return m_ProductLevelList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProductLevel As String
|
||||
Public Property SelProductLevel As String
|
||||
Get
|
||||
Return m_SelProductLevel
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelProductLevel = value
|
||||
NotifyPropertyChanged("SelProductLevel")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_File As String
|
||||
Public Property File As String
|
||||
Get
|
||||
Return m_File
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_File = value
|
||||
NotifyPropertyChanged("File")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductList As List(Of Product)
|
||||
Public ReadOnly Property ProductList As List(Of Product)
|
||||
Get
|
||||
Return m_ProductList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProduct As Product
|
||||
Public Property SelProduct As Product
|
||||
Get
|
||||
Return m_SelProduct
|
||||
End Get
|
||||
Set(value As Product)
|
||||
m_SelProduct = value
|
||||
NotifyPropertyChanged("SelProduct")
|
||||
' Carico opzioni1
|
||||
LoadOptions(1, m_Option1)
|
||||
LoadOptions(2, m_Option2)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_VersionList As List(Of Version)
|
||||
Public ReadOnly Property VersionList As List(Of Version)
|
||||
Get
|
||||
Return m_VersionList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelVersion As Version
|
||||
Public Property SelVersion As Version
|
||||
Get
|
||||
Return m_SelVersion
|
||||
End Get
|
||||
Set(value As Version)
|
||||
m_SelVersion = value
|
||||
NotifyPropertyChanged("SelVersion")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductDeadline As Nullable(Of Date)
|
||||
Public Property ProductDeadline As Nullable(Of Date)
|
||||
Get
|
||||
Return m_ProductDeadline
|
||||
End Get
|
||||
Set(value As Nullable(Of Date))
|
||||
m_ProductDeadline = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_OptionDeadline As Nullable(Of Date)
|
||||
Public Property OptionDeadline As Nullable(Of Date)
|
||||
Get
|
||||
Return m_OptionDeadline
|
||||
End Get
|
||||
Set(value As Nullable(Of Date))
|
||||
m_OptionDeadline = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LockID As String
|
||||
Public Property LockID As String
|
||||
Get
|
||||
Return m_LockID
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_LockID = value
|
||||
NotifyPropertyChanged("LockID")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Option1 As New ObservableCollection(Of KeyOption)
|
||||
Public ReadOnly Property Option1 As ObservableCollection(Of KeyOption)
|
||||
Get
|
||||
Return m_Option1
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Option2 As New ObservableCollection(Of KeyOption)
|
||||
Public ReadOnly Property Option2 As ObservableCollection(Of KeyOption)
|
||||
Get
|
||||
Return m_Option2
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SearchResult As ObservableCollection(Of SearchLicence)
|
||||
Public ReadOnly Property SearchResult As ObservableCollection(Of SearchLicence)
|
||||
Get
|
||||
Return m_SearchResult
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSearch As Command
|
||||
Private m_cmdCancel As Command
|
||||
Private m_cmdUpdate As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SearchLicenceMsg As String
|
||||
Get
|
||||
Return "Search licence"
|
||||
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"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductLevelMsg As String
|
||||
Get
|
||||
Return "Product level"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductDeadlineMsg As String
|
||||
Get
|
||||
Return "Product deadline"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Option1Msg As String
|
||||
Get
|
||||
Return "Option 1"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Option2Msg As String
|
||||
Get
|
||||
Return "Option 2"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OptionDeadlineMsg As String
|
||||
Get
|
||||
Return "Option deadline"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LockIDMsg As String
|
||||
Get
|
||||
Return "Lock ID"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property FileMsg As String
|
||||
Get
|
||||
Return "File"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SearchMsg As String
|
||||
Get
|
||||
Return "Search"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefSearchLicencePageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitSearchLicencePage()
|
||||
' Svuoto campi
|
||||
SelVersion = Nothing
|
||||
NotifyPropertyChanged("SelVersion")
|
||||
SelProductLevel = String.Empty
|
||||
NotifyPropertyChanged("SelProductLevel")
|
||||
File = String.Empty
|
||||
NotifyPropertyChanged("File")
|
||||
|
||||
' Carico lista ProductName
|
||||
Dim Query As String
|
||||
Query = "SELECT * FROM " & DB_PRODUCT
|
||||
m_ProductList = ManageDb.ExecuteProductQuery(Query)
|
||||
NotifyPropertyChanged("ProductList")
|
||||
|
||||
' Carico lista ProductVersion
|
||||
Query = "SELECT * FROM " & DB_VERSION & " GROUP BY " & DB_VERSIONNUMBER
|
||||
m_VersionList = ManageDb.ExecuteVersionQuery(Query)
|
||||
m_VersionList.Sort(Function(x, y) y.VersionNumber.CompareTo(x.VersionNumber))
|
||||
NotifyPropertyChanged("VersionList")
|
||||
|
||||
' Carico lista ProductLevel
|
||||
Query = "SELECT " & DB_PRODUCTLEVEL & " FROM " & DB_LICENCE
|
||||
m_ProductLevelList = ManageDb.ExecuteStringQuery(Query, DB_PRODUCTLEVEL)
|
||||
NotifyPropertyChanged("ProductLevelList")
|
||||
|
||||
' Cancello liste opzioni
|
||||
m_Option1.Clear()
|
||||
m_Option2.Clear()
|
||||
|
||||
m_SearchResult = New ObservableCollection(Of SearchLicence)()
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
Private Sub LoadOptions(nIndex As Integer, OptionList As ObservableCollection(Of KeyOption))
|
||||
' Cancello opzioni
|
||||
OptionList.Clear()
|
||||
' Carico opzioni
|
||||
Dim OptionIndex As Integer = 1
|
||||
Dim OptionName As String = String.Empty
|
||||
GetMainPrivateProfileString(m_SelProduct.ProductName & " - Option" & nIndex, "Option" & OptionIndex, "", OptionName)
|
||||
While Not String.IsNullOrWhiteSpace(OptionName)
|
||||
OptionList.Add(New KeyOption(False, True, OptionName))
|
||||
OptionIndex += 1
|
||||
GetMainPrivateProfileString(m_SelProduct.ProductName & " - Option" & nIndex, "Option" & OptionIndex, "", OptionName)
|
||||
End While
|
||||
' Se ho caricato delle opzioni
|
||||
If OptionList.Count > 0 Then
|
||||
' Verifico se ci sono opzioni del prodotto
|
||||
Dim ProductOption As Integer = If(nIndex = 1, m_SelProduct.ProductOption1, m_SelProduct.ProductOption2)
|
||||
Dim nBinaryIndex As Integer = 1
|
||||
For I = 0 To 15
|
||||
If (ProductOption And nBinaryIndex) <> 0 Then
|
||||
OptionList(I).IsChecked = True
|
||||
OptionList(I).IsEnabled = False
|
||||
End If
|
||||
nBinaryIndex *= 2
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CalcOptionDec(OptionList As ObservableCollection(Of KeyOption)) As Integer
|
||||
Dim nDecOption As Integer = 0
|
||||
Dim nBinaryIndex As Integer = 1
|
||||
For I As Integer = 0 To OptionList.Count() - 1
|
||||
If OptionList(I).IsChecked Then
|
||||
nDecOption += nBinaryIndex
|
||||
End If
|
||||
nBinaryIndex *= 2
|
||||
Next
|
||||
Return nDecOption
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Search"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Search_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearch Is Nothing Then
|
||||
m_cmdSearch = New Command(AddressOf Search)
|
||||
End If
|
||||
Return m_cmdSearch
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Search(ByVal param As Object)
|
||||
' Calcolo valore decimale opzione1
|
||||
Dim nDecOption1 As Integer = CalcOptionDec(m_Option1)
|
||||
Dim nDecOption2 As Integer = CalcOptionDec(m_Option2)
|
||||
' Cerco nella tabella Licence
|
||||
Dim Query 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 ' DB_VERSIONID
|
||||
Dim bFirstWhere As Boolean = True
|
||||
If Not IsNothing(m_SelProduct) OrElse
|
||||
Not IsNothing(m_SelVersion) OrElse
|
||||
Not String.IsNullOrWhiteSpace(m_SelProductLevel) OrElse
|
||||
Not IsNothing(ProductDeadline) OrElse
|
||||
Not nDecOption1 = 0 OrElse
|
||||
Not nDecOption2 = 0 OrElse
|
||||
Not IsNothing(OptionDeadline) OrElse
|
||||
Not String.IsNullOrWhiteSpace(LockID) OrElse
|
||||
Not String.IsNullOrWhiteSpace(File) Then
|
||||
Query &= " WHERE "
|
||||
If Not IsNothing(m_SelProduct) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTNAME & " LIKE '" & m_SelProduct.ProductName & "' "
|
||||
End If
|
||||
If Not IsNothing(m_SelVersion) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTVERSION & " LIKE '" & m_SelVersion.VersionNumber & "' "
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(m_SelProductLevel) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTLEVEL & " LIKE '" & m_SelProductLevel & "' "
|
||||
End If
|
||||
If Not IsNothing(ProductDeadline) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTDEADLINE & " LIKE '" & ProductDeadline & "' "
|
||||
End If
|
||||
If Not nDecOption1 = 0 Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_OPTION1 & " LIKE '" & nDecOption1 & "' "
|
||||
End If
|
||||
If Not nDecOption2 = 0 Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_OPTION2 & " LIKE '" & nDecOption2 & "' "
|
||||
End If
|
||||
If Not IsNothing(OptionDeadline) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_OPTIONDEADLINE & " LIKE '" & OptionDeadline & "' "
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(LockID) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_LOCKID & " LIKE '%" & LockID & "%' "
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(File) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_FILE & " LIKE '%" & File & "%' "
|
||||
End If
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
End If
|
||||
m_SearchResult = New ObservableCollection(Of SearchLicence)(ManageDb.ExecuteSearchLicenceQuery(Query))
|
||||
If (m_SearchResult.Count = 0) Then
|
||||
MessageBox.Show("Nessun risultato per i filtri impostati")
|
||||
End If
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
Private Sub EvalWhere(ByRef bFirst As Boolean, ByRef Query As String)
|
||||
If bFirst Then
|
||||
bFirst = False
|
||||
Else
|
||||
Query &= " AND "
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Search
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Update_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
If Not IsNothing(m_SelSearchResult) Then
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refUpdateLicencePageVM.Licence = m_SelSearchResult
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATELICENCE
|
||||
Else
|
||||
MessageBox.Show("Non è stata selezionata nessuna licenza")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class SearchLicence
|
||||
Inherits Licence
|
||||
|
||||
Private m_ProductName As String
|
||||
Public ReadOnly Property ProductName As String
|
||||
Get
|
||||
Return m_ProductName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(LicenceReader As MySqlDataReader)
|
||||
MyBase.New(LicenceReader)
|
||||
If ProductID <> 0 Then
|
||||
m_ProductName = Map.refSearchLicencePageVM.ProductList.Find(Function(x) x.ProductID = ProductID).ProductName
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,123 @@
|
||||
<Grid x:Class="SearchProductPageV"
|
||||
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 SearchProductPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding SearchProductMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</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.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding ProductNameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding ProductNameList}"
|
||||
SelectedItem="{Binding SelProductName}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductNumberMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding ProductNumberList}"
|
||||
SelectedItem="{Binding SelProductNumber}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductOption1Msg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding ProductOption1List}"
|
||||
SelectedItem="{Binding SelProductOption1}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductOption2Msg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding ProductOption2List}"
|
||||
SelectedItem="{Binding SelProductOption2}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="4"
|
||||
Grid.ColumnSpan="2">
|
||||
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="Name"
|
||||
Binding="{Binding ProductName, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Number"
|
||||
Binding="{Binding ProductNumber, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Option 1"
|
||||
Binding="{Binding ProductOption1, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Option2"
|
||||
Binding="{Binding ProductOption2, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<UniformGrid Grid.Row="5" Grid.ColumnSpan="2" Columns="3">
|
||||
<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}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class SearchProductV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,314 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Data.SQLite
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class SearchProductPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_SelSearchResult As Product
|
||||
Public Property SelSearchResult As Product
|
||||
Get
|
||||
Return m_SelSearchResult
|
||||
End Get
|
||||
Set(value As Product)
|
||||
m_SelSearchResult = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductNameList As List(Of String)
|
||||
Public ReadOnly Property ProductNameList As List(Of String)
|
||||
Get
|
||||
Return m_ProductNameList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProductName As String
|
||||
Public Property SelProductName As String
|
||||
Get
|
||||
Return m_SelProductName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelProductName = value
|
||||
NotifyPropertyChanged("SelProductName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductNumberList As List(Of String)
|
||||
Public ReadOnly Property ProductNumberList As List(Of String)
|
||||
Get
|
||||
Return m_ProductNumberList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProductNumber As String
|
||||
Public Property SelProductNumber As String
|
||||
Get
|
||||
Return m_SelProductNumber
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelProductNumber = value
|
||||
NotifyPropertyChanged("SelProductNumber")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductOption1List As List(Of String)
|
||||
Public ReadOnly Property ProductOption1List As List(Of String)
|
||||
Get
|
||||
Return m_ProductOption1List
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProductOption1 As String
|
||||
Public Property SelProductOption1 As String
|
||||
Get
|
||||
Return m_SelProductOption1
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelProductOption1 = value
|
||||
NotifyPropertyChanged("SelProductOption1")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductOption2List As List(Of String)
|
||||
Public ReadOnly Property ProductOption2List As List(Of String)
|
||||
Get
|
||||
Return m_ProductOption2List
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProductOption2 As String
|
||||
Public Property SelProductOption2 As String
|
||||
Get
|
||||
Return m_SelProductOption2
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelProductOption2 = value
|
||||
NotifyPropertyChanged("SelProductOption2")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SearchResult As ObservableCollection(Of Product)
|
||||
Public ReadOnly Property SearchResult As ObservableCollection(Of Product)
|
||||
Get
|
||||
Return m_SearchResult
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSearch As Command
|
||||
Private m_cmdCancel As Command
|
||||
Private m_cmdUpdate As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SearchProductMsg As String
|
||||
Get
|
||||
Return "Search product"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductNameMsg As String
|
||||
Get
|
||||
Return "Name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductNumberMsg As String
|
||||
Get
|
||||
Return "Number"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductOption1Msg As String
|
||||
Get
|
||||
Return "Option 1"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductOption2Msg As String
|
||||
Get
|
||||
Return "Option 2"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SearchMsg As String
|
||||
Get
|
||||
Return "Search"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefSearchProductPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitSearchProductPage()
|
||||
' Svuoto campi
|
||||
SelProductName = Nothing
|
||||
NotifyPropertyChanged("SelProductName")
|
||||
SelProductNumber = Nothing
|
||||
NotifyPropertyChanged("SelProductNumber")
|
||||
SelProductOption1 = Nothing
|
||||
NotifyPropertyChanged("SelProductOption1")
|
||||
SelProductOption2 = Nothing
|
||||
NotifyPropertyChanged("SelProductOption2")
|
||||
|
||||
' Carico lista ProductName
|
||||
Dim Query As String
|
||||
Query = "SELECT " & DB_PRODUCTNAME & " FROM " & DB_PRODUCT
|
||||
m_ProductNameList = ManageDb.ExecuteStringQuery(Query, DB_PRODUCTNAME)
|
||||
NotifyPropertyChanged("ProductNameList")
|
||||
|
||||
' Carico lista ProductNumber
|
||||
Query = "SELECT " & DB_PRODUCTNUMBER & " FROM " & DB_PRODUCT
|
||||
m_ProductNumberList = ManageDb.ExecuteStringQuery(Query, DB_PRODUCTNUMBER)
|
||||
NotifyPropertyChanged("ProductNumberList")
|
||||
|
||||
' Carico lista ProductOption1
|
||||
Query = "SELECT " & DB_PRODUCTOPTION1 & " FROM " & DB_PRODUCT
|
||||
m_ProductOption1List = ManageDb.ExecuteStringQuery(Query, DB_PRODUCTOPTION1)
|
||||
NotifyPropertyChanged("ProductOption1List")
|
||||
|
||||
' Carico lista ProductOption2
|
||||
Query = "SELECT " & DB_PRODUCTOPTION2 & " FROM " & DB_PRODUCT
|
||||
m_ProductOption2List = ManageDb.ExecuteStringQuery(Query, DB_PRODUCTOPTION2)
|
||||
NotifyPropertyChanged("ProductOption2List")
|
||||
|
||||
m_SearchResult = New ObservableCollection(Of Product)()
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Search"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchProduct_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearch Is Nothing Then
|
||||
m_cmdSearch = New Command(AddressOf Search)
|
||||
End If
|
||||
Return m_cmdSearch
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Search(ByVal param As Object)
|
||||
' Cerco nella tabella Client
|
||||
Dim Query As String = "SELECT * FROM " & DB_PRODUCT & " "
|
||||
Dim bFirstWhere As Boolean = True
|
||||
If Not String.IsNullOrWhiteSpace(SelProductName) OrElse
|
||||
Not IsNothing(SelProductNumber) OrElse
|
||||
Not IsNothing(SelProductOption1) OrElse
|
||||
Not IsNothing(SelProductOption2) Then
|
||||
Query &= "WHERE "
|
||||
If Not String.IsNullOrWhiteSpace(SelProductName) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTNAME & " LIKE '" & m_SelProductName & "' "
|
||||
End If
|
||||
If Not IsNothing(SelProductNumber) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTNUMBER & " LIKE '" & m_SelProductNumber & "' "
|
||||
End If
|
||||
If Not IsNothing(SelProductOption1) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTOPTION1 & " LIKE '" & m_SelProductOption1 & "' "
|
||||
End If
|
||||
If Not IsNothing(SelProductOption2) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTOPTION2 & " LIKE '" & m_SelProductOption2 & "' "
|
||||
End If
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
End If
|
||||
m_SearchResult = New ObservableCollection(Of Product)(ManageDb.ExecuteSearchProductQuery(Query))
|
||||
If (m_SearchResult.Count = 0) Then
|
||||
MessageBox.Show("Nessun risultato per i filtri impostati")
|
||||
End If
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
Private Sub EvalWhere(ByRef bFirst As Boolean, ByRef Query As String)
|
||||
If bFirst Then
|
||||
bFirst = False
|
||||
Else
|
||||
Query &= " AND "
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Search
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateProduct_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
If Not IsNothing(m_SelSearchResult) Then
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refUpdateProductPageVM.Product = m_SelSearchResult
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATEPRODUCT
|
||||
Else
|
||||
MessageBox.Show("Non è stato selezionato nessun prodotto")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<Grid x:Class="SearchResellerPageV"
|
||||
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}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding SearchResellerMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</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*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding NameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Name}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="2">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Reseller"
|
||||
Binding="{Binding Name, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<UniformGrid Grid.Row="3"
|
||||
Columns="3"
|
||||
Grid.ColumnSpan="2">
|
||||
|
||||
<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}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class SearchResellerPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,200 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Data.SQLite
|
||||
Imports EgtWPFLib5
|
||||
Imports MySql.Data.MySqlClient
|
||||
|
||||
Public Class SearchResellerPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_SelSearchResult As SearchReseller
|
||||
Public Property SelSearchResult As SearchReseller
|
||||
Get
|
||||
Return m_SelSearchResult
|
||||
End Get
|
||||
Set(value As SearchReseller)
|
||||
m_SelSearchResult = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
NotifyPropertyChanged("Name")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_SearchResult As ObservableCollection(Of SearchReseller)
|
||||
Public ReadOnly Property SearchResult As ObservableCollection(Of SearchReseller)
|
||||
Get
|
||||
Return m_SearchResult
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSearch As Command
|
||||
Private m_cmdCancel As Command
|
||||
Private m_cmdUpdate As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SearchResellerMsg As String
|
||||
Get
|
||||
Return "Search reseller"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property NameMsg As String
|
||||
Get
|
||||
Return "Name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SearchMsg As String
|
||||
Get
|
||||
Return "Search"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefSearchResellerPageVM(Me)
|
||||
End Sub
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitSearchResellerPage()
|
||||
|
||||
' Svuoto campi
|
||||
Name = String.Empty
|
||||
NotifyPropertyChanged("Name")
|
||||
|
||||
m_SearchResult = New ObservableCollection(Of SearchReseller)()
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "SearchReseller"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchReseller_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearch Is Nothing Then
|
||||
m_cmdSearch = New Command(AddressOf Search)
|
||||
End If
|
||||
Return m_cmdSearch
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Search(ByVal param As Object)
|
||||
' Cerco nella tabella Reseller
|
||||
Dim Query As String = "SELECT * FROM " & DB_RESELLER
|
||||
If Not String.IsNullOrWhiteSpace(Name) Then
|
||||
Query &= " WHERE "
|
||||
If Not String.IsNullOrWhiteSpace(m_Name) Then
|
||||
Query &= DB_RESELLERNAME & " LIKE '%" & m_Name & "%' "
|
||||
End If
|
||||
End If
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
m_SearchResult = New ObservableCollection(Of SearchReseller)(ManageDb.ExecuteSearchResellerQuery(Query))
|
||||
If (m_SearchResult.Count = 0) Then
|
||||
MessageBox.Show("Nessun risultato per i filtri impostati")
|
||||
End If
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
#End Region ' SearchReseller
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateReseller_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
' Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATERESELLER
|
||||
' Map.refUpdateResellerPageVM.IdToUpdate = m_SelSearchResult.ResellerID
|
||||
Map.refUpdateResellerPageVM.IdToUpdate = m_SelSearchResult.ResellerID
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATERESELLER
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class SearchReseller
|
||||
Inherits Reseller
|
||||
|
||||
Private m_Name As String
|
||||
Public ReadOnly Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(ClientReader As MySqlDataReader)
|
||||
MyBase.New(ClientReader)
|
||||
m_Name = CType(ClientReader(DB_RESELLERNAME), String)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<Grid x:Class="SearchVersionPageV"
|
||||
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}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.ColumnSpan="2">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding SearchVersionMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<LicenseManager:VersionPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<DataGrid ItemsSource="{Binding SearchResult}"
|
||||
SelectedItem="{Binding SelSearchResult}"
|
||||
AutoGenerateColumns="False"
|
||||
Grid.Row="2">
|
||||
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTextColumn Header="VersionNumber"
|
||||
Binding="{Binding VersionNumber, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Product Name"
|
||||
Binding="{Binding ProductName, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
<DataGridTextColumn Header="Product ID"
|
||||
Binding="{Binding ProductID, Mode=OneWay}"
|
||||
Width="1*"/>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<UniformGrid Grid.Row="3" Columns="3">
|
||||
<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}"/>
|
||||
</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"/>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class SearchVersionPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,222 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Data.SQLite
|
||||
Imports EgtWPFLib5
|
||||
Imports MySql.Data.MySqlClient
|
||||
|
||||
Public Class SearchVersionPageVM
|
||||
Inherits VersionPageVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_SelSearchResult As SearchVersion
|
||||
Public Property SelSearchResult As SearchVersion
|
||||
Get
|
||||
Return m_SelSearchResult
|
||||
End Get
|
||||
Set(value As SearchVersion)
|
||||
m_SelSearchResult = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SearchResult As ObservableCollection(Of SearchVersion)
|
||||
Public ReadOnly Property SearchResult As ObservableCollection(Of SearchVersion)
|
||||
Get
|
||||
Return m_SearchResult
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProductList As List(Of Product)
|
||||
Public ReadOnly Property ProductList As List(Of Product)
|
||||
Get
|
||||
Return m_ProductList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProduct As Product
|
||||
Public Property SelProduct As Product
|
||||
Get
|
||||
Return m_SelProduct
|
||||
End Get
|
||||
Set(value As Product)
|
||||
m_SelProduct = value
|
||||
NotifyPropertyChanged("SelProduct")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSearch As Command
|
||||
Private m_cmdCancel As Command
|
||||
Private m_cmdUpdate As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SearchVersionMsg As String
|
||||
Get
|
||||
Return "Search Version"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SearchMsg As String
|
||||
Get
|
||||
Return "Search"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefSearchVersionPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitSearchVersionPage()
|
||||
m_SearchResult = New ObservableCollection(Of SearchVersion)()
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
Dim Query As String = "SELECT * FROM " & DB_PRODUCT
|
||||
m_ProductList = ManageDb.ExecuteProductQuery(Query)
|
||||
NotifyPropertyChanged("ProductList")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Search"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property SearchVersion_Command As ICommand
|
||||
Get
|
||||
If m_cmdSearch Is Nothing Then
|
||||
m_cmdSearch = New Command(AddressOf Search)
|
||||
End If
|
||||
Return m_cmdSearch
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Search(ByVal param As Object)
|
||||
' Cerco nella tabella Version
|
||||
Dim Query As String = "SELECT * FROM " & DB_VERSION & " INNER JOIN " & DB_PRODUCT & " ON " & DB_VERSION & "." & DB_PRODUCTID & " = " & DB_PRODUCT & "." & DB_PRODUCTID & " "
|
||||
Dim bFirstWhere As Boolean = True
|
||||
If Not String.IsNullOrWhiteSpace(VersionNumber) OrElse
|
||||
Not IsNothing(SelProduct) Then
|
||||
Query &= "WHERE "
|
||||
If Not String.IsNullOrWhiteSpace(VersionNumber) Then
|
||||
If Not VersionNumber.Equals("0") Then ' Lo 0 nel campo VersionNumber corrisponde ad ANY
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_VERSIONNUMBER & " LIKE '" & VersionNumber & "%' "
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(SelProduct) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTNAME & " LIKE '" & SelProduct.ProductName & "%' "
|
||||
End If
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
Dim suffixToRemove As String = " WHERE"
|
||||
If Not IsNothing(Query) And Not IsNothing(suffixToRemove) And Query.EndsWith(suffixToRemove) Then
|
||||
Query = Query.Substring(0, Query.Length - suffixToRemove.Length)
|
||||
End If
|
||||
End If
|
||||
m_SearchResult = New ObservableCollection(Of SearchVersion)(ManageDb.ExecuteSearchVersionQuery(Query))
|
||||
If (m_SearchResult.Count = 0) Then
|
||||
MessageBox.Show("Nessun risultato per i filtri impostati")
|
||||
End If
|
||||
NotifyPropertyChanged("SearchResult")
|
||||
End Sub
|
||||
|
||||
Private Sub EvalWhere(ByRef bFirst As Boolean, ByRef Query As String)
|
||||
If bFirst Then
|
||||
bFirst = False
|
||||
Else
|
||||
Query &= " AND "
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Search
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateVersion_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
If Not IsNothing(m_SelSearchResult) Then
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refUpdateVersionPageVM.IdToUpdate = m_SelSearchResult.VersionID
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.UPDATEVERSION
|
||||
Else
|
||||
MessageBox.Show("Non è stata selezionata nessuna versione")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Public Class SearchVersion
|
||||
Inherits Version
|
||||
|
||||
Private m_ProductName As String
|
||||
Public ReadOnly Property ProductName As String
|
||||
Get
|
||||
Return m_ProductName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(VersionReader As MySqlDataReader)
|
||||
MyBase.New(VersionReader)
|
||||
m_ProductName = CType(VersionReader(DB_PRODUCTNAME), String)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,7 @@
|
||||
'Questa classe consente di gestire eventi specifici sulla classe delle impostazioni:
|
||||
' L'evento SettingChanging viene generato prima della modifica del valore di un'impostazione.
|
||||
' L'evento PropertyChanged viene generato dopo la modifica del valore di un'impostazione.
|
||||
' L'evento SettingsLoaded viene generato dopo il caricamento dei valori dell'impostazione.
|
||||
' L'evento SettingsSaving viene generato prima del salvataggio dei valori dell'impostazione.
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
End Class
|
||||
@@ -0,0 +1,35 @@
|
||||
<Grid x:Class="UpdateClientPageV"
|
||||
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 UpdateClientPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.ColumnSpan="2">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding UpdateClientMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<LicenseManager:ClientPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<UniformGrid Grid.Row="3" Columns="2">
|
||||
<Button Content="{Binding UpdateMsg}"
|
||||
Command="{Binding UpdateClient_Command}"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class UpdateClientPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,202 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class UpdateClientPageVM
|
||||
Inherits ClientPageVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_IdToUpdate As Integer
|
||||
Public Property IdToUpdate As Integer
|
||||
Get
|
||||
Return m_IdToUpdate
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_IdToUpdate = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ResellerList As List(Of Reseller)
|
||||
Public ReadOnly Property ResellerList As List(Of Reseller)
|
||||
Get
|
||||
Return m_ResellerList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelReseller As Reseller
|
||||
Public Property SelReseller As Reseller
|
||||
Get
|
||||
Return m_SelReseller
|
||||
End Get
|
||||
Set(value As Reseller)
|
||||
m_SelReseller = value
|
||||
NotifyPropertyChanged("SelReseller")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdUpdate As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property UpdateClientMsg As String
|
||||
Get
|
||||
Return "Update client"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefUpdateClientPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitUpdateClientPage()
|
||||
' Svuoto campi
|
||||
' Name = String.Empty
|
||||
Dim Query As String = "SELECT " & DB_NAME & " FROM " & DB_CLIENT &
|
||||
" WHERE " & DB_CLIENTID & " LIKE " & IdToUpdate
|
||||
Name = ManageDb.ExecuteStringQuery(Query, DB_NAME)(0)
|
||||
NotifyPropertyChanged("Name")
|
||||
|
||||
Dim eQuery As String = "SELECT " & DB_EMAIL & " FROM " & DB_CLIENT &
|
||||
" WHERE " & DB_CLIENTID & " LIKE " & IdToUpdate
|
||||
Name = ManageDb.ExecuteStringQuery(eQuery, DB_EMAIL)(0)
|
||||
NotifyPropertyChanged("Email")
|
||||
|
||||
' Carico lista Reseller
|
||||
Dim rQuery As String = "SELECT * FROM " & DB_RESELLER
|
||||
m_ResellerList = ManageDb.ExecuteResellerQuery(rQuery)
|
||||
NotifyPropertyChanged("ResellerList")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateClient_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
If Not String.IsNullOrWhiteSpace(Name) OrElse
|
||||
Not String.IsNullOrWhiteSpace(Email) OrElse
|
||||
Not IsNothing(SelReseller) Then
|
||||
' Cerco nella tabella Client
|
||||
Dim Query As String = "UPDATE " & DB_CLIENT
|
||||
Dim bFirstWhere As Boolean = True
|
||||
If Not String.IsNullOrWhiteSpace(Name) OrElse
|
||||
Not String.IsNullOrWhiteSpace(Email) OrElse
|
||||
Not IsNothing(SelReseller) Then
|
||||
Query &= " SET "
|
||||
If Not String.IsNullOrWhiteSpace(Name) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_NAME & " = '" & Name & "' "
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(Email) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_EMAIL & " = '" & Email & "' "
|
||||
End If
|
||||
If Not IsNothing(SelReseller) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
|
||||
Dim reQuery As String = "SELECT * FROM " & DB_RESELLER & " WHERE "
|
||||
reQuery &= DB_RESELLERNAME & " = '" & SelReseller.ResellerName & "' "
|
||||
reQuery = reQuery.TrimEnd(","c, " "c)
|
||||
Dim reseller As Reseller = ManageDb.ExecuteResellerQuery(reQuery).Item(0)
|
||||
Dim reId As Integer = reseller.ResellerID
|
||||
Query &= DB_RESELLERID & " = '" & reId & "' "
|
||||
|
||||
'Query &= DB_RESELLERNAME & " = '" & SelReseller.ResellerName & "%' "
|
||||
End If
|
||||
Query &= "WHERE " & DB_CLIENTID & " = " & IdToUpdate
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
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
|
||||
MessageBox.Show("Completare almeno un campo")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub EvalWhere(ByRef bFirst As Boolean, ByRef Query As String)
|
||||
If bFirst Then
|
||||
bFirst = False
|
||||
Else
|
||||
Query &= ", "
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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.SEARCHCLIENT
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
'#Region "GetResellerID"
|
||||
|
||||
' ' Returns a command that manage the MainWindow_Unloaded command
|
||||
' Public Sub GetResellerID(ByVal param As Object)
|
||||
' Dim Query As String = "SELECT " & DB_RESELLERID & "FROM" & DB_RESELLER & "WHERE "
|
||||
' Query &= DB_RESELLERNAME & " = '" & SelReseller.ResellerName & "%' "
|
||||
' Query = Query.TrimEnd(","c, " "c)
|
||||
' ' ManageDb.ExecuteQuery(Query)
|
||||
' Dim cmd As MySqlCommand = New MySqlCommand(stm, conn)
|
||||
' Dim value As Object = cmd.ExecuteScalar()
|
||||
' If value! = null Then
|
||||
' String nama_student = nama_studentObj.ToString()
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
'#End Region ' GetResellerID
|
||||
|
||||
#End Region 'COMMANDS
|
||||
End Class
|
||||
@@ -0,0 +1,70 @@
|
||||
<Grid x:Class="UpdateKeyPageV"
|
||||
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 UpdateKeyPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding UpdateKeyMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</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*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding NameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding NameList}"
|
||||
SelectedItem="{Binding SelName}"
|
||||
DisplayMemberPath="Name"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding StateMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding StateList}"
|
||||
SelectedItem="{Binding SelState}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<UniformGrid Grid.Row="3"
|
||||
Columns="2"
|
||||
Grid.ColumnSpan="2">
|
||||
<Button Content="{Binding UpdateMsg}"
|
||||
Command="{Binding UpdateKey_Command}"
|
||||
IsDefault="True"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class UpdateKeyPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,213 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class UpdateKeyPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_Key As Key
|
||||
Public Property Key As Key
|
||||
Get
|
||||
Return m_Key
|
||||
End Get
|
||||
Set(value As Key)
|
||||
m_Key = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_NameList As List(Of Client)
|
||||
Public ReadOnly Property NameList As List(Of Client)
|
||||
Get
|
||||
Return m_NameList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelName As Client
|
||||
Public Property SelName As Client
|
||||
Get
|
||||
Return m_SelName
|
||||
End Get
|
||||
Set(value As Client)
|
||||
m_SelName = value
|
||||
NotifyPropertyChanged("SelName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ClientID As Integer
|
||||
Public Property ClientID As Integer
|
||||
Get
|
||||
Return m_ClientID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_ClientID = value
|
||||
NotifyPropertyChanged("ClientID")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_StateList As List(Of Key.KeyState)
|
||||
Public ReadOnly Property StateList As List(Of Key.KeyState)
|
||||
Get
|
||||
Return m_StateList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelState As Key.KeyState
|
||||
Public Property SelState As Key.KeyState
|
||||
Get
|
||||
Return m_SelState
|
||||
End Get
|
||||
Set(value As Key.KeyState)
|
||||
m_SelState = value
|
||||
NotifyPropertyChanged("SelState")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_State As Key.KeyState
|
||||
Public Property State As Key.KeyState
|
||||
Get
|
||||
Return m_State
|
||||
End Get
|
||||
Set(value As Key.KeyState)
|
||||
m_State = value
|
||||
NotifyPropertyChanged("State")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdUpdate As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property UpdateKeyMsg As String
|
||||
Get
|
||||
Return "Update key"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property NameMsg As String
|
||||
Get
|
||||
Return "Name client"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property StateMsg As String
|
||||
Get
|
||||
Return "State"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefUpdateKeyPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitUpdateKeyPage()
|
||||
' Carico lista Name
|
||||
Dim Query As String = "SELECT * FROM " & DB_CLIENT
|
||||
m_NameList = ManageDb.ExecuteClientQuery(Query)
|
||||
NotifyPropertyChanged("NameList")
|
||||
' Carico lista State
|
||||
Dim sList As New List(Of Key.KeyState)
|
||||
sList.Add(Key.KeyState.Consegnata)
|
||||
sList.Add(Key.KeyState.InDeposito)
|
||||
sList.Add(Key.KeyState.Guasta)
|
||||
m_StateList = sList
|
||||
NotifyPropertyChanged("StateList")
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateKey_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
If Not IsNothing(Key) Then
|
||||
If Not IsNothing(SelName) Then
|
||||
'Cerco IDClient associato a Name
|
||||
Dim Query As String = "SELECT " & DB_CLIENTID & " FROM " & DB_CLIENT & " WHERE " & DB_NAME & " = '" & SelName.Name & "'"
|
||||
ClientID = ManageDb.ExecuteIntegerQuery(Query, DB_CLIENTID)(0)
|
||||
' Aggiorno tabella Key col Client scelto
|
||||
Query = "UPDATE " & DB_KEY & " SET " & DB_CLIENTID & " = '" & m_ClientID & "' WHERE " & DB_LOCKID & " = '" & Key.LockID & "' "
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
|
||||
ManageDb.ExecuteQuery(Query)
|
||||
End If
|
||||
If Not IsNothing(SelState) Then
|
||||
' Aggiorno tabella Key con lo State scelto
|
||||
Dim Query As String = "UPDATE " & DB_KEY & " SET " & DB_STATE & " = '" & m_SelState.ToString() & "' WHERE " & DB_LOCKID & " = '" & Key.LockID & "' "
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
|
||||
ManageDb.ExecuteQuery(Query)
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show("Non è stata selezionata nessuna chiave")
|
||||
End If
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
' Else
|
||||
' MessageBox.Show("Completare il campo presente")
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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.SEARCHKEY
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region 'COMMANDS
|
||||
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,146 @@
|
||||
<Grid x:Class="UpdateLicencePageV"
|
||||
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 UpdateLicencePageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding UpdateLicenceMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<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>
|
||||
<TextBlock Text="{Binding ProductVersionMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding VersionList}"
|
||||
SelectedItem="{Binding SelVersion}"
|
||||
DisplayMemberPath="VersionID"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductLevelMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding ProductLevelList}"
|
||||
SelectedItem="{Binding SelProductLevel}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductDeadlineMsg}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<DatePicker SelectedDate="{Binding ProductDeadline}"
|
||||
Height="30"
|
||||
Width="170"
|
||||
Grid.Column="3"
|
||||
Grid.Row="0"/>
|
||||
|
||||
<TextBlock Text="{Binding OptionDeadlineMsg}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<DatePicker SelectedDate="{Binding OptionDeadline}"
|
||||
Height="30"
|
||||
Width="170"
|
||||
Grid.Column="3"
|
||||
Grid.Row="1"/>
|
||||
|
||||
<TextBlock Text="{Binding ClientNameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding ClientName}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
<GroupBox Header="{Binding Option1Msg}"
|
||||
Grid.Row="3" Grid.ColumnSpan="4">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Option1}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsChecked}"
|
||||
Content="{Binding Msg}"
|
||||
IsEnabled="{Binding IsEnabled}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding Option2Msg}"
|
||||
Grid.Row="4" Grid.ColumnSpan="4">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Option2}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsChecked}"
|
||||
Content="{Binding Msg}"
|
||||
IsEnabled="{Binding IsEnabled}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<Button Content="{Binding UpdateMsg}"
|
||||
Command="{Binding Update_Command}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="5"
|
||||
Grid.ColumnSpan="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="5"
|
||||
Grid.ColumnSpan="2"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class UpdateLicencePageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,357 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class UpdateLicencePageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_Licence As Licence
|
||||
Public Property Licence As Licence
|
||||
Get
|
||||
Return m_Licence
|
||||
End Get
|
||||
Set(value As Licence)
|
||||
m_Licence = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductName As String
|
||||
Public Property ProductName As String
|
||||
Get
|
||||
Return m_ProductName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ProductName = value
|
||||
NotifyPropertyChanged("ProductName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_VersionList As List(Of Version)
|
||||
Public ReadOnly Property VersionList As List(Of Version)
|
||||
Get
|
||||
Return m_VersionList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelVersion As Version
|
||||
Public Property SelVersion As Version
|
||||
Get
|
||||
Return m_SelVersion
|
||||
End Get
|
||||
Set(value As Version)
|
||||
m_SelVersion = value
|
||||
NotifyPropertyChanged("SelVersion")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductLevelList As List(Of String)
|
||||
Public ReadOnly Property ProductLevelList As List(Of String)
|
||||
Get
|
||||
Return m_ProductLevelList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProductLevel As String
|
||||
Public Property SelProductLevel As String
|
||||
Get
|
||||
Return m_SelProductLevel
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelProductLevel = value
|
||||
NotifyPropertyChanged("SelProductLevel")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductDeadline As Nullable(Of Date)
|
||||
Public Property ProductDeadline As Nullable(Of Date)
|
||||
Get
|
||||
Return m_ProductDeadline
|
||||
End Get
|
||||
Set(value As Nullable(Of Date))
|
||||
m_ProductDeadline = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_OptionDeadline As Nullable(Of Date)
|
||||
Public Property OptionDeadline As Nullable(Of Date)
|
||||
Get
|
||||
Return m_OptionDeadline
|
||||
End Get
|
||||
Set(value As Nullable(Of Date))
|
||||
m_OptionDeadline = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ClientName As String
|
||||
Public Property ClientName As String
|
||||
Get
|
||||
Return m_ClientName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ClientName = value
|
||||
NotifyPropertyChanged("ClientName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Option1 As New ObservableCollection(Of KeyOption)
|
||||
Public ReadOnly Property Option1 As ObservableCollection(Of KeyOption)
|
||||
Get
|
||||
Return m_Option1
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Option2 As New ObservableCollection(Of KeyOption)
|
||||
Public ReadOnly Property Option2 As ObservableCollection(Of KeyOption)
|
||||
Get
|
||||
Return m_Option2
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdUpdate As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property UpdateLicenceMsg As String
|
||||
Get
|
||||
Return "Update licence"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductVersionMsg As String
|
||||
Get
|
||||
Return "Product version"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductLevelMsg As String
|
||||
Get
|
||||
Return "Product level"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductDeadlineMsg As String
|
||||
Get
|
||||
Return "Product deadline"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Option1Msg As String
|
||||
Get
|
||||
Return "Option 1"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Option2Msg As String
|
||||
Get
|
||||
Return "Option 2"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OptionDeadlineMsg As String
|
||||
Get
|
||||
Return "Option deadline"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ClientNameMsg As String
|
||||
Get
|
||||
Return "Client name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefUpdateLicencePageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitUpdateLicencePage()
|
||||
' Svuoto campi
|
||||
SelVersion = Nothing
|
||||
NotifyPropertyChanged("SelVersion")
|
||||
SelProductLevel = String.Empty
|
||||
NotifyPropertyChanged("SelProductLevel")
|
||||
ClientName = String.Empty
|
||||
NotifyPropertyChanged("File")
|
||||
|
||||
' Carico lista ProductVersion
|
||||
Dim Query As String = "SELECT * FROM " & DB_VERSION
|
||||
m_VersionList = ManageDb.ExecuteVersionQuery(Query)
|
||||
NotifyPropertyChanged("VersionList")
|
||||
|
||||
' Carico lista ProductLevel
|
||||
Query = "SELECT " & DB_PRODUCTLEVEL & " FROM " & DB_LICENCE
|
||||
m_ProductLevelList = ManageDb.ExecuteStringQuery(Query, DB_PRODUCTLEVEL)
|
||||
NotifyPropertyChanged("ProductLevelList")
|
||||
|
||||
' Inizializzo liste opzioni
|
||||
LoadOptions(1, m_Option1)
|
||||
LoadOptions(2, m_Option2)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadOptions(nIndex As Integer, OptionList As ObservableCollection(Of KeyOption))
|
||||
'Cerco ProductName associat a ProductID
|
||||
Dim Query As String = "SELECT " & DB_PRODUCTNAME & " FROM " & DB_PRODUCT & " WHERE " & DB_PRODUCTID & " = " & Licence.ProductID
|
||||
m_ProductName = ManageDb.ExecuteStringQuery(Query, DB_PRODUCTNAME)(0)
|
||||
' Cancello opzioni
|
||||
OptionList.Clear()
|
||||
' Carico opzioni
|
||||
Dim OptionIndex As Integer = 1
|
||||
Dim OptionName As String = String.Empty
|
||||
GetMainPrivateProfileString(m_ProductName & " - Option" & nIndex, "Option" & OptionIndex, "", OptionName)
|
||||
While Not String.IsNullOrWhiteSpace(OptionName)
|
||||
OptionList.Add(New KeyOption(False, True, OptionName))
|
||||
OptionIndex += 1
|
||||
GetMainPrivateProfileString(m_ProductName & " - Option" & nIndex, "Option" & OptionIndex, "", OptionName)
|
||||
End While
|
||||
' Se ho caricato delle opzioni
|
||||
If OptionList.Count > 0 Then
|
||||
' Verifico se ci sono opzioni del prodotto
|
||||
Dim ProductOption As Integer = If(nIndex = 1, Licence.Option1, Licence.Option2)
|
||||
Dim nBinaryIndex As Integer = 1
|
||||
For I = 0 To 15
|
||||
If (ProductOption And nBinaryIndex) <> 0 Then
|
||||
OptionList(I).IsChecked = True
|
||||
OptionList(I).IsEnabled = True
|
||||
End If
|
||||
nBinaryIndex *= 2
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CalcOptionDec(OptionList As ObservableCollection(Of KeyOption)) As Integer
|
||||
Dim nDecOption As Integer = 0
|
||||
Dim nBinaryIndex As Integer = 1
|
||||
For I As Integer = 0 To OptionList.Count() - 1
|
||||
If OptionList(I).IsChecked Then
|
||||
nDecOption += nBinaryIndex
|
||||
End If
|
||||
nBinaryIndex *= 2
|
||||
Next
|
||||
Return nDecOption
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Update_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
' Calcolo valore decimale opzione1
|
||||
Dim nDecOption1 As Integer = CalcOptionDec(m_Option1)
|
||||
Dim nDecOption2 As Integer = CalcOptionDec(m_Option2)
|
||||
' Cerco nella tabella Licence
|
||||
Dim Query As String = "UPDATE " & DB_LICENCE
|
||||
Dim bFirstWhere As Boolean = True
|
||||
If Not IsNothing(m_SelVersion) OrElse
|
||||
Not String.IsNullOrWhiteSpace(m_SelProductLevel) OrElse
|
||||
Not IsNothing(ProductDeadline) OrElse
|
||||
Not nDecOption1 = 0 OrElse
|
||||
Not nDecOption2 = 0 OrElse
|
||||
Not IsNothing(OptionDeadline) OrElse
|
||||
Not String.IsNullOrWhiteSpace(ClientName) Then ' (File)
|
||||
Query &= " SET "
|
||||
If Not IsNothing(m_SelVersion) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTVERSION & " = '" & m_SelVersion.VersionID & "' "
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(m_SelProductLevel) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTLEVEL & " = '" & m_SelProductLevel & "' "
|
||||
End If
|
||||
If Not IsNothing(ProductDeadline) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTDEADLINE & " = '" & ProductDeadline & "' "
|
||||
End If
|
||||
If Not nDecOption1 = 0 Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_OPTION1 & " = '" & nDecOption1 & "' "
|
||||
End If
|
||||
If Not nDecOption2 = 0 Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_OPTION2 & " = '" & nDecOption2 & "' "
|
||||
End If
|
||||
If Not IsNothing(OptionDeadline) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_OPTIONDEADLINE & " = '" & OptionDeadline & "' "
|
||||
End If
|
||||
'If Not String.IsNullOrWhiteSpace(File) Then
|
||||
' EvalWhere(bFirstWhere, Query)
|
||||
' Query &= DB_FILE & " = '" & File & "' "
|
||||
'End If
|
||||
Query &= "WHERE " & DB_LICENCEID & " = " & Licence.LicenceID
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
End If
|
||||
ManageDb.ExecuteQuery(Query)
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Map.refMainWindowVM.SelProjectMode = MainWindowVM.ProjectModeOpt.MAINMENU
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub EvalWhere(ByRef bFirst As Boolean, ByRef Query As String)
|
||||
If bFirst Then
|
||||
bFirst = False
|
||||
Else
|
||||
Query &= ", "
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Search
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,113 @@
|
||||
<Grid x:Class="UpdateProductPageV"
|
||||
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 UpdateProductPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding UpdateProductMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</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*"/>
|
||||
<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 NewProductName}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductNumberMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding NewProductNumber}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<GroupBox Header="{Binding Option1Msg}"
|
||||
Grid.Row="4" Grid.ColumnSpan="2">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding NewOption1}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsChecked}"
|
||||
Content="{Binding Msg}"
|
||||
IsEnabled="{Binding IsEnabled}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding Option2Msg}"
|
||||
Grid.Row="5" Grid.ColumnSpan="2">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding NewOption2}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsChecked}"
|
||||
Content="{Binding Msg}"
|
||||
IsEnabled="{Binding IsEnabled}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<UniformGrid Grid.Row="6" Grid.ColumnSpan="2" Columns="2">
|
||||
<Button Content="{Binding UpdateMsg}"
|
||||
Command="{Binding UpdateProduct_Command}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="6"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class UpdateProductPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,279 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Data.SQLite
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class UpdateProductPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_Product As Product
|
||||
Public Property Product As Product
|
||||
Get
|
||||
Return m_Product
|
||||
End Get
|
||||
Set(value As Product)
|
||||
m_Product = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_NewProductName As String
|
||||
Public Property NewProductName As String
|
||||
Get
|
||||
Return m_NewProductName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_NewProductName = value
|
||||
NotifyPropertyChanged("NewProductName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_NewProductNumber As Integer
|
||||
Public Property NewProductNumber As Integer
|
||||
Get
|
||||
Return m_NewProductNumber
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_NewProductNumber = value
|
||||
NotifyPropertyChanged("NewProductNumber")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_NewOption1 As New ObservableCollection(Of KeyOption)
|
||||
Public ReadOnly Property NewOption1 As ObservableCollection(Of KeyOption)
|
||||
Get
|
||||
Return m_NewOption1
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_NewOption2 As New ObservableCollection(Of KeyOption)
|
||||
Public ReadOnly Property NewOption2 As ObservableCollection(Of KeyOption)
|
||||
Get
|
||||
Return m_NewOption2
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdUpdate As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property UpdateProductMsg As String
|
||||
Get
|
||||
Return "Update product"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductNameMsg As String
|
||||
Get
|
||||
Return "Name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductNumberMsg As String
|
||||
Get
|
||||
Return "Number"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Option1Msg As String
|
||||
Get
|
||||
Return "Option 1"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Option2Msg As String
|
||||
Get
|
||||
Return "Option 2"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefUpdateProductPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitUpdateProductPage()
|
||||
|
||||
Dim Query As String = "SELECT * FROM " & DB_PRODUCT &
|
||||
" WHERE " & DB_PRODUCTID & " LIKE " & Product.ProductID
|
||||
NewProductName = ManageDb.ExecuteProductQuery(Query)(0).ProductName
|
||||
NotifyPropertyChanged("NewProductName")
|
||||
NewProductNumber = ManageDb.ExecuteProductQuery(Query)(0).ProductNumber
|
||||
NotifyPropertyChanged("NewProductNumber")
|
||||
|
||||
'' Svuoto campi
|
||||
'NewProductName = Nothing
|
||||
'NotifyPropertyChanged("NewProductName")
|
||||
'NewProductNumber = Nothing
|
||||
'NotifyPropertyChanged("NewProductNumber")
|
||||
|
||||
|
||||
' Cancello liste opzioni
|
||||
LoadOptions(1, NewOption1)
|
||||
LoadOptions(2, NewOption2)
|
||||
|
||||
NotifyPropertyChanged("NewOption1")
|
||||
NotifyPropertyChanged("NewOption2")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadOptions(nIndex As Integer, ByRef OptionList As ObservableCollection(Of KeyOption))
|
||||
' Cancello opzioni
|
||||
OptionList.Clear()
|
||||
' Carico opzioni
|
||||
Dim OptionIndex As Integer = 1
|
||||
Dim OptionName As String = String.Empty
|
||||
GetMainPrivateProfileString(m_Product.ProductName & " - Option" & nIndex, "Option" & OptionIndex, "", OptionName)
|
||||
While Not String.IsNullOrWhiteSpace(OptionName)
|
||||
OptionList.Add(New KeyOption(False, True, OptionName))
|
||||
OptionIndex += 1
|
||||
GetMainPrivateProfileString(m_Product.ProductName & " - Option" & nIndex, "Option" & OptionIndex, "", OptionName)
|
||||
End While
|
||||
' Se ho caricato delle opzioni
|
||||
If OptionList.Count > 0 Then
|
||||
' Verifico se ci sono opzioni del prodotto
|
||||
Dim ProductOption As Integer = If(nIndex = 1, m_Product.ProductOption1, m_Product.ProductOption2)
|
||||
Dim nBinaryIndex As Integer = 1
|
||||
For I = 0 To 15
|
||||
If (ProductOption And nBinaryIndex) <> 0 Then
|
||||
OptionList(I).IsChecked = True
|
||||
OptionList(I).IsEnabled = True
|
||||
End If
|
||||
nBinaryIndex *= 2
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CalcOptionDec(OptionList As ObservableCollection(Of KeyOption)) As Integer
|
||||
Dim nDecOption As Integer = 0
|
||||
Dim nBinaryIndex As Integer = 1
|
||||
For I As Integer = 0 To OptionList.Count() - 1
|
||||
If OptionList(I).IsChecked Then
|
||||
nDecOption += nBinaryIndex
|
||||
End If
|
||||
nBinaryIndex *= 2
|
||||
Next
|
||||
Return nDecOption
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateProduct_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
'Calcolo valore decimale opzione1
|
||||
Dim nDecOption1 As Integer = CalcOptionDec(m_NewOption1)
|
||||
Dim nDecOption2 As Integer = CalcOptionDec(m_NewOption2)
|
||||
If Not String.IsNullOrWhiteSpace(NewProductName) OrElse
|
||||
Not NewProductNumber = 0 OrElse
|
||||
Not nDecOption1 = Product.ProductOption1 OrElse
|
||||
Not nDecOption2 = Product.ProductOption2 Then
|
||||
' Cerco nella tabella Product
|
||||
Dim Query As String = "UPDATE " & DB_PRODUCT
|
||||
Dim bFirstWhere As Boolean = True
|
||||
If Not String.IsNullOrWhiteSpace(NewProductName) OrElse
|
||||
Not NewProductNumber = 0 OrElse
|
||||
Not IsNothing(nDecOption1) OrElse
|
||||
Not IsNothing(nDecOption2) Then
|
||||
Query &= " SET "
|
||||
If Not String.IsNullOrWhiteSpace(NewProductName) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTNAME & " = '" & NewProductName & "' "
|
||||
End If
|
||||
If Not NewProductNumber = 0 Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTNUMBER & " = '" & NewProductNumber & "' "
|
||||
End If
|
||||
If Not nDecOption1 = Product.ProductOption1 Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTOPTION1 & " = '" & nDecOption1 & "' "
|
||||
End If
|
||||
If Not nDecOption2 = Product.ProductOption2 Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTOPTION2 & " = '" & nDecOption2 & "' "
|
||||
End If
|
||||
Query &= "WHERE " & DB_PRODUCTID & " = " & Product.ProductID
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
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
|
||||
MessageBox.Show("Completare almeno un campo presente")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub EvalWhere(ByRef bFirst As Boolean, ByRef Query As String)
|
||||
If bFirst Then
|
||||
bFirst = False
|
||||
Else
|
||||
Query &= ", "
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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.SEARCHPRODUCT
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region 'COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<Grid x:Class="UpdateResellerPageV"
|
||||
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 UpdateResellerPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.Row="0">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding UpdateResellerMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</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*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding NameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Name}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<UniformGrid Grid.Row="3"
|
||||
Columns="2"
|
||||
Grid.ColumnSpan="2">
|
||||
|
||||
<Button Content="{Binding UpdateMsg}"
|
||||
Command="{Binding UpdateReseller_Command}"
|
||||
IsDefault="True"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class UpdateResellerPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,144 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class UpdateResellerPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_IdToUpdate As Integer
|
||||
Public Property IdToUpdate As Integer
|
||||
Get
|
||||
Return m_IdToUpdate
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_IdToUpdate = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
NotifyPropertyChanged("Name")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdUpdate As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property UpdateResellerMsg As String
|
||||
Get
|
||||
Return "Update reseller"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property NameMsg As String
|
||||
Get
|
||||
Return "Name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefUpdateResellerPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitUpdateResellerPage()
|
||||
' Svuoto campi
|
||||
' Name = String.Empty
|
||||
Dim Query As String = "SELECT " & DB_RESELLERNAME & " FROM " & DB_RESELLER &
|
||||
" WHERE " & DB_RESELLERID & " LIKE " & IdToUpdate
|
||||
Name = ManageDb.ExecuteStringQuery(Query, DB_RESELLERNAME)(0)
|
||||
NotifyPropertyChanged("Name")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateReseller_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
If Not String.IsNullOrWhiteSpace(Name) Then
|
||||
' Cerco nella tabella Reseller
|
||||
Dim Query As String = "UPDATE " & DB_RESELLER
|
||||
If Not String.IsNullOrWhiteSpace(Name) Then
|
||||
Query &= " SET "
|
||||
If Not String.IsNullOrWhiteSpace(Name) Then
|
||||
Query &= DB_RESELLERNAME & " = '" & Name & "' "
|
||||
End If
|
||||
Query &= "WHERE " & DB_RESELLERID & " = " & IdToUpdate
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
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
|
||||
MessageBox.Show("Completare il campo presente")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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.SEARCHRESELLER
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region 'COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,37 @@
|
||||
<Grid x:Class="UpdateVersionPageV"
|
||||
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 UpdateVersionPageVM}">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
Height="75"
|
||||
Grid.ColumnSpan="2">
|
||||
<TextBlock Height="50"
|
||||
Text="{Binding UpdateVersionMsg}"
|
||||
FontSize="30"
|
||||
TextAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<LicenseManager:VersionPageV Grid.Row="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
|
||||
<UniformGrid Grid.Row="3" Columns="2">
|
||||
<Button Content="{Binding UpdateMsg}"
|
||||
Command="{Binding UpdateVersion_Command}"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
<Button Content="{Binding CancelMsg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource Page_Button}"/>
|
||||
</UniformGrid>
|
||||
|
||||
<!--<TextBlock HorizontalAlignment="Left" Margin="349,72.8,-89,0" Grid.Row="1" TextWrapping="Wrap" Text="Version number" VerticalAlignment="Top" Grid.RowSpan="2"/>-->
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Class UpdateVersionPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,190 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class UpdateVersionPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_IdToUpdate As Integer
|
||||
Public Property IdToUpdate As Integer
|
||||
Get
|
||||
Return m_IdToUpdate
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_IdToUpdate = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductList As List(Of Product)
|
||||
Public ReadOnly Property ProductList As List(Of Product)
|
||||
Get
|
||||
Return m_ProductList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProduct As Product
|
||||
Public Property SelProduct As Product
|
||||
Get
|
||||
Return m_SelProduct
|
||||
End Get
|
||||
Set(value As Product)
|
||||
m_SelProduct = value
|
||||
NotifyPropertyChanged("SelProduct")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_VersionNumber As Integer
|
||||
Public Property VersionNumber As Integer
|
||||
Get
|
||||
Return m_VersionNumber
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_VersionNumber = value
|
||||
NotifyPropertyChanged("VersionNumber")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdUpdate As Command
|
||||
Private m_cmdCancel As Command
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property UpdateVersionMsg As String
|
||||
Get
|
||||
Return "Update version"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductNameMsg As String
|
||||
Get
|
||||
Return "Product name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateMsg As String
|
||||
Get
|
||||
Return "Update"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CancelMsg As String
|
||||
Get
|
||||
Return "Cancel"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Imposto riferimento nella mappa
|
||||
Map.SetRefUpdateVersionPageVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitUpdateVersionPage()
|
||||
|
||||
Dim Query As String = "SELECT * FROM " & DB_VERSION &
|
||||
" WHERE " & DB_VERSIONID & " LIKE " & IdToUpdate
|
||||
VersionNumber = ManageDb.ExecuteVersionQuery(Query)(0).VersionNumber
|
||||
NotifyPropertyChanged("VersionNumber")
|
||||
' Carico lista Product
|
||||
Dim pQuery As String = "SELECT * FROM " & DB_PRODUCT
|
||||
m_ProductList = ManageDb.ExecuteProductQuery(pQuery)
|
||||
NotifyPropertyChanged("ProductList")
|
||||
Dim pvQuery As String = "SELECT * FROM " & DB_PRODUCT &
|
||||
" JOIN " & DB_VERSION &
|
||||
" ON " & DB_PRODUCT & "." & DB_PRODUCTID &
|
||||
"=" & DB_VERSION & "." & DB_PRODUCTID &
|
||||
" WHERE " & DB_VERSIONID & " LIKE " & IdToUpdate
|
||||
SelProduct = ManageDb.ExecuteProductQuery(pvQuery)(0)
|
||||
NotifyPropertyChanged("SelProduct")
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Update"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property UpdateVersion_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdate Is Nothing Then
|
||||
m_cmdUpdate = New Command(AddressOf Update)
|
||||
End If
|
||||
Return m_cmdUpdate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Update(ByVal param As Object)
|
||||
If Not IsNothing(SelProduct) OrElse
|
||||
Not IsNothing(VersionNumber) Then
|
||||
' Aggiorno tabella Version
|
||||
Dim Query As String = "UPDATE " & DB_VERSION
|
||||
Dim bFirstWhere As Boolean = True
|
||||
If Not IsNothing(SelProduct) OrElse
|
||||
Not IsNothing(VersionNumber) Then
|
||||
Query &= " SET "
|
||||
If Not IsNothing(SelProduct) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_PRODUCTID & " = '" & SelProduct.ProductID & "' "
|
||||
End If
|
||||
If Not IsNothing(VersionNumber) Then
|
||||
EvalWhere(bFirstWhere, Query)
|
||||
Query &= DB_VERSIONNUMBER & " = '" & VersionNumber & "' "
|
||||
End If
|
||||
Query &= "WHERE " & DB_VERSIONID & " = " & IdToUpdate
|
||||
Query = Query.TrimEnd(","c, " "c)
|
||||
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
|
||||
MessageBox.Show("Compleatare il campo presente")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub EvalWhere(ByRef bFirst As Boolean, ByRef Query As String)
|
||||
If bFirst Then
|
||||
bFirst = False
|
||||
Else
|
||||
Query &= ", "
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Update
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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.SEARCHVERSION
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region 'COMMANDS
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,534 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:LicenceManager="clr-namespace:LicenseManager"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5">
|
||||
|
||||
<!--
|
||||
Assign a Key to every Panel ViewModel to use
|
||||
it in xaml file(ProjectView.xaml).
|
||||
-->
|
||||
<LicenceManager:MainWindowVM x:Key="MainWindowVM"/>
|
||||
<LicenceManager:MainMenuVM x:Key="MainMenuVM"/>
|
||||
<LicenceManager:NewClientPageVM x:Key="NewClientPageVM"/>
|
||||
<LicenceManager:NewKeyPageVM x:Key="NewKeyPageVM"/>
|
||||
<LicenceManager:NewLicencePageVM x:Key="NewLicencePageVM"/>
|
||||
<LicenceManager:NewProductPageVM x:Key="NewProductPageVM"/>
|
||||
<LicenceManager:NewVersionPageVM x:Key="NewVersionPageVM"/>
|
||||
<LicenceManager:NewResellerPageVM x:Key="NewResellerPageVM"/>
|
||||
<LicenceManager:SearchClientPageVM x:Key="SearchClientPageVM"/>
|
||||
<LicenceManager:SearchKeyPageVM x:Key="SearchKeyPageVM"/>
|
||||
<LicenceManager:SearchLicencePageVM x:Key="SearchLicencePageVM"/>
|
||||
<LicenceManager:SearchProductPageVM x:Key="SearchProductPageVM"/>
|
||||
<LicenceManager:SearchVersionPageVM x:Key="SearchVersionPageVM"/>
|
||||
<LicenceManager:SearchResellerPageVM x:Key="SearchResellerPageVM"/>
|
||||
<LicenceManager:UpdateClientPageVM x:Key="UpdateClientPageVM"/>
|
||||
<LicenceManager:UpdateKeyPageVM x:Key="UpdateKeyPageVM"/>
|
||||
<LicenceManager:UpdateLicencePageVM x:Key="UpdateLicencePageVM"/>
|
||||
<LicenceManager:UpdateProductPageVM x:Key="UpdateProductPageVM"/>
|
||||
<LicenceManager:UpdateVersionPageVM x:Key="UpdateVersionPageVM"/>
|
||||
<LicenceManager:UpdateResellerPageVM x:Key="UpdateResellerPageVM"/>
|
||||
|
||||
<!--<OmagPHOTO:MySceneHostVM x:Key="MySceneHostVM"/>
|
||||
<OmagPHOTO:TopCommandBarVM x:Key="TopCommandBarVM"/>
|
||||
<EgtWPFLib5:StatusBarVM x:Key="StatusBarVM"/>
|
||||
<OmagPHOTO:ProjectVM x:Key="ProjectVM"/>
|
||||
<OmagPHOTO:OptionPanelVM x:Key="OptionPanelVM"/>
|
||||
<OmagPHOTO:ListPageVM x:Key="ListPageVM"/>
|
||||
<OmagPHOTO:DetailPageVM x:Key="DetailPageVM"/>
|
||||
<OmagPHOTO:SearchPanelVM x:Key="SearchPanelVM"/>
|
||||
<EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/>
|
||||
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
|
||||
<EgtWPFLib5:InstrumentPanelVM x:Key="InstrumentPanelVM"/>-->
|
||||
|
||||
<!--Colori predefiniti-->
|
||||
<SolidColorBrush x:Key="Omag_Blue" Color="#FF095CA8" />
|
||||
<SolidColorBrush x:Key="Omag_Yellow" Color="#FFFFCE5B" />
|
||||
<SolidColorBrush x:Key="Omag_Red" Color="Red" />
|
||||
<SolidColorBrush x:Key="Omag_Green" Color="LawnGreen" />
|
||||
<SolidColorBrush x:Key="Omag_VeryLightGray" Color="#FFF2F2F2" />
|
||||
<SolidColorBrush x:Key="Omag_LightGray" Color="LightGray" />
|
||||
<SolidColorBrush x:Key="Omag_Gray" Color="#FF9E9E9E" />
|
||||
<SolidColorBrush x:Key="Omag_DarkGray" Color="#FF444444" />
|
||||
<SolidColorBrush x:Key="Omag_White" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="Omag_Black" Color="#FF000000" />
|
||||
|
||||
<!--Colori per EgtWPFLib5-->
|
||||
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
|
||||
<!--Colori per TabHeader-->
|
||||
<LinearGradientBrush x:Key="TabItem.Static.Background" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="#F0F0F0" Offset="0.0"/>
|
||||
<GradientStop Color="#E5E5E5" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
|
||||
<!--Risorsa che toglie le animazioni dai menù popup per evitare che i menù mru di scelta dei file rimangano aperti se il file è grosso -->
|
||||
<!--o viene eseguito un lua che non aggiorna l'interfaccia-->
|
||||
<PopupAnimation x:Key="{x:Static SystemParameters.MenuPopupAnimationKey}">None</PopupAnimation>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- FocusVisual standard-->
|
||||
<Style x:Key="FocusVisual">
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- Button Style -->
|
||||
|
||||
<SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
|
||||
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
|
||||
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
|
||||
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
|
||||
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
|
||||
<SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
|
||||
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
|
||||
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
|
||||
<SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
||||
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="1"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="border" CornerRadius="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsDefaulted" Value="true">
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
|
||||
<Setter Property="OpacityMask" Value="#54707070"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--Template che permette di andare a capo-->
|
||||
<DataTemplate x:Key="WrapButton_DataTemplate">
|
||||
<TextBlock TextWrapping="WrapWithOverflow" Text="{Binding}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="Page_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="60"/>
|
||||
<Setter Property="Width" Value="170"/>
|
||||
</Style>
|
||||
<Style x:Key="ToolBar_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="80"/>
|
||||
</Style>
|
||||
<Style x:Key="OptionPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="60"/>
|
||||
<Setter Property="Width" Value="60"/>
|
||||
</Style>
|
||||
<Style x:Key="OptionPanel_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
</Style>
|
||||
<Style x:Key="OptionPanel_TextWrapButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource WrapButton_DataTemplate}" />
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
<Setter Property="Height" Value="45"/>
|
||||
</Style>
|
||||
<Style x:Key="OptionPanel_NestingButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="60"/>
|
||||
<Setter Property="Width" Value="60"/>
|
||||
</Style>
|
||||
<Style x:Key="CompoWindow_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="40"/>
|
||||
</Style>
|
||||
<Style x:Key="EgtWPFLib5_InputButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="60"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- ToggleButton Style -->
|
||||
|
||||
<Style TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
||||
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="1"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Border x:Name="border" CornerRadius="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Button.IsDefaulted" Value="true">
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Omag_Yellow}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
|
||||
<Setter Property="OpacityMask" Value="#54707070"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToolBar_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="30"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToolBar_TextToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="70"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OptionPanel_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OptionPanel_NestingToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="60"/>
|
||||
<Setter Property="Width" Value="60"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CompoWindow_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="40"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- TextBlock -->
|
||||
|
||||
<Style x:Key="ParametersTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="Margin" Value="10"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="Margin" Value="10,0,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsToolTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="Margin" Value="10,5,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ValidationErrorTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="FontStyle" Value="Italic"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="Foreground" Value="Red"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="Margin" Value="0,1"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OptionTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- TextBox -->
|
||||
|
||||
<Style TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Height" Value="22"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||
<Setter Property="ExplicitUpdateSource" Value="EnterKeyPress"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToolsTextBox" TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
<Style x:Key="ParameterTextBox" TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Margin" Value="10"/>
|
||||
<Setter Property="Width" Value="170"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsTextBox" TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Margin" Value="0,0,0,10"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsToolTextBox" TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- MachGroup -->
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBar.Static.Background" Color="#F0F0F0"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Static.Border" Color="#F0F0F0"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Pressed.Glyph" Color="#FFFFFF"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.MouseOver.Glyph" Color="#000000"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Disabled.Glyph" Color="#BFBFBF"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Static.Glyph" Color="#606060"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.MouseOver.Background" Color="#DADADA"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.MouseOver.Border" Color="#DADADA"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Pressed.Background" Color="#606060"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Pressed.Border" Color="#606060"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Disabled.Background" Color="#F0F0F0"/>
|
||||
<SolidColorBrush x:Key="ScrollBar.Disabled.Border" Color="#F0F0F0"/>
|
||||
<Style x:Key="CustomScrollBarButton" TargetType="{x:Type RepeatButton}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="1"/>
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||
<Border x:Name="border" CornerRadius="3" BorderBrush="{StaticResource ScrollBar.Static.Border}" BorderThickness="1" Background="{StaticResource ScrollBar.Static.Background}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource ScrollBar.MouseOver.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollBar.MouseOver.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource ScrollBar.Pressed.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollBar.Pressed.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource ScrollBar.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollBar.Disabled.Border}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- Border -->
|
||||
|
||||
<Style x:Key="DefaultBorder" TargetType="{x:Type Border}">
|
||||
<Setter Property="BorderBrush" Value="#D5DFE5"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
<Setter Property="Padding" Value="3"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Border" TargetType="{x:Type Border}">
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
<Setter Property="Padding" Value="3"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- EgtCustomWindow -->
|
||||
|
||||
<Style TargetType="{x:Type EgtWPFLib5:EgtCustomWindow}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtCustomWindow}}">
|
||||
<Setter Property="TitleBarHeight" Value="32"/>
|
||||
<Setter Property="TitleBarBrush" Value="{StaticResource Omag_LightGray}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- EgtFloatingPanel -->
|
||||
|
||||
<Style x:Key="ToolBar_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
|
||||
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
|
||||
<Setter Property="IsFloating" Value="False"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Option_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
|
||||
<Setter Property="TitleBarOrientation" Value="Vertical"/>
|
||||
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
|
||||
<Setter Property="IsFloating" Value="False"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- CsvTreeViewItem DA CAMBIARE!! -->
|
||||
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Fill" Color="#FF595959"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Stroke" Color="#FF262626"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Stroke" Color="#FF1BBBFA"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Fill" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Stroke" Color="#FF262626"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Fill" Color="#FF595959"/>
|
||||
<PathGeometry x:Key="TreeArrow" Figures="M0,0 L0,6 L6,0 z"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Fill" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Stroke" Color="#FF989898"/>
|
||||
<Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Width" Value="16"/>
|
||||
<Setter Property="Height" Value="16"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Border Background="Transparent" Height="16" Padding="5,5,5,5" Width="16">
|
||||
<Path x:Name="ExpandPath" Data="{StaticResource TreeArrow}" Fill="{StaticResource TreeViewItem.TreeArrow.Static.Fill}" Stroke="{StaticResource TreeViewItem.TreeArrow.Static.Stroke}">
|
||||
<Path.RenderTransform>
|
||||
<RotateTransform Angle="135" CenterY="3" CenterX="3"/>
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="RenderTransform" TargetName="ExpandPath">
|
||||
<Setter.Value>
|
||||
<RotateTransform Angle="180" CenterY="3" CenterX="3"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Fill}"/>
|
||||
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Stroke}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Stroke}"/>
|
||||
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Fill}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="True"/>
|
||||
<Condition Property="IsChecked" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Stroke}"/>
|
||||
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Fill}"/>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CsvPartItemStyle" TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TreeViewItem}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="19" Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border x:Name="ExpanderBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
|
||||
</Border>
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Border>
|
||||
<ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsExpanded" Value="false">
|
||||
<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter Property="Background" TargetName="Bd" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1"/>
|
||||
<Setter Property="Background" TargetName="ExpanderBorder" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" TargetName="ExpanderBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" TargetName="ExpanderBorder" Value="1,1,0,1"/>
|
||||
<!--<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>-->
|
||||
</Trigger>
|
||||
<!--<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="true"/>
|
||||
<Condition Property="IsSelectionActive" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
</MultiTrigger>-->
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- ComboBox -->
|
||||
|
||||
<Style x:Key="ParametersComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter Property="Margin" Value="10"/>
|
||||
<Setter Property="Height" Value="24"/>
|
||||
<Setter Property="Width" Value="170"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MachiningsToolComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- CheckBox -->
|
||||
|
||||
<Style x:Key="OptionCheckBox" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource {x:Type CheckBox}}">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="Margin" Value="10,0,0,0"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,30 @@
|
||||
Public Class Dictionary
|
||||
|
||||
Public Shared ReadOnly MySceneHostVM As String = "MySceneHostVM"
|
||||
|
||||
#Region "Colors"
|
||||
|
||||
'Private m_Omag_Red As SolidColorBrush = Brushes.Red
|
||||
'Public ReadOnly Property Omag_Red As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Omag_Red
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Button_Static_Background As SolidColorBrush = New BrushConverter().ConvertFrom("#FFDDDDDD")
|
||||
'Public Shared ReadOnly Property Button_Static_Background As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Button_Static_Background
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_TabControl_Header_Background As LinearGradientBrush = Application.Current.FindResource("TabItem.Static.Background")
|
||||
'Public Shared ReadOnly Property TabControl_Header_Background As LinearGradientBrush
|
||||
' Get
|
||||
' Return m_TabControl_Header_Background
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
#End Region ' Colors
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,67 @@
|
||||
Imports System.IO
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Text
|
||||
|
||||
Public Class IniManager
|
||||
|
||||
#Region "METODO NON FUNZIONANTE"
|
||||
|
||||
<DllImport("kernel32")>
|
||||
Public Shared Function GetPrivateProfileString(ByVal section As String, ByVal key As String,
|
||||
ByVal def As String, ByVal retVal As StringBuilder,
|
||||
ByVal size As Integer, ByVal filePath As String) As Integer
|
||||
End Function
|
||||
|
||||
Public Function GetIniValue(section As String, key As String, filename As String, Optional defaultValue As String = "") As String
|
||||
Dim sb As New StringBuilder(500)
|
||||
If GetPrivateProfileString(section, key, defaultValue, sb, sb.Capacity, filename) > 0 Then
|
||||
Return sb.ToString
|
||||
Else
|
||||
Return defaultValue
|
||||
End If
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "METODO FUNZIONANTE"
|
||||
|
||||
Public Function ReadIni() As String
|
||||
Dim reader As StreamReader = My.Computer.FileSystem.OpenTextFileReader("C:\EgtProg\LicenceManager\config.ini")
|
||||
|
||||
Dim a As String
|
||||
Dim result As String = ""
|
||||
Do
|
||||
a = reader.ReadLine
|
||||
If (a Is Nothing) Then Exit Do
|
||||
Dim fileline As String = a.Trim()
|
||||
If (fileline.StartsWith("[") And fileline.EndsWith("]")) Then Continue Do
|
||||
'
|
||||
' Code here
|
||||
'
|
||||
Dim index As Integer = fileline.IndexOf("=")
|
||||
If (index < 0) Then Continue Do
|
||||
Dim key As String = fileline.Substring(0, index).Trim()
|
||||
' Dim ID As String = fileline.Substring(0, fileline.IndexOf(":"))
|
||||
Dim value As String = fileline.Substring(index + 1).Trim()
|
||||
' String comment = ""
|
||||
index = value.IndexOf("'")
|
||||
If (index > -1) Then
|
||||
' ID = fileline.Substring(0, fileline.IndexOf(":"))
|
||||
' comment = value.Substring(index).Trim()
|
||||
value = value.Substring(0, index).Trim()
|
||||
End If
|
||||
result &= key & "=" & value & ";"
|
||||
Loop Until a Is Nothing
|
||||
' result.TrimEnd(";")
|
||||
reader.Close()
|
||||
Return result
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
'Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
||||
' Debug.WriteLine(GetIniValue("B_Empty_IndexList", "Count", My.Application.Info.DirectoryPath & "\WorldInfo.ini"))
|
||||
' Debug.WriteLine(GetIniValue("B_Use_IndexList", "Count", My.Application.Info.DirectoryPath & "\WorldInfo.ini"))
|
||||
'End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,451 @@
|
||||
Imports MySql.Data.MySqlClient
|
||||
|
||||
|
||||
Module ManageDb
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Dim Ini As New IniManager
|
||||
Private m_DbPath As String = Ini.ReadIni() ' GetIniValue("Connection", "Server", "C:\\EgtDev\\LicenseManager2\\config.ini") ' DB_CONNECTIONSTRING
|
||||
' Private m_DbPath As String = DB_CONNECTIONSTRING
|
||||
|
||||
Private m_DbConnection As MySqlConnection = New MySqlConnection(m_DbPath)
|
||||
|
||||
Public ReadOnly Property DbConnection As MySqlConnection
|
||||
Get
|
||||
Return m_DbConnection
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
'Friend Sub CreateDbFile()
|
||||
' SQLiteConnection.CreateFile(Map.refMainWindowVM.MainWindowM.sDataDir & "\" & DB_FILENAME)
|
||||
'End Sub
|
||||
|
||||
Friend Function ConnectToDb() As Boolean
|
||||
Dim DbPath As String = DB_CONNECTIONSTRING ' Map.refMainWindowVM.MainWindowM.sDataDir & "\" & DB_FILENAME
|
||||
m_DbPath = DbPath
|
||||
' If Not File.Exists(DbPath) Then Return False
|
||||
m_DbConnection = New MySqlConnection(DbPath)
|
||||
Return Not IsNothing(m_DbConnection)
|
||||
End Function
|
||||
|
||||
Friend Function ConnectToDb(DbPath As String) As Boolean
|
||||
'If Not File.Exists(DbPath) Then
|
||||
' Return False
|
||||
'End If
|
||||
m_DbPath = DbPath
|
||||
m_DbConnection = New MySqlConnection(DbPath)
|
||||
Return Not IsNothing(m_DbConnection)
|
||||
End Function
|
||||
|
||||
Friend Sub CreateTable()
|
||||
|
||||
Dim MySqlCommand As String
|
||||
|
||||
MySqlCommand = "CREATE TABLE " & DB_RESELLER & " (" & DB_RESELLERID & " INTEGER PRIMARY KEY, " &
|
||||
DB_RESELLERNAME & " TEXT)"
|
||||
ExecuteQuery(MySqlCommand)
|
||||
|
||||
MySqlCommand = "CREATE TABLE " & DB_CLIENT & " (" & DB_NAME & " TEXT, " &
|
||||
DB_RESELLERID & " INTEGER," &
|
||||
DB_CLIENTID & " INTEGER PRIMARY KEY, " &
|
||||
"FOREIGN KEY (" & DB_RESELLERID & ") REFERENCES " & DB_RESELLER & " (" & DB_RESELLERID & "))"
|
||||
ExecuteQuery(MySqlCommand)
|
||||
|
||||
MySqlCommand = "CREATE TABLE " & DB_KEY & " (" & DB_NUMBER & " INTEGER, " &
|
||||
DB_CLIENTID & " INTEGER, " &
|
||||
DB_ISDONGLE & " INTEGER, " &
|
||||
DB_LOCKID & " VARCHAR(45) PRIMARY KEY, " & ' " TEXT PRIMARY KEY, " &
|
||||
"FOREIGN KEY (" & DB_CLIENTID & ") REFERENCES " & DB_CLIENT & " (" & DB_CLIENTID & "))"
|
||||
ExecuteQuery(MySqlCommand)
|
||||
|
||||
MySqlCommand = "CREATE TABLE " & DB_LICENCE & " (" & DB_LICENCEID & " INTEGER PRIMARY KEY, " &
|
||||
DB_PRODUCTID & " INTEGER, " &
|
||||
DB_PRODUCTVERSION & " INTEGER, " & ' " TEXT, " &
|
||||
DB_PRODUCTLEVEL & " INTEGER, " &
|
||||
DB_PRODUCTDEADLINE & " DATE, " & ' " INTEGER, " &
|
||||
DB_OPTION1 & " INTEGER, " &
|
||||
DB_OPTION2 & " INTEGER, " &
|
||||
DB_OPTIONDEADLINE & " DATE, " & ' " INTEGER, " &
|
||||
DB_LOCKID & " VARCHAR(45), " & ' " TEXT, " &
|
||||
DB_FILE & " VARCHAR(45), " & ' " TEXT, " &
|
||||
"FOREIGN KEY (" & DB_LOCKID & ") REFERENCES " & DB_KEY & " (" & DB_LOCKID & "), " &
|
||||
"FOREIGN KEY (" & DB_PRODUCTID & ") REFERENCES " & DB_PRODUCT & " (" & DB_PRODUCTID & "))"
|
||||
ExecuteQuery(MySqlCommand)
|
||||
|
||||
MySqlCommand = "CREATE TABLE " & DB_PRODUCT & " (" & DB_PRODUCTID & " INTEGER PRIMARY KEY, " &
|
||||
DB_PRODUCTNAME & " TEXT, " &
|
||||
DB_PRODUCTNUMBER & " INTEGER, " &
|
||||
DB_PRODUCTOPTION1 & " INTEGER, " &
|
||||
DB_PRODUCTOPTION2 & " INTEGER)"
|
||||
ExecuteQuery(MySqlCommand)
|
||||
|
||||
MySqlCommand = "CREATE TABLE " & DB_VERSION & " (" & DB_VERSIONID & " INTEGER PRIMARY KEY, " &
|
||||
DB_PRODUCTID & " INTEGER, " &
|
||||
DB_VERSIONNUMBER & " INTEGER, " &
|
||||
"FOREIGN KEY (" & DB_PRODUCTID & ") REFERENCES " & DB_PRODUCT & " (" & DB_PRODUCTID & "))"
|
||||
ExecuteQuery(MySqlCommand)
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Function ExecuteQuery(MySqlQuery As String) As Integer
|
||||
Dim ModifiedRowNumber As Integer
|
||||
Try
|
||||
m_DbConnection.Open()
|
||||
Dim Command As MySqlCommand = New MySqlCommand(MySqlQuery, m_DbConnection)
|
||||
ModifiedRowNumber = Command.ExecuteNonQuery()
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
Finally
|
||||
m_DbConnection.Close()
|
||||
End Try
|
||||
Return ModifiedRowNumber
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteReaderQuery(SqlQuery As String) As MySqlDataReader
|
||||
Dim Command As MySqlCommand = New MySqlCommand(SqlQuery, m_DbConnection)
|
||||
Dim Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
Return Reader
|
||||
End Function
|
||||
|
||||
'Friend Function ExecuteVersionQuery(SqlQuery As String) As List(Of Version)
|
||||
' ManageDb.DbConnection.Open()
|
||||
' Dim Command As SQLiteCommand = New SQLiteCommand(SqlQuery, m_DbConnection)
|
||||
' Dim Reader As SQLiteDataReader = Command.ExecuteReader()
|
||||
' Dim VersionList As New List(Of Version)
|
||||
' While Reader.Read()
|
||||
' VersionList.Add(New Version(Reader))
|
||||
' End While
|
||||
' ManageDb.DbConnection.Close()
|
||||
' Return VersionList
|
||||
'End Function
|
||||
|
||||
Friend Function ExecuteStringQuery(MySqlQuery As String, ResColumnName As String) As List(Of String)
|
||||
Dim StringList As New List(Of String)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
StringList.Add(CType(Reader(ResColumnName), String))
|
||||
End While
|
||||
If IsNothing(StringList) Then
|
||||
StringList.Add(String.Empty)
|
||||
End If
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return StringList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteIntegerQuery(MySqlQuery As String, ResColumnName As String) As List(Of Integer)
|
||||
Dim IntegerList As New List(Of Integer)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
IntegerList.Add(CInt(Reader(ResColumnName)))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return IntegerList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteClientQuery(MySqlQuery As String) As List(Of Client)
|
||||
Dim ClientList As New List(Of Client)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
ClientList.Add(New Client(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return ClientList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteKeyQuery(MySqlQuery As String) As List(Of Key)
|
||||
Dim KeyList As New List(Of Key)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
KeyList.Add(New Key(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return KeyList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteProductQuery(MySqlQuery As String) As List(Of Product)
|
||||
Dim ProductList As New List(Of Product)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
ProductList.Add(New Product(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return ProductList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteVersionQuery(MySqlQuery As String) As List(Of Version)
|
||||
Dim VersionList As New List(Of Version)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
VersionList.Add(New Version(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return VersionList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteNumberQuery(MySqlQuery As String) As Integer
|
||||
Dim Number As Integer
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
Reader.Read()
|
||||
Number = If(Reader(DB_MAXNUMBER) Is DBNull.Value, 0, CInt(Reader(DB_MAXNUMBER)))
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return Number
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteResellerQuery(MySqlQuery As String) As List(Of Reseller)
|
||||
Dim ResellerList As New List(Of Reseller)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
ResellerList.Add(New Reseller(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return ResellerList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteSearchClientQuery(MySqlQuery As String) As List(Of SearchClient)
|
||||
Dim ClientList As New List(Of SearchClient)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
ClientList.Add(New SearchClient(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return ClientList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteSearchKeyQuery(MySqlQuery As String) As List(Of SearchKey)
|
||||
Dim KeyList As New List(Of SearchKey)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
KeyList.Add(New SearchKey(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return KeyList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteSearchLicenceQuery(MySqlQuery As String) As List(Of SearchLicence)
|
||||
Dim LicenceList As New List(Of SearchLicence)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
LicenceList.Add(New SearchLicence(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return LicenceList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteSearchProductQuery(MySqlQuery As String) As List(Of Product)
|
||||
Dim ProductList As New List(Of Product)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
ProductList.Add(New Product(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return ProductList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteSearchVersionQuery(MySqlQuery As String) As List(Of SearchVersion)
|
||||
Dim VersionList As New List(Of SearchVersion)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
VersionList.Add(New SearchVersion(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return VersionList
|
||||
End Function
|
||||
|
||||
Friend Function ExecuteSearchResellerQuery(MySqlQuery As String) As List(Of SearchReseller)
|
||||
Dim ResellerList As New List(Of SearchReseller)
|
||||
Try
|
||||
Using DbConnection As New MySqlConnection(m_DbPath)
|
||||
DbConnection.Open()
|
||||
Using Command As MySqlCommand = New MySqlCommand(MySqlQuery, DbConnection)
|
||||
Using Reader As MySqlDataReader = Command.ExecuteReader()
|
||||
While Reader.Read()
|
||||
ResellerList.Add(New SearchReseller(Reader))
|
||||
End While
|
||||
End Using
|
||||
End Using
|
||||
DbConnection.Close()
|
||||
End Using
|
||||
Catch ex As MySqlException
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
Return ResellerList
|
||||
End Function
|
||||
|
||||
|
||||
Friend Sub AddRandomRows(nRow As Integer)
|
||||
Dim ImagePathList() As String = {"c:\EgtData\OmagPHOTO\Data\Lastra15_18.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Lastra18_10.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Lastra313.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Lastra313_b.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Lastra3138bit.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Lastra33-18_234.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Lastra55_33.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Lastra55-23.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Prova1.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Prova2.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Prova3.jpg",
|
||||
"c:\EgtData\OmagPHOTO\Data\Prova4.jpg"}
|
||||
Dim Text As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
For i = 0 To nRow
|
||||
Dim R As New Random()
|
||||
Dim Name As String = "Lastra" & i
|
||||
Dim ImagePath As String = ImagePathList(R.Next(0, ImagePathList.Length))
|
||||
'Dim SlabState As String = Map.refOptionPanelVM.StateList(R.Next(0, Map.refOptionPanelVM.StateList.Count)).Id.ToString
|
||||
'Dim Material As String = Map.refOptionPanelVM.MaterialList(R.Next(0, Map.refOptionPanelVM.MaterialList.Count))
|
||||
Dim SlabThickness As String = (R.Next(200, 700) / 10).ToString
|
||||
Dim WarehousePosition As String = Text(R.Next(Text.Length)) & R.Next(1, 100) & "." & R.Next(1, 100)
|
||||
Dim AddedDate As DateTime = DateTime.Now - New TimeSpan(R.Next(0, 730), R.Next(0, 24), R.Next(0, 60), R.Next(0, 60))
|
||||
' Aggiungo la nuova lastra al Db
|
||||
'Dim Query As String = "INSERT INTO " & Slab.DB_SLABS & " (" & Slab.DB_ID & ", " & Slab.DB_IMAGEPATH & ", " & Slab.DB_STATE & ", " & Slab.DB_PROJASSIGNEDTO & ", " & Slab.DB_MATERIAL & ", " & Slab.DB_THICKNESS & ", " & Slab.DB_WAREHOUSEPOS & ", " & Slab.DB_ADDEDDATE & ")" &
|
||||
' " VALUES ('" & Name & "', " &
|
||||
' "'" & ImagePath & "', " &
|
||||
' SlabState & ", " &
|
||||
' "'" & "C:\EgtData\OmagOFFICE\Progetto" & i & "', " &
|
||||
' "'" & Material & "', " &
|
||||
' SlabThickness & ", " &
|
||||
' "'" & WarehousePosition & "', " &
|
||||
' "Date('" & (String.Format("{0:yyyy-MM-dd}", AddedDate)) & "'))"
|
||||
'ManageDb.ExecuteQuery(Query)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Module
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Module Map
|
||||
|
||||
Private m_refMainWindowVM As MainWindowVM
|
||||
Private m_refNewClientPageVM As NewClientPageVM
|
||||
Private m_refNewKeyPageVM As NewKeyPageVM
|
||||
Private m_refNewLicencePageVM As NewLicencePageVM
|
||||
Private m_refNewProductPageVM As NewProductPageVM
|
||||
Private m_refNewVersionPageVM As NewVersionPageVM
|
||||
Private m_refNewResellerPageVM As NewResellerPageVM
|
||||
Private m_refSearchClientPageVM As SearchClientPageVM
|
||||
Private m_refSearchKeyPageVM As SearchKeyPageVM
|
||||
Private m_refSearchLicencePageVM As SearchLicencePageVM
|
||||
Private m_refSearchProductPageVM As SearchProductPageVM
|
||||
Private m_refSearchVersionPageVM As SearchVersionPageVM
|
||||
Private m_refSearchResellerPageVM As SearchResellerPageVM
|
||||
Private m_refUpdateClientPageVM As UpdateClientPageVM
|
||||
Private m_refUpdateKeyPageVM As UpdateKeyPageVM
|
||||
Private m_refUpdateLicencePageVM As UpdateLicencePageVM
|
||||
Private m_refUpdateProductPageVM As UpdateProductPageVM
|
||||
Private m_refUpdateVersionPageVM As UpdateVersionPageVM
|
||||
Private m_refUpdateResellerPageVM As UpdateResellerPageVM
|
||||
|
||||
#Region "Get"
|
||||
|
||||
Public ReadOnly Property refMainWindowVM As MainWindowVM
|
||||
Get
|
||||
Return m_refMainWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refNewClientPageVM As NewClientPageVM
|
||||
Get
|
||||
Return m_refNewClientPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refNewKeyPageVM As NewKeyPageVM
|
||||
Get
|
||||
Return m_refNewKeyPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refNewLicencePageVM As NewLicencePageVM
|
||||
Get
|
||||
Return m_refNewLicencePageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refNewProductPageVM As NewProductPageVM
|
||||
Get
|
||||
Return m_refNewProductPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refNewVersionPageVM As NewVersionPageVM
|
||||
Get
|
||||
Return m_refNewVersionPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refNewResellerPageVM As NewResellerPageVM
|
||||
Get
|
||||
Return m_refNewResellerPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSearchClientPageVM As SearchClientPageVM
|
||||
Get
|
||||
Return m_refSearchClientPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSearchKeyPageVM As SearchKeyPageVM
|
||||
Get
|
||||
Return m_refSearchKeyPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSearchLicencePageVM As SearchLicencePageVM
|
||||
Get
|
||||
Return m_refSearchLicencePageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSearchProductPageVM As SearchProductPageVM
|
||||
Get
|
||||
Return m_refSearchProductPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSearchVersionPageVM As SearchVersionPageVM
|
||||
Get
|
||||
Return m_refSearchVersionPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSearchResellerPageVM As SearchResellerPageVM
|
||||
Get
|
||||
Return m_refSearchResellerPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refUpdateClientPageVM As UpdateClientPageVM
|
||||
Get
|
||||
Return m_refUpdateClientPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refUpdateKeyPageVM As UpdateKeyPageVM
|
||||
Get
|
||||
Return m_refUpdateKeyPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refUpdateLicencePageVM As UpdateLicencePageVM
|
||||
Get
|
||||
Return m_refUpdateLicencePageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refUpdateProductPageVM As UpdateProductPageVM
|
||||
Get
|
||||
Return m_refUpdateProductPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refUpdateVersionPageVM As UpdateVersionPageVM
|
||||
Get
|
||||
Return m_refUpdateVersionPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refUpdateResellerPageVM As UpdateResellerPageVM
|
||||
Get
|
||||
Return m_refUpdateResellerPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#End Region ' Get
|
||||
|
||||
#Region "Set"
|
||||
|
||||
Friend Function SetRefNewClientPageVM(NewClientPageVM As NewClientPageVM) As Boolean
|
||||
m_refNewClientPageVM = NewClientPageVM
|
||||
Return Not IsNothing(m_refNewClientPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefNewKeyPageVM(NewKeyPageVM As NewKeyPageVM) As Boolean
|
||||
m_refNewKeyPageVM = NewKeyPageVM
|
||||
Return Not IsNothing(m_refNewKeyPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefNewLicencePageVM(NewLicencePageVM As NewLicencePageVM) As Boolean
|
||||
m_refNewLicencePageVM = NewLicencePageVM
|
||||
Return Not IsNothing(m_refNewLicencePageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefNewProductPageVM(NewProductPageVM As NewProductPageVM) As Boolean
|
||||
m_refNewProductPageVM = NewProductPageVM
|
||||
Return Not IsNothing(m_refNewProductPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefNewVersionPageVM(NewVersionPageVM As NewVersionPageVM) As Boolean
|
||||
m_refNewVersionPageVM = NewVersionPageVM
|
||||
Return Not IsNothing(m_refNewVersionPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefNewResellerPageVM(NewResellerPageVM As NewResellerPageVM) As Boolean
|
||||
m_refNewResellerPageVM = NewResellerPageVM
|
||||
Return Not IsNothing(m_refNewResellerPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefSearchClientPageVM(SearchClientPageVM As SearchClientPageVM) As Boolean
|
||||
m_refSearchClientPageVM = SearchClientPageVM
|
||||
Return Not IsNothing(m_refSearchClientPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefSearchKeyPageVM(SearchKeyPageVM As SearchKeyPageVM) As Boolean
|
||||
m_refSearchKeyPageVM = SearchKeyPageVM
|
||||
Return Not IsNothing(m_refSearchKeyPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefSearchLicencePageVM(SearchLicencePageVM As SearchLicencePageVM) As Boolean
|
||||
m_refSearchLicencePageVM = SearchLicencePageVM
|
||||
Return Not IsNothing(m_refSearchLicencePageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefSearchProductPageVM(SearchProductPageVM As SearchProductPageVM) As Boolean
|
||||
m_refSearchProductPageVM = SearchProductPageVM
|
||||
Return Not IsNothing(m_refSearchProductPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefSearchVersionPageVM(SearchVersionPageVM As SearchVersionPageVM) As Boolean
|
||||
m_refSearchVersionPageVM = SearchVersionPageVM
|
||||
Return Not IsNothing(m_refSearchVersionPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefSearchResellerPageVM(SearchResellerPageVM As SearchResellerPageVM) As Boolean
|
||||
m_refSearchResellerPageVM = SearchResellerPageVM
|
||||
Return Not IsNothing(m_refSearchResellerPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefUpdateClientPageVM(UpdateClientPageVM As UpdateClientPageVM) As Boolean
|
||||
m_refUpdateClientPageVM = UpdateClientPageVM
|
||||
Return Not IsNothing(m_refUpdateClientPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefUpdateKeyPageVM(UpdateKeyPageVM As UpdateKeyPageVM) As Boolean
|
||||
m_refUpdateKeyPageVM = UpdateKeyPageVM
|
||||
Return Not IsNothing(m_refUpdateKeyPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefUpdateLicencePageVM(UpdateLicencePageVM As UpdateLicencePageVM) As Boolean
|
||||
m_refUpdateLicencePageVM = UpdateLicencePageVM
|
||||
Return Not IsNothing(m_refUpdateLicencePageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefUpdateProductPageVM(UpdateProductPageVM As UpdateProductPageVM) As Boolean
|
||||
m_refUpdateProductPageVM = UpdateProductPageVM
|
||||
Return Not IsNothing(m_refUpdateProductPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefUpdateVersionPageVM(UpdateVersionPageVM As UpdateVersionPageVM) As Boolean
|
||||
m_refUpdateVersionPageVM = UpdateVersionPageVM
|
||||
Return Not IsNothing(m_refUpdateVersionPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefUpdateResellerPageVM(UpdateResellerPageVM As UpdateResellerPageVM) As Boolean
|
||||
m_refUpdateResellerPageVM = UpdateResellerPageVM
|
||||
Return Not IsNothing(m_refUpdateResellerPageVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Set
|
||||
|
||||
#Region "Init"
|
||||
|
||||
Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean
|
||||
m_refMainWindowVM = MainWindowVM
|
||||
Return Not IsNothing(m_refMainWindowVM)
|
||||
End Function
|
||||
|
||||
Friend Function EndInit() As Boolean
|
||||
' Verifico se tutti i pezzi necessari sono stati caricati
|
||||
Return Not IsNothing(m_refMainWindowVM) AndAlso LibMap.EndInit 'AndAlso Not IsNothing(m_refProjectVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Init
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,39 @@
|
||||
<Grid x:Class="VersionPageV"
|
||||
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">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Text="{Binding VersionNumberMsg}"-->
|
||||
<TextBlock Text="Version number"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding VersionNumber}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource ParameterTextBox}"/>
|
||||
|
||||
<TextBlock Text="{Binding ProductNameMsg}"
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersTextBlock}"/>
|
||||
|
||||
<ComboBox Name="ProductComboBox"
|
||||
ItemsSource="{Binding ProductList}"
|
||||
SelectedItem="{Binding SelProduct, Mode=TwoWay}"
|
||||
DisplayMemberPath="ProductName"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource ParametersComboBox}"/>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,20 @@
|
||||
Class VersionPageV
|
||||
|
||||
Private Sub ProductComboBox_Loaded(sender As Object, e As RoutedEventArgs) Handles ProductComboBox.Loaded
|
||||
''Dim pvQuery As String = "SELECT * FROM " & DB_PRODUCT &
|
||||
'' " JOIN " & DB_VERSION &
|
||||
'' " ON " & DB_PRODUCT & "." & DB_PRODUCTID &
|
||||
'' "=" & DB_VERSION & "." & DB_PRODUCTID &
|
||||
'' " WHERE " & DB_VERSIONID & " LIKE " & IdToUpdate
|
||||
'ProductComboBox.SelectedItem = ProductComboBox.Items(1) ' ManageDb.ExecuteProductQuery(pvQuery)(0)
|
||||
'Dim i = 0
|
||||
'For Each item In ProductComboBox.Items
|
||||
' ' If ((Product)item.DB_ProductID.Equals(IdToUpdate)) Then
|
||||
' If (ProductComboBox.Items(i).Equals(IdToUpdate)) Then
|
||||
' ProductComboBox.SelectedItem = ProductComboBox.Items(i)
|
||||
' End If
|
||||
' i = i + 1
|
||||
'Next
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
@@ -0,0 +1,81 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class VersionPageVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_VersionId As Integer
|
||||
Public Property VersionId As Integer
|
||||
Get
|
||||
Return m_VersionId
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_VersionId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_VersionNumber As Integer
|
||||
Public Property VersionNumber As String
|
||||
Get
|
||||
Return m_VersionNumber.ToString()
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_VersionNumber = value
|
||||
NotifyPropertyChanged("VersionNumber")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ProductList As List(Of Product)
|
||||
Public ReadOnly Property ProductList As List(Of Product)
|
||||
Get
|
||||
Return m_ProductList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelProduct As Product
|
||||
Public Property SelProduct As Product
|
||||
Get
|
||||
Return m_SelProduct
|
||||
End Get
|
||||
Set(value As Product)
|
||||
m_SelProduct = value
|
||||
NotifyPropertyChanged("SelProduct")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property VersionNumberMsg As String
|
||||
Get
|
||||
Return "Version number"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ProductNameMsg As String
|
||||
Get
|
||||
Return "Product name"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub InitVersionPage()
|
||||
' Svuoto campi
|
||||
m_VersionNumber = Nothing ' 1
|
||||
NotifyPropertyChanged("VersionNumber")
|
||||
|
||||
' Carico lista Product
|
||||
Dim Query As String = "SELECT * FROM " & DB_PRODUCT
|
||||
m_ProductList = ManageDb.ExecuteProductQuery(Query)
|
||||
NotifyPropertyChanged("ProductList")
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user