|
|
@@ -85,7 +85,7 @@ public class Module
|
|
|
/// </summary>
|
|
|
private List<StagingSetout> selectedSetouts = new();
|
|
|
|
|
|
- private CoreTable? _templateGroups = null;
|
|
|
+ private CoreTable _templateGroups = null!;
|
|
|
|
|
|
#region Script Stuff
|
|
|
|
|
|
@@ -136,7 +136,6 @@ public class Module
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
SectionName = nameof(StagingPanel);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
public void Setup()
|
|
|
@@ -152,14 +151,19 @@ public class Module
|
|
|
|
|
|
//stagingSetoutGrid.ScanFiles(_settings.SetoutsFolder);
|
|
|
stagingSetoutGrid.Refresh(true, false);
|
|
|
+ BOMGrid.Refresh(true, false);
|
|
|
+ BOMItemGrid.Refresh(true, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private bool CanViewPackets() => MainPanel.View != DynamicSplitPanelView.Master && NestedPanel.View != DynamicSplitPanelView.Master;
|
|
|
+
|
|
|
private void NestedPanel_OnChanged(object sender, DynamicSplitPanelSettings e)
|
|
|
{
|
|
|
- if(e.View != DynamicSplitPanelView.Master && ManufacturingPacketList.Setout != selectedSetout)
|
|
|
+ if(CanViewPackets())
|
|
|
{
|
|
|
ManufacturingPacketList.Setout = selectedSetout;
|
|
|
+ BOMItemGrid.StagingSetout = selectedSetout;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -448,10 +452,10 @@ public class Module
|
|
|
Serial = stagingPacket.Serial,
|
|
|
Title = stagingPacket.Title,
|
|
|
Quantity = stagingPacket.Quantity,
|
|
|
- BarcodeQty = String.IsNullOrWhiteSpace(stagingPacket.BarcodeQuantity)
|
|
|
+ BarcodeQty = string.IsNullOrWhiteSpace(stagingPacket.BarcodeQuantity)
|
|
|
? stagingPacket.Quantity
|
|
|
: int.Parse(stagingPacket.BarcodeQuantity),
|
|
|
- WaterMark = String.IsNullOrWhiteSpace(stagingPacket.Watermark)
|
|
|
+ WaterMark = string.IsNullOrWhiteSpace(stagingPacket.Watermark)
|
|
|
? stagingPacket.Group.Watermark
|
|
|
: stagingPacket.Watermark,
|
|
|
Location = stagingPacket.Location
|
|
|
@@ -488,11 +492,16 @@ public class Module
|
|
|
.Query(
|
|
|
new Filter<StagingManufacturingPacketComponent>(x => x.Packet.ID).IsEqualTo(stagingPacket.ID),
|
|
|
new Columns<StagingManufacturingPacketComponent>(x=>x.Packet.ID)
|
|
|
- .Add(x=>x.Product.ID)
|
|
|
- .Add(x=>x.Quantity)
|
|
|
- .Add(x=>x.Length)
|
|
|
- .Add(x=>x.Height)
|
|
|
- .Add(x=>x.Width)
|
|
|
+ .Add(x => x.Product.ID)
|
|
|
+ .Add(x => x.Quantity)
|
|
|
+ .Add(x => x.Dimensions.Unit.ID)
|
|
|
+ .Add(x => x.Dimensions.Quantity)
|
|
|
+ .Add(x => x.Dimensions.Length)
|
|
|
+ .Add(x => x.Dimensions.Width)
|
|
|
+ .Add(x => x.Dimensions.Height)
|
|
|
+ .Add(x => x.Dimensions.Weight)
|
|
|
+ .Add(x => x.Dimensions.Value)
|
|
|
+ .Add(x => x.Dimensions.UnitSize)
|
|
|
);
|
|
|
|
|
|
newComponents.AddRange(components.ToObjects<StagingManufacturingPacketComponent>()
|
|
|
@@ -595,7 +604,7 @@ public class Module
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- File.WriteAllBytes(selectedSetout?.OriginalPath, _documentdata);
|
|
|
+ File.WriteAllBytes(selectedSetout.OriginalPath, _documentdata);
|
|
|
selectedSetout.OriginalCRC = CoreUtils.CalculateCRC(_documentdata);
|
|
|
new Client<StagingSetout>().Save(selectedSetout,"Updated Source File with markups");
|
|
|
UpdateOriginalButton.Visibility = Visibility.Collapsed;
|
|
|
@@ -685,6 +694,7 @@ public class Module
|
|
|
Document = null;
|
|
|
ManufacturingPacketList.Setout = null;
|
|
|
CollapsePacketsButton.IsEnabled = false;
|
|
|
+ BOMItemGrid.StagingSetout = null;
|
|
|
SetMode(DocumentMode.Markup);
|
|
|
return;
|
|
|
}
|
|
|
@@ -704,13 +714,15 @@ public class Module
|
|
|
Document = null;
|
|
|
ManufacturingPacketList.Setout = null;
|
|
|
CollapsePacketsButton.IsEnabled = false;
|
|
|
+ BOMItemGrid.StagingSetout = null;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
Document = doc;
|
|
|
- if(MainPanel.View != DynamicSplitPanelView.Master && NestedPanel.View != DynamicSplitPanelView.Master)
|
|
|
+ if(CanViewPackets())
|
|
|
{
|
|
|
ManufacturingPacketList.Setout = selectedSetout;
|
|
|
+ BOMItemGrid.StagingSetout = selectedSetout;
|
|
|
}
|
|
|
CollapsePacketsButton.IsEnabled = true;
|
|
|
var mode =
|
|
|
@@ -822,6 +834,7 @@ public class Module
|
|
|
Document = null;
|
|
|
|
|
|
ManufacturingPacketList.Setout = null;
|
|
|
+ BOMItemGrid.StagingSetout = null;
|
|
|
CalculateTime();
|
|
|
}
|
|
|
|
|
|
@@ -843,7 +856,7 @@ public class Module
|
|
|
|
|
|
private void AddPacketButton_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- if (_templateGroups.Rows.Any())
|
|
|
+ if (_templateGroups.Rows.Any() == true)
|
|
|
{
|
|
|
ContextMenu menu = new ContextMenu();
|
|
|
foreach (var row in _templateGroups.Rows)
|
|
|
@@ -941,6 +954,7 @@ public class Module
|
|
|
private void StagingSetoutGrid_OnOnDoubleClick(object sender, HandledEventArgs args)
|
|
|
{
|
|
|
ManufacturingPacketList.Setout = selectedSetout;
|
|
|
+ BOMItemGrid.StagingSetout = selectedSetout;
|
|
|
MainPanel.View = DynamicSplitPanelView.Detail;
|
|
|
NestedPanel.View = DynamicSplitPanelView.Combined;
|
|
|
args.Handled = true;
|
|
|
@@ -962,5 +976,13 @@ public class Module
|
|
|
CalculateTime();
|
|
|
UpdateStagingSetoutGrid();
|
|
|
}
|
|
|
+
|
|
|
+ private void BOMGrid_OnChanged(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if (CanViewPackets())
|
|
|
+ {
|
|
|
+ BOMItemGrid.Refresh(false, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|