public bool ApplyCurrentOperation(long groupId, COPSDate operationDate) { trace?.Write(TraceLevel.Debug, "CM1GroupTree::ApplyCurrentOperation"); bool fnResult = true; try { //m_dtOper CM1Group group = GetGroupFromGrpId(groupId); if (group == null) { throw new InvalidOperationException("Group of operation not found in tree"); } long groupIdTmp; while (group != null) { groupIdTmp = group.GetGrpId(); group.SetState((long)M1GroupState.GRP_ON); group.SetLastDate(operationDate); group = GetGroupParent(groupIdTmp); if (group == null) { trace?.Write(TraceLevel.Error, $"Group of operation ({groupId}) has no parents in tree"); } } } catch (Exception error) { trace?.Write(TraceLevel.Error, error.ToLogString()); fnResult = false; } return(fnResult); }