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