using Comal.Classes; using InABox.Core; using System.Collections.Generic; using System.Text; namespace Comal.Stores; public class SetoutGroupStore : BaseStore { protected override void AfterSave(SetoutGroup entity) { if(entity.OptimizationDocument.HasOriginalValue(x => x.ID)) { var setoutStore = (FindSubStore() as SetoutStore)!; var setouts = setoutStore.Query( new Filter(x => x.Group.ID).IsEqualTo(entity.ID), Columns.None().Add(x => x.ID).Add(x => x.Group.ID)); foreach(var setout in setouts.ToObjects()) { setoutStore.UpdateOptimisationDocument(FindSubStore, setout, entity.OptimizationDocument.ID); } } } }