using Comal.Classes; using InABox.Core; using System; 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(); var setouts = setoutStore.Query( new Filter(x => x.Group.ID).IsEqualTo(entity.ID), new Columns(x => x.ID).Add(x => x.Group.ID)); foreach(var setout in setouts.ToObjects()) { SetoutStore.UpdateOptimisationDocument(FindSubStore, setout, entity.OptimizationDocument.ID); } } } }