Merge remote-tracking branch 'origin/feature/NewWarehouse' into DataLayer
This commit is contained in:
@@ -163,6 +163,8 @@ Public Module ConstIni
|
||||
Public Const S_WAREHOUSE As String = "Warehouse"
|
||||
Public Const K_TYPE As String = "Type"
|
||||
Public Const K_DEFAULTQUANTITY As String = "DefaultQuantity"
|
||||
Public Const K_LASTSYNCHRONIZATION As String = "LastSynchronization"
|
||||
Public Const K_USENETWAREHOUSE As String = "UseNetWarehouse"
|
||||
|
||||
Public Const S_BACKUPANDRESTORE As String = "Backup&Restore"
|
||||
Public Const K_EXTERNALBACKUPACTIVE As String = "ExternalBackupActive"
|
||||
|
||||
@@ -41,6 +41,16 @@ Public Class ProdFileM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nProjCloudId As Integer
|
||||
Public Property nProjCloudId As Integer
|
||||
Get
|
||||
Return m_nProjCloudId
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nProjCloudId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Protected Sub New()
|
||||
@@ -51,7 +61,7 @@ Public Class ProdFileM
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
|
||||
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean) As ProdFileM
|
||||
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, nProjCloudId As Integer) As ProdFileM
|
||||
Dim NewProjectFileM As New ProdFileM
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
NewProjectFileM.m_nProjIdList = nProjIdList
|
||||
@@ -64,6 +74,7 @@ Public Class ProdFileM
|
||||
NewProjectFileM.m_bIsActive = bIsActive
|
||||
NewProjectFileM.m_bIsProduced = bIsProduced
|
||||
NewProjectFileM.m_bIsArchived = bIsArchived
|
||||
NewProjectFileM.m_nProjCloudId = nProjCloudId
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
|
||||
|
||||
@@ -29,25 +29,35 @@ Public Class ProjFileM
|
||||
End Property
|
||||
|
||||
Protected m_sDescription As String = String.Empty
|
||||
Public Property sDescription As String
|
||||
Get
|
||||
Return m_sDescription
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDescription = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property sDescription As String
|
||||
Get
|
||||
Return m_sDescription
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDescription = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nProjCloudId As Integer
|
||||
Public Property nProjCloudId As Integer
|
||||
Get
|
||||
Return m_nProjCloudId
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nProjCloudId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Protected Sub New()
|
||||
Protected Sub New()
|
||||
End Sub
|
||||
|
||||
Public Shared Function CreateNewProjFileM() As ProjFileM
|
||||
Return New ProjFileM
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String, sBTLFileName As String, sDescription As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String, bIsActive As Boolean, bIsArchived As Boolean) As ProjFileM
|
||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String, sBTLFileName As String, sDescription As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String, bIsActive As Boolean, bIsArchived As Boolean, nProjCloudId As Integer) As ProjFileM
|
||||
Dim NewProjectFileM As New ProjFileM
|
||||
NewProjectFileM.m_nProjId = nProjId
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
@@ -62,6 +72,7 @@ Public Class ProjFileM
|
||||
NewProjectFileM.m_sMachine = sMachine
|
||||
NewProjectFileM.m_bIsActive = bIsActive
|
||||
NewProjectFileM.m_bIsArchived = bIsArchived
|
||||
NewProjectFileM.m_nProjCloudId = nProjCloudId
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
|
||||
|
||||
@@ -62,18 +62,17 @@ Public Class RawPartM
|
||||
m_nQuantity = value
|
||||
End Set
|
||||
End Property
|
||||
Private m_bUseQuantity As Boolean
|
||||
Public Property bUseQuantity As Boolean
|
||||
Get
|
||||
Return m_bUseQuantity
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bUseQuantity = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bUseQuantity As Boolean
|
||||
Public Property bUseQuantity As Boolean
|
||||
Get
|
||||
Return m_bUseQuantity
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bUseQuantity = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(SxM As MaterialM, W As Double, L As Double, Qty As Integer, Active As Boolean)
|
||||
Sub New(SxM As MaterialM, W As Double, L As Double, Qty As Integer, Active As Boolean)
|
||||
m_Material = SxM
|
||||
m_dW = W
|
||||
m_dL = L
|
||||
@@ -91,5 +90,14 @@ Public Class RawPartM
|
||||
m_bActive = Active
|
||||
End Sub
|
||||
|
||||
Public Sub Update(RawPart As RawPartM)
|
||||
m_Material = RawPart.m_Material
|
||||
m_dW = RawPart.dW
|
||||
m_dL = RawPart.dL
|
||||
m_nQuantity = RawPart.m_nQuantity
|
||||
m_bUseQuantity = RawPart.m_bUseQuantity
|
||||
m_bActive = RawPart.m_bActive
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -455,7 +455,12 @@ Public Class BTLPartVM
|
||||
' se sezione nuova non presente
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(Section) Then
|
||||
' creo nuova sezione
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(Section)
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(Section.MaterialM)
|
||||
Dim NewSection = Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
End If
|
||||
' se sezione vecchia non utilizzata da altri pezzi
|
||||
If Not bOtherSection Then
|
||||
|
||||
@@ -999,9 +999,10 @@ Public Class BTLStructureVM
|
||||
' verifico sezione, gruppo e sottogruppo per inserirli nei filtri
|
||||
If Not SectionList.Contains(BTLPartVM.Section) Then
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(BTLPartVM.Section.MaterialM)
|
||||
SectionList.Add(BTLPartVM.Section)
|
||||
Dim NewSection = BTLPartVM.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
SectionList(SectionList.Count - 1).MaterialM.SetId(nMaterialId)
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
End If
|
||||
If Not GroupList.Contains(BTLPartVM.sGROUP) Then
|
||||
|
||||
@@ -1031,7 +1031,12 @@ Public Class LeftPanelVM
|
||||
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(NewPartVM, False, True)
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(NewPartVM.Section) Then
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewPartVM.Section)
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(NewPartVM.Section.MaterialM)
|
||||
Dim NewSection = NewPartVM.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -265,18 +265,20 @@ Public Class MainWindowVM
|
||||
m_MaterialSyncroThread = New Thread(Sub()
|
||||
' sincronizzo magazzino con versione online
|
||||
'DbControllers.m_MagmanController.ResourcesForceSyncAll()
|
||||
Dim nIndex As Integer = 0
|
||||
'Dim nIndex As Integer = 0
|
||||
'Dim nMaterialOk As DataLayer.Controllers.MagmanController.SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_ND
|
||||
'While nMaterialOk <> DataLayer.Controllers.MagmanController.SyncResult.ALL_OK And nIndex < 5
|
||||
' nMaterialOk = DbControllers.m_MagmanController.ResourcesForceSyncAll()
|
||||
' nIndex += 1
|
||||
'End While
|
||||
Dim nRawOk As DataLayer.Controllers.MagmanController.SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_ND
|
||||
While nRawOk <> DataLayer.Controllers.MagmanController.SyncResult.ERR_Res2SendEmpty And nIndex < 5
|
||||
nRawOk = DbControllers.m_MagmanController.ResourcesSync(New List(Of Integer)({19}))
|
||||
nIndex += 1
|
||||
End While
|
||||
Dim bCurrMaterialOK As DataLayer.Controllers.MagmanController.SyncResult = DbControllers.m_MagmanController.ResourcesSync(New List(Of Integer)({19}))
|
||||
'Dim nRawOk As DataLayer.Controllers.MagmanController.SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_ND
|
||||
'While nRawOk <> DataLayer.Controllers.MagmanController.SyncResult.ERR_Res2SendEmpty And nIndex < 5
|
||||
' nRawOk = DbControllers.m_MagmanController.ResourcesSync(New List(Of Integer)({19}))
|
||||
' nIndex += 1
|
||||
'End While
|
||||
'Dim nMaterialOk = DbControllers.m_MagmanController.ResourcesForceSyncAll()
|
||||
|
||||
'Dim bCurrMaterialOK As DataLayer.Controllers.MagmanController.SyncResult = DbControllers.m_MagmanController.ResourcesSync(New List(Of Integer)({19}))
|
||||
'Dim nIndex As Integer = 0
|
||||
'Dim bMaterialOk As Boolean = False
|
||||
'While Not bMaterialOk And nIndex < 5
|
||||
|
||||
@@ -302,6 +302,37 @@ Public Class NestingRunningWndVM
|
||||
Select x.BTLPartM).ToList()
|
||||
SectionProgress.SetSectionPartList(SectionPartList)
|
||||
Next
|
||||
' se magazzino di rete attivo e non impostato per utilizzo diretto
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_NETWAREHOUSE, 0) = 1 Then
|
||||
If Map.refOptimizePanelVM.UseNetWarehouse_IsChecked Then
|
||||
' modifico quantita' per grezzi considerando quelli gia' presenti nel progetto
|
||||
For Each SectionProgress In m_SectionProgressList
|
||||
For Each Raw In SectionProgress.SParamList
|
||||
Dim nProjectRawCnt As Integer = 0
|
||||
For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.MachGroupVMList
|
||||
If MachGroup.Section = Raw.SectXMat AndAlso MachGroup.dL = Raw.dL Then
|
||||
nProjectRawCnt += 1
|
||||
End If
|
||||
Next
|
||||
Raw.nQuantity = Math.Max(Raw.nQuantity - nProjectRawCnt, 0)
|
||||
Next
|
||||
Next
|
||||
Else
|
||||
' modifico quantita' per grezzi con flag quantita' infinita
|
||||
For Each SectionProgress In m_SectionProgressList
|
||||
For Each Raw In SectionProgress.SParamList
|
||||
If Raw.bUseQuantity Then Raw.nQuantity = SectionProgress.SectionPartList.Sum(Function(x) x.m_nCNT)
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
' modifico quantita' per grezzi con flag quantita' infinita
|
||||
For Each SectionProgress In m_SectionProgressList
|
||||
For Each Raw In SectionProgress.SParamList
|
||||
If Raw.bUseQuantity Then Raw.nQuantity = SectionProgress.SectionPartList.Count
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
' avvio timer avanzamento nesting
|
||||
m_CurrState = SectionProgress.NestStates.NULL
|
||||
m_TotTime = 0
|
||||
|
||||
@@ -136,13 +136,12 @@ Public Class OptimizePanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_UseNetWarehouse_IsChecked As Boolean
|
||||
Public Property UseNetWarehouse_IsChecked As Boolean
|
||||
Get
|
||||
Return m_UseNetWarehouse_IsChecked
|
||||
Return GetMainPrivateProfileInt(S_WAREHOUSE, K_USENETWAREHOUSE, 0) = 1
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_UseNetWarehouse_IsChecked = value
|
||||
WriteMainPrivateProfileString(S_WAREHOUSE, K_USENETWAREHOUSE, If(value, 1, 0))
|
||||
NotifyPropertyChanged(NameOf(Warehouse_IsEnabled))
|
||||
End Set
|
||||
End Property
|
||||
@@ -156,7 +155,7 @@ Public Class OptimizePanelVM
|
||||
|
||||
Public ReadOnly Property Warehouse_IsEnabled As Boolean
|
||||
Get
|
||||
Return If(GetMainPrivateProfileInt(S_GENERAL, K_NETWAREHOUSE, 0) = 1, Not m_UseNetWarehouse_IsChecked, True)
|
||||
Return If(GetMainPrivateProfileInt(S_GENERAL, K_NETWAREHOUSE, 0) = 1, Not UseNetWarehouse_IsChecked, True)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -204,6 +203,15 @@ Public Class OptimizePanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UseNetWarehouse_ToolTip As String
|
||||
Get
|
||||
Dim sLastSynchronization As String = ""
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTSYNCHRONIZATION, "", sLastSynchronization)
|
||||
Return "Use net warehouse" & Environment.NewLine &
|
||||
String.Format("Last successfull synchronization done on {0}", sLastSynchronization)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
@@ -427,6 +435,27 @@ Public Class OptimizePanelVM
|
||||
Friend Sub Optimize()
|
||||
If IsNothing(m_SelPartType) OrElse IsNothing(m_SelOriginType) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.BTLStructureVM.BTLPartVMList) OrElse Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count = 0 Then Return
|
||||
' se magazzino in rete
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_NETWAREHOUSE, 0) = 1 And UseNetWarehouse_IsChecked Then
|
||||
' sincronizzo magazzino locale con rete
|
||||
Dim ProjectMatIdList As List(Of Integer) = (From SectionXMat In Map.refProjectVM.BTLStructureVM.SectionList
|
||||
Where SectionXMat <> SectionXMaterial.Empty
|
||||
Select SectionXMat.MaterialM.nId).ToList()
|
||||
|
||||
Dim SyncResult As DataLayer.Controllers.MagmanController.SyncResult = DbControllers.m_MagmanController.ResourcesSync(ProjectMatIdList)
|
||||
If SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ALL_OK OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_MergeMatEmpty OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_CloudMatEmpty OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_Res2SendEmpty Then
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTSYNCHRONIZATION, DateTime.Now.ToString())
|
||||
NotifyPropertyChanged(NameOf(UseNetWarehouse_ToolTip))
|
||||
Else
|
||||
Dim sLastSynchronization As String = ""
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTSYNCHRONIZATION, "", sLastSynchronization)
|
||||
MessageBox.Show("Net Warehouse Synchronization failed! Last successfull synchronization done on " & sLastSynchronization, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
' se nessun grezzo, rendo tutti i pezzi visibili
|
||||
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then
|
||||
Map.refProjectVM.BTLStructureVM.ShowAll(False)
|
||||
|
||||
@@ -1091,7 +1091,12 @@ Public Class ProjManagerVM
|
||||
Dim AddedBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart)
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(AddedBTLPart.Section) Then
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(AddedBTLPart.Section)
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(AddedBTLPart.Section.MaterialM)
|
||||
Dim NewSection = AddedBTLPart.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
End If
|
||||
nNewPartId = EgtGetNextPart(nNewPartId)
|
||||
End While
|
||||
@@ -1307,7 +1312,12 @@ Public Class ProjManagerVM
|
||||
End If
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(AddedBTLPart.Section) Then
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(AddedBTLPart.Section)
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(AddedBTLPart.Section.MaterialM)
|
||||
Dim NewSection = AddedBTLPart.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
End If
|
||||
nAddedPartId = EgtGetNextPart(nAddedPartId)
|
||||
End While
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -31,7 +32,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -174,7 +175,12 @@
|
||||
|
||||
</Grid>
|
||||
|
||||
<GroupBox Header="{Binding SParams_Msg}" Grid.Row="1" Grid.Column="0" Margin="0,0,0,5" Visibility="{Binding Basic_Visibility}">
|
||||
<Button Grid.Row="1"
|
||||
Content="Update Warehouse Quantity"
|
||||
Command="{Binding UpdateNetQuantity_Command}"
|
||||
ToolTip="{Binding UpdateNetQuantity_ToolTip}"/>
|
||||
|
||||
<GroupBox Header="{Binding SParams_Msg}" Grid.Row="2" Grid.Column="0" Margin="0,0,0,5" Visibility="{Binding Basic_Visibility}">
|
||||
<ListBox ItemsSource="{Binding SParamList}"
|
||||
SelectedItem="{Binding SelSParam}"
|
||||
DisplayMemberPath="sValue"
|
||||
@@ -182,7 +188,7 @@
|
||||
MinHeight="40"/>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding SParams_Msg}" Grid.Row="1" Grid.Column="0" Margin="0,0,0,5" Visibility="{Binding Medium_Visibility}">
|
||||
<GroupBox Header="{Binding SParams_Msg}" Grid.Row="2" Grid.Column="0" Margin="0,0,0,5" Visibility="{Binding Medium_Visibility}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -265,13 +271,14 @@
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- Quantity -->
|
||||
<DataGridTextColumn x:Key="colQTY" Binding="{Binding nQuantity}">
|
||||
<DataGridTextColumn x:Key="colQTY" Binding="{Binding sQuantity}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Quantity_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:WarehouseWndV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- Use Quantity -->
|
||||
<DataGridTemplateColumn x:Key="colUSEQTY" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
@@ -279,13 +286,18 @@
|
||||
VerticalAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="∞"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Resources>
|
||||
</EgtBEAMWALLCORE:EgtDataGrid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<Grid Grid.Row="2" Margin="0,0,0,5" Visibility="{Binding AddRemoveBtns_Visibility}">
|
||||
<Grid Grid.Row="3" Margin="0,0,0,5" Visibility="{Binding AddRemoveBtns_Visibility}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -314,7 +326,7 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<GroupBox Header="{Binding NewParam_Msg}" Margin="0,0,0,5" Grid.Row="3" Visibility="{Binding NewBeamParam_Visibility}">
|
||||
<GroupBox Header="{Binding NewParam_Msg}" Margin="0,0,0,5" Grid.Row="4" Visibility="{Binding NewBeamParam_Visibility}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
@@ -351,7 +363,7 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{Binding NewParam_Msg}" Margin="0,0,0,5" Grid.Row="3" Visibility="{Binding NewWallParam_Visibility}">
|
||||
<GroupBox Header="{Binding NewParam_Msg}" Margin="0,0,0,5" Grid.Row="4" Visibility="{Binding NewWallParam_Visibility}">
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
@@ -398,7 +410,7 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<Grid Grid.Row="4"
|
||||
<Grid Grid.Row="5"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class WarehouseWndVM
|
||||
@@ -153,6 +152,15 @@ Public Class WarehouseWndVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateNetQuantity_ToolTip As String
|
||||
Get
|
||||
Dim sLastSynchronization As String = ""
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTSYNCHRONIZATION, "", sLastSynchronization)
|
||||
Return "Use net warehouse" & Environment.NewLine &
|
||||
String.Format("Last successfull synchronization done on {0}", sLastSynchronization)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
@@ -429,6 +437,7 @@ Public Class WarehouseWndVM
|
||||
Private m_cmdRemoveMediumParam As ICommand
|
||||
Private m_cmdAddWhWallParam As ICommand
|
||||
Private m_cmdRemoveWhWallParam As ICommand
|
||||
Private m_cmdUpdateNetQuantity As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
@@ -929,7 +938,7 @@ Public Class WarehouseWndVM
|
||||
Public Sub RemoveParam()
|
||||
If Not IsNothing(SelSParam) Then
|
||||
If SelSParam.Equals(SelCurrentS) Then
|
||||
If MessageBox.Show(RemoveCurrent_Msg, Attention_Msg, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
|
||||
If MessageBox.Show(RemoveCurrent_Msg, Attention_Msg, MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
|
||||
SParamList.Remove(SelSParam)
|
||||
m_RemovedParamsCount += 1
|
||||
If SParamList.Count > 0 Then
|
||||
@@ -1039,6 +1048,45 @@ Public Class WarehouseWndVM
|
||||
|
||||
#End Region ' RemoveWhWallParam
|
||||
|
||||
#Region "UpdateNetQuantity"
|
||||
|
||||
Public ReadOnly Property UpdateNetQuantity_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdateNetQuantity Is Nothing Then
|
||||
m_cmdUpdateNetQuantity = New Command(AddressOf UpdateNetQuantity)
|
||||
End If
|
||||
Return m_cmdUpdateNetQuantity
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub UpdateNetQuantity()
|
||||
Dim ProjectMatIdList As List(Of Integer) = (From SectionXMat In Map.refProjectVM.BTLStructureVM.SectionList
|
||||
Where SectionXMat <> SectionXMaterial.Empty
|
||||
Select SectionXMat.MaterialM.nId).ToList()
|
||||
|
||||
Dim SyncResult As DataLayer.Controllers.MagmanController.SyncResult = DbControllers.m_MagmanController.ResourcesSync(ProjectMatIdList)
|
||||
If SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ALL_OK OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_MergeMatEmpty OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_CloudMatEmpty OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_Res2SendEmpty Then
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTSYNCHRONIZATION, DateTime.Now.ToString())
|
||||
Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.UseNetWarehouse_ToolTip))
|
||||
NotifyPropertyChanged(NameOf(UpdateNetQuantity_ToolTip))
|
||||
Else
|
||||
Dim sLastSynchronization As String = ""
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTSYNCHRONIZATION, "", sLastSynchronization)
|
||||
MessageBox.Show("Net Warehouse Synchronization failed! Last successfull synchronization done on " & sLastSynchronization, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
' aggiorno elementi in lista
|
||||
For Each SParam In m_SParamList
|
||||
If ProjectMatIdList.Contains(SParam.RawPart.Material.nId) Then
|
||||
SParam.UpdateRawPart()
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' RemoveWhWallParam
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "METHODS"
|
||||
@@ -1392,12 +1440,22 @@ Public Class SParam
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sQuantity As String
|
||||
Get
|
||||
Return If(GetMainPrivateProfileInt(S_GENERAL, K_NETWAREHOUSE, 0) = 1 And bUseQuantity, "---", m_RawPart.nQuantity)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_RawPart.nQuantity = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property bUseQuantity As Boolean
|
||||
Get
|
||||
Return m_RawPart.nQuantity
|
||||
Return m_RawPart.bUseQuantity
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_RawPart.nQuantity = value
|
||||
m_RawPart.bUseQuantity = value
|
||||
NotifyPropertyChanged(NameOf(sQuantity))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1577,6 +1635,17 @@ Public Class SParam
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Sub UpdateRawPart()
|
||||
Dim UpdatedRawPart As RawPartM = DbControllers.m_RawItemsController.FindByDbId(RawPart.nId)
|
||||
m_RawPart.Update(UpdatedRawPart)
|
||||
NotifyPropertyChanged(NameOf(dW))
|
||||
NotifyPropertyChanged(NameOf(dL))
|
||||
NotifyPropertyChanged(NameOf(sQuantity))
|
||||
NotifyPropertyChanged(NameOf(bUseQuantity))
|
||||
NotifyPropertyChanged(NameOf(bActive))
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Public Class WhWallParam
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user