protected bool IsDeleted(LP_Category category, IDictionary <Guid, LP_Category> categories) { while (category != null) { if (category.DateDeleted != null) { return(true); } category = categories.GetValueOrDefault(category.ParentID.GetValueOrDefault()); } return(false); }
public static int CategoryComparer(IComparer <String> comparer, LP_Category x, LP_Category y) { var order = x.OrderIndex.GetValueOrDefault().CompareTo(y.OrderIndex.GetValueOrDefault()); if (order == 0) { order = comparer.Compare(x.Number, y.Number); if (order == 0) { order = x.DateCreated.CompareTo(y.DateCreated); } } return(order); }