|
@@ -13,7 +13,7 @@ using System.Windows.Controls;
|
|
|
|
|
|
namespace PRSDesktop
|
|
|
{
|
|
|
- public class StagingBOMItemGrid : DynamicDataGrid<StagingBOMItem>
|
|
|
+ public class StagingSetoutComponentGrid : DynamicDataGrid<StagingSetoutComponent>
|
|
|
{
|
|
|
private StagingSetout? _stagingSetout = null;
|
|
|
public StagingSetout? StagingSetout
|
|
@@ -31,7 +31,7 @@ namespace PRSDesktop
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public StagingBOMItemGrid()
|
|
|
+ public StagingSetoutComponentGrid()
|
|
|
{
|
|
|
HiddenColumns.Add(x => x.Dimensions.Length);
|
|
|
HiddenColumns.Add(x => x.Dimensions.Width);
|
|
@@ -44,7 +44,6 @@ namespace PRSDesktop
|
|
|
HiddenColumns.Add(x => x.Quantity);
|
|
|
HiddenColumns.Add(x => x.Product.ID);
|
|
|
HiddenColumns.Add(x => x.Sequence);
|
|
|
- HiddenColumns.Add(x => x.StagingBOM.ID);
|
|
|
HiddenColumns.Add(x => x.StagingSetout.ID);
|
|
|
HiddenColumns.Add(x => x.StagingManufacturingPacket.ID);
|
|
|
|
|
@@ -58,7 +57,7 @@ namespace PRSDesktop
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- var quantity = row.Get<StagingBOMItem, int>(x => x.Quantity);
|
|
|
+ var quantity = row.Get<StagingSetoutComponent, int>(x => x.Quantity);
|
|
|
|
|
|
if(quantity <= 1)
|
|
|
{
|
|
@@ -71,18 +70,18 @@ namespace PRSDesktop
|
|
|
{
|
|
|
if (value >= 1 && value < quantity)
|
|
|
{
|
|
|
- var item = row.ToObject<StagingBOMItem>();
|
|
|
+ var item = row.ToObject<StagingSetoutComponent>();
|
|
|
var newItem = CreateItem();
|
|
|
newItem.CopyFrom(item);
|
|
|
newItem.Quantity = quantity - value;
|
|
|
newItem.Sequence = item.Sequence + 1;
|
|
|
item.Quantity = value;
|
|
|
|
|
|
- var items = new List<StagingBOMItem> { item, newItem };
|
|
|
+ var items = new List<StagingSetoutComponent> { item, newItem };
|
|
|
var s = newItem.Sequence + 2;
|
|
|
for (int j = row.Index + 1; j < Data.Rows.Count; ++j, ++s)
|
|
|
{
|
|
|
- var sequencedItem = Data.Rows[j].ToObject<StagingBOMItem>();
|
|
|
+ var sequencedItem = Data.Rows[j].ToObject<StagingSetoutComponent>();
|
|
|
sequencedItem.Sequence = s;
|
|
|
items.Add(sequencedItem);
|
|
|
}
|
|
@@ -98,11 +97,11 @@ namespace PRSDesktop
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- protected override StagingBOMItem CreateItem()
|
|
|
+ protected override StagingSetoutComponent CreateItem()
|
|
|
{
|
|
|
var item = base.CreateItem();
|
|
|
item.StagingSetout.ID = StagingSetout?.ID ?? Guid.Empty;
|
|
|
- item.Sequence = Data.Rows.Last().Get<StagingBOMItem, long>(x => x.Sequence) + 1;
|
|
|
+ item.Sequence = Data.Rows.Last().Get<StagingSetoutComponent, long>(x => x.Sequence) + 1;
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -128,21 +127,21 @@ namespace PRSDesktop
|
|
|
return effect;
|
|
|
}
|
|
|
|
|
|
- protected override void Reload(Filters<StagingBOMItem> criteria, Columns<StagingBOMItem> columns, ref SortOrder<StagingBOMItem>? sort, Action<CoreTable?, Exception?> action)
|
|
|
+ protected override void Reload(Filters<StagingSetoutComponent> criteria, Columns<StagingSetoutComponent> columns, ref SortOrder<StagingSetoutComponent>? sort, Action<CoreTable?, Exception?> action)
|
|
|
{
|
|
|
if (sort == null)
|
|
|
- sort = new SortOrder<StagingBOMItem>(x => x.Sequence);
|
|
|
+ sort = new SortOrder<StagingSetoutComponent>(x => x.Sequence);
|
|
|
else
|
|
|
sort.ThenBy(x => x.Sequence);
|
|
|
|
|
|
if (StagingSetout is null)
|
|
|
{
|
|
|
- criteria.Add(new Filter<StagingBOMItem>().None());
|
|
|
+ criteria.Add(new Filter<StagingSetoutComponent>().None());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- criteria.Add(new Filter<StagingBOMItem>(x => x.StagingSetout.ID).IsEqualTo(StagingSetout.ID));
|
|
|
- criteria.Add(new Filter<StagingBOMItem>(x => x.StagingManufacturingPacket.ID).IsEqualTo(Guid.Empty));
|
|
|
+ criteria.Add(new Filter<StagingSetoutComponent>(x => x.StagingSetout.ID).IsEqualTo(StagingSetout.ID));
|
|
|
+ criteria.Add(new Filter<StagingSetoutComponent>(x => x.StagingManufacturingPacket.ID).IsEqualTo(Guid.Empty));
|
|
|
}
|
|
|
base.Reload(criteria, columns, ref sort, action);
|
|
|
}
|