/// <summary> /// Gets the lump events including related lump events for taxon. /// </summary> /// <param name="userContext">The user context.</param> /// <param name="taxon">The taxon.</param> /// <returns>Lump events including related lumpevents for the taxon.</returns> private static LumpSplitEventList GetLumpEventsIncludingRelatedLumpEventsForTaxon(IUserContext userContext, ITaxon taxon) { LumpSplitEventList lumpEvents = null; if (taxon.ChangeStatus.Id == (int)TaxonChangeStatusId.InvalidDueToLump) { lumpEvents = CoreData.TaxonManager.GetLumpSplitEventsByOldReplacedTaxon(userContext, taxon); if (lumpEvents != null && lumpEvents.Count > 0) { ILumpSplitEvent firstLumpEvent = lumpEvents.First(x => x.Type.Id == (int)LumpSplitEventTypeId.Lump); if (firstLumpEvent != null) { lumpEvents = CoreData.TaxonManager.GetLumpSplitEventsByNewReplacingTaxon(userContext, firstLumpEvent.TaxonAfter); } //lumpEvents.RemoveAll(x => x.Type.Id != (int)LumpSplitEventTypeId.Lump); } } else if (taxon.ChangeStatus.Id == (int)TaxonChangeStatusId.ValidAfterLump) { lumpEvents = CoreData.TaxonManager.GetLumpSplitEventsByNewReplacingTaxon(userContext, taxon); //lumpEvents.RemoveAll(x => x.Type.Id != (int)LumpSplitEventTypeId.Lump); } return(lumpEvents); }
/// <summary> /// Gets the split events including related split events for taxon. /// </summary> /// <param name="userContext">The user context.</param> /// <param name="taxon">The taxon.</param> /// <returns>All split events including related split events for taxon.</returns> private static LumpSplitEventList GetSplitEventsIncludingRelatedSplitEventsForTaxon(IUserContext userContext, ITaxon taxon) { LumpSplitEventList splitEvents = null; if (taxon.ChangeStatus.Id == (int)TaxonChangeStatusId.InvalidDueToSplit) { splitEvents = CoreData.TaxonManager.GetLumpSplitEventsByOldReplacedTaxon(userContext, taxon); //splitEvents.RemoveAll(x => x.Type.Id != (int)LumpSplitEventTypeId.Split); } else if (taxon.ChangeStatus.Id == (int)TaxonChangeStatusId.ValidAfterSplit) { splitEvents = CoreData.TaxonManager.GetLumpSplitEventsByNewReplacingTaxon(userContext, taxon); ILumpSplitEvent firstSplitEvent = splitEvents.First(x => x.Type.Id == (int)LumpSplitEventTypeId.Split); if (firstSplitEvent != null) { splitEvents = CoreData.TaxonManager.GetLumpSplitEventsByNewReplacingTaxon(userContext, firstSplitEvent.TaxonBefore); } //splitEvents.RemoveAll(x => x.Type.Id != (int)LumpSplitEventTypeId.Split); } return(splitEvents); }