using System; using System.Collections.Generic; using System.Text; using Activizr.Logic.Structure; using Activizr.Logic.Support; using Activizr.Basic.Types; using Activizr.Database; namespace Activizr.Logic.Pirates { public class ExternalActivities : PluralBase { public static ExternalActivities ForOrganization (Organization organization) { return FromArray(PirateDb.GetDatabase().GetExternalActivities(organization)); } public static ExternalActivities ForOrganization (Organization organization, SortOrder sort, int count) { return FromArray(PirateDb.GetDatabase().GetExternalActivitiesSorted(sort.ToString(), count, organization)); } public enum SortOrder { Unknown = 0, /// /// By date/time of the activism, newest first /// DateDescending, /// /// By date/time of the upload, newest first /// CreationDateDescending } public void Sort (SortOrder order) { switch (order) { case SortOrder.DateDescending: this.Sort(ExternalActivity.CompareDateDescending); break; case SortOrder.CreationDateDescending: this.Sort(ExternalActivity.CompareCreationDateDescending); break; default: throw new NotImplementedException("Unimplemented sort order"); } } } }