using Comal.Classes; namespace Comal.Stores { public class RoleStore : BaseStore { //protected override void AfterSave(Role entity) //{ // base.AfterSave(entity); // if (true) //entity.HasOriginalValue(x => x.ID)) // { // CoreTable acts = Provider.Query(null, new InABox.Core.Columns(x => x.ID), null); // CoreTable maps = Provider.Query(null, new Columns(x => x.ID, x => x.Role.ID, x => x.Activity.ID), null); // List updates = new List(); // foreach (var act in acts.Rows) // { // Guid aid = act.Get(c => c.ID); // if (!maps.Rows.Any(r => r.Get(c => c.Role.ID).Equals(entity.ID) && r.Get(c => c.Activity.ID).Equals(aid))) // { // RoleActivity map = new RoleActivity(); // map.Role.ID = entity.ID; // map.Activity.ID = act.Get(c => c.ID); // map.Enabled = true; // updates.Add(map); // } // } // if (updates.Any()) // FindSubStore().Save(updates, ""); // } //} } }