internal void RemoveRightFromRole(string idRight) { if (m_SelectedRole != null) { Roles_Right toRemove = DataStore.DataContext.Roles_Rights .Where(p => p.IdRole == m_SelectedRole.IdRole && p.IdRight == idRight).FirstOrDefault(); if (toRemove != null) { m_SelectedRole.Roles_Rights.Remove(toRemove); m_IsDirty = true; } } }
internal void AssignRightToRole(string idRight) { if (m_SelectedRole != null) { Roles_Right newEntity = new Roles_Right(); newEntity.IdRight = idRight; newEntity.IdRole = m_SelectedRole.IdRole; if (DataStore.DataContext.Roles_Rights .Where(p => p.IdRight == idRight && p.IdRole == m_SelectedRole.IdRole) .Count() == 0) { DataStore.DataContext.Roles_Rights.InsertOnSubmit(newEntity); m_IsDirty = true; } } }