150 lines
4.2 KiB
VB.net
150 lines
4.2 KiB
VB.net
Imports EgtBEAMWALL.Core
|
|
|
|
Public Class MainWindowVM
|
|
|
|
Private m_SupervisorId As String = "A"
|
|
Private m_SupervisorMachineName As String = "Essetre-FAST"
|
|
|
|
Private m_MachGroupList As New List(Of MyMachGroupM)
|
|
Public Property MachGroupList As List(Of MyMachGroupM)
|
|
Get
|
|
Return m_MachGroupList
|
|
End Get
|
|
Set(value As List(Of MyMachGroupM))
|
|
m_MachGroupList = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_SelMachGroup As MyMachGroupM
|
|
Public Property SelMachGroup As MyMachGroupM
|
|
Get
|
|
Return m_SelMachGroup
|
|
End Get
|
|
Set(value As MyMachGroupM)
|
|
m_SelMachGroup = value
|
|
End Set
|
|
End Property
|
|
|
|
' Definizione comandi
|
|
Private m_cmdDeleteRawPart As ICommand
|
|
Private m_cmdMoveUpRawPart As ICommand
|
|
Private m_cmdMoveDownRawPart As ICommand
|
|
Private m_cmdCompletedRawPart As ICommand
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
'' Avvio l'inizializzazione della mappa passandogli il riferimento al MainWindowVM
|
|
'Map.BeginInit(Me)
|
|
'' Creo Model della MainWindow
|
|
'm_MainWindowM = New MainWindowM
|
|
Dim TempList As List(Of DataLayer.DatabaseModels.MachGroupModel) = DbControllers.m_MachGroupController.GetByProdSupervisor(1, m_SupervisorId)
|
|
For Each MachGroup In TempList
|
|
'''m_MachGroupList.Add(New BeamMachGroupM(MachGroup.MachGroupDbId, MachGroup.Name, m_SupervisorMachineName))
|
|
Next
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "CompletedRawPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property CompletedRawPart_Command As ICommand
|
|
Get
|
|
If m_cmdCompletedRawPart Is Nothing Then
|
|
m_cmdCompletedRawPart = New Command(AddressOf CompletedRawPart)
|
|
End If
|
|
Return m_cmdCompletedRawPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub CompletedRawPart()
|
|
If IsNothing(m_SelMachGroup) Then Return
|
|
DbControllers.m_MachGroupController.UpdateStatus(m_SelMachGroup.Id, ItemState.Produced)
|
|
End Sub
|
|
|
|
#End Region ' CompletedRawPart
|
|
|
|
#Region "DeleteRawPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property DeleteRawPart_Command As ICommand
|
|
Get
|
|
If m_cmdDeleteRawPart Is Nothing Then
|
|
m_cmdDeleteRawPart = New Command(AddressOf DeleteRawPart)
|
|
End If
|
|
Return m_cmdDeleteRawPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub DeleteRawPart()
|
|
If IsNothing(m_SelMachGroup) Then Return
|
|
DbControllers.m_MachGroupController.UpdateSupervisor(1, m_SelMachGroup.Id, DbControllers.m_SupervisorId)
|
|
End Sub
|
|
|
|
#End Region ' DeleteRawPart
|
|
|
|
#Region "MoveUpRawPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property MoveUpRawPart_Command As ICommand
|
|
Get
|
|
If m_cmdMoveUpRawPart Is Nothing Then
|
|
m_cmdMoveUpRawPart = New Command(AddressOf MoveUpRawPart)
|
|
End If
|
|
Return m_cmdMoveUpRawPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub MoveUpRawPart()
|
|
If IsNothing(m_SelMachGroup) Then Return
|
|
DbControllers.m_MachGroupController.UpdateStatus(m_SelMachGroup.Id, ItemState.Produced)
|
|
End Sub
|
|
|
|
#End Region ' MoveUpRawPart
|
|
|
|
#Region "MoveDownRawPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property MoveDownRawPart_Command As ICommand
|
|
Get
|
|
If m_cmdMoveDownRawPart Is Nothing Then
|
|
m_cmdMoveDownRawPart = New Command(AddressOf MoveDownRawPart)
|
|
End If
|
|
Return m_cmdMoveDownRawPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub MoveDownRawPart()
|
|
If IsNothing(m_SelMachGroup) Then Return
|
|
DbControllers.m_MachGroupController.UpdateStatus(m_SelMachGroup.Id, ItemState.Produced)
|
|
End Sub
|
|
|
|
#End Region ' MoveDownRawPart
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|