-aggiunto delete duplo a onlyprodpage, e visualizzazione pezzo

This commit is contained in:
Demetrio Cassarino
2023-12-22 14:54:42 +01:00
parent 20357a3ebc
commit 641b1eb6d3
8 changed files with 109 additions and 41 deletions
@@ -622,7 +622,7 @@ Public Class BTLPartManagerVM
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
Return
End If
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0)
Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
For Index = 0 To SelParts.Count() - 1
If IsNothing(SelParts(Index)) Then
@@ -97,13 +97,13 @@ Public Class BTLPartVM
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjManagerVM) Then
MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(ProjectManagerVM.CurrProj.nProdId, nMachgroupId)
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then
MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refOnlyProdManagerVM.CurrProd.nProdId, nMachgroupId)
MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refOnlyProdManagerVM.CurrProj.nProdId, nMachgroupId)
End If
If MachGroupModel.State > ItemState.ND Then
bDuploInProduction = True
Exit For
End If
If Not IsNothing(MachGroupModel) AndAlso MachGroupModel.State > ItemState.ND Then
bDuploInProduction = True
Exit For
End If
End If
Next
If bDuploInProduction Then
MessageBox.Show("Impossible change dimension because already in production!", "", MessageBoxButton.OK, MessageBoxImage.Exclamation)
@@ -113,6 +113,7 @@ Public Class BTLPartVM
' avviso che tutti i pezzi verranno tolti dai grezzi e chiedo di confermare
If MessageBox.Show(String.Format(EgtMsg(61851), nDuploCount), EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
MyMachGroupPanelM.DuploSetToDelete(m_BTLPartM.nPartId)
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then DeleteDuplo_OnlyProdPage(DuploList)
Else
' reimposto vecchio valore
Return False
@@ -145,6 +146,34 @@ Public Class BTLPartVM
Return True
End Function
Private Sub DeleteDuplo_OnlyProdPage(DuploList As List(Of Integer))
For Each nDuploId In DuploList
' recupero grezzo cui appartiene
Dim nRawPartId As Integer = MyMachGroupPanelM.DuploGetRawPart(nDuploId)
' recupero gruppo di lavorazione
Dim nMachGroupId As Integer = EgtGetParent(EgtGetParent(nRawPartId))
' lo setto come corrente
EgtSetCurrMachGroup(nMachGroupId)
' elimino pezzo copia
EgtRemovePartFromRawPart(nDuploId)
EgtErase(nDuploId)
'' recupero gruppo di lavorazione e trave dell'interfaccia
Dim BeamMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nMachGroupId)
If Not IsNothing(BeamMachGroup) Then
Dim Beam As PartVM = BeamMachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nDuploId)
EgtSetCurrMachGroup(BeamMachGroup.Id)
Beam.DeletePart()
End If
' reset necessario per poter ottenere nMachGroupId corretto
EgtResetCurrMachGroup()
' aggiorno dati utilizzo barra
BeamMachGroup.UpdateUsage()
Next
' aggiorno quantita' in prod
Dim BTLPart As BTLPartVM = CALCPanelVM.GetBTLPartVMFromBTLPartId(m_BTLPartM.nPartId)
BTLPart.RefreshPartInProd()
End Sub
Private Function GetOrigFrameGroup(nPartId As Integer) As Integer
Dim nCOP As Integer = GDB_ID.NULL
Dim nBAS As Integer = GDB_ID.NULL
@@ -1544,6 +1573,10 @@ Public Class BTLPartVM
'Map.refLeftPanelVM.FeatureSelectionChanged()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
End If
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
EgtResetCurrMachGroup()
ResetSearchFound()
End If
EgtDraw()
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
End Set
@@ -369,6 +369,7 @@ Public Class BTLStructureVM
' End If
' Next
'End If
EgtResetCurrMachGroup()
EgtDraw()
End Sub
Private Sub HighlightBTLPart(BtlPart As BTLPartVM)
@@ -25,18 +25,23 @@
BeginningEdit="FeatureInPartInRawPartList_BeginningEdit"
Style="{StaticResource DataGrid_CustomHighLight}">
<DataGrid.InputBindings>
<KeyBinding Key="Delete" Command="{Binding Tag.SelFeatureVM.DeleteFeature_Command,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGrid.InputBindings>
<DataGrid.Resources>
<!--DO - Abilitazione-->
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO,UpdateSourceTrigger=PropertyChanged}">
<DataGridCheckBoxColumn.Header>
<KeyBinding Key="Delete" Command="{Binding Tag.SelFeatureVM.DeleteFeature_Command,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGrid.InputBindings>
<DataGrid.Resources>
<!--DO - Abilitazione-->
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO,UpdateSourceTrigger=PropertyChanged}">
<!--<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<!--Validità feature-->
<DataGridTemplateColumn x:Key="colCALC">
</DataGridCheckBoxColumn.Header>-->
<DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate>
</DataGridCheckBoxColumn>
<!--Validità feature-->
<DataGridTemplateColumn x:Key="colCALC">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
@@ -80,22 +85,32 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Descrizione-->
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}">
<DataGridTextColumn.Header>
<!--Descrizione-->
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}">
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Description_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Descrizione-->
<DataGridTextColumn x:Key="colPRIORITY" Binding="{Binding sPriority}">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Priority_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Priority_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid>
<!--<TextBlock Grid.Row="1"
</EgtBEAMWALLCORE:EgtDataGrid>
<!--<TextBlock Grid.Row="1"
Text="{Binding Tag.sCALC_MSG,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
<TextBlock Grid.Row="2"
@@ -41,6 +41,12 @@ Public Class FeatureListVM
End Get
End Property
Public ReadOnly Property DO_Msg As String
Get
Return EgtMsg(61610)
End Get
End Property
#End Region ' Messages
Sub New()
@@ -19,11 +19,15 @@
Style="{StaticResource DataGrid_CustomHighLight}">
<DataGrid.Resources>
<!--DO - Abilitazione-->
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
MinWidth="28">
<DataGridCheckBoxColumn.Header>
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"/>
</DataGridCheckBoxColumn.Header>
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO,UpdateSourceTrigger=PropertyChanged}">
<!--<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridCheckBoxColumn.Header>-->
<DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate>
</DataGridCheckBoxColumn>
<!--Validità feature-->
<DataGridTemplateColumn x:Key="colCALC">
@@ -62,9 +66,14 @@
</DataGridTemplateColumn>
<!--Descrizione-->
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding DataContext.Description_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"/>
</DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Description_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"/>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
@@ -258,7 +258,11 @@ Public Class MyMachGroupPanelVM
End While
' se cancellato almeno un pezzo
If bDuploToDeleteFound Then
Map.refProdManagerVM.Save()
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
Map.refOnlyProdManagerVM.Save()
Else
Map.refProdManagerVM.Save()
End If
End If
EgtResetCurrMachGroup()
End Sub
@@ -65,12 +65,12 @@ Public Class MyMachGroupVM
' ' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
' deseleziono pezzo in lista BTLPart
For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1
Map.refProjectVM.BTLStructureVM.SelBTLParts.Remove(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex))
Next
End If
'If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
' ' deseleziono pezzo in lista BTLPart
' For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1
' Map.refProjectVM.BTLStructureVM.SelBTLParts.Remove(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex))
' Next
'End If
End If
m_SelPart = value
' seleziono pezzo