C# Class ActivEarth.DAO.ContestDAO

Afficher le fichier Open project: mlcamilli/ActivEarth

Méthodes publiques

Méthode Description
CalculateBracketRewards ( Contest contest ) : List

Calculates the ActivityScore reward that will be awarded to teams in each bracket.

CalculateBracketRewards ( int contestId ) : List

Calculates the ActivityScore reward that will be awarded to teams in each bracket.

CalculateBracketSizes ( int teamCount ) : List

Calculates the number of teams qualifying for each reward bracket in a contest.

CreateNewContest ( Contest contest ) : int

Saves a contest as a new entry in the DB.

FindContests ( string name, bool exactMatch ) : List

Gets the list of currently joinable contests with a search query (searching contests by name).

GetActiveContests ( bool loadTeams, bool loadTeamMembers ) : List

Retrieves all active contests in the DB.

GetAllContests ( ) : IEnumerable
GetContestFromContestId ( int contestId, bool loadTeams, bool loadTeamMembers ) : Contest

Retrieves a Contest from the DB based on its ID.

GetContestIdsFromGroupId ( int groupId ) : List

Returns the list of IDs of all contests that a group is currently participating in.

GetContestIdsFromUserId ( int userId ) : List

Returns the list of IDs of all contests that a user is currently participating in.

GetContestNameFromContestId ( int contestId ) : string

Returns the name of a contest based on its ID.

GetStatisticFromContestId ( int contestId ) : Statistic

Lookup for the statistic being tracked by a specific challenge.

RemoveContestFromContestId ( int contestId ) : bool

Deletes an existing Contest from the DB.

RemoveOldContests ( ) : bool

Removes contests from the DB that have were deactivated more than two weeks ago.

UpdateContest ( Contest contest ) : bool

Updates an existing Contest in the DB.

UpdateContestStandings ( int contestId ) : void

Updates the scores and bracket assignments for all teams in the contest.

Method Details

CalculateBracketRewards() public static méthode

Calculates the ActivityScore reward that will be awarded to teams in each bracket.
public static CalculateBracketRewards ( Contest contest ) : List
contest ActivEarth.Objects.Competition.Contests.Contest Contest to calculate rewards for. Must have teams loaded.
Résultat List

CalculateBracketRewards() public static méthode

Calculates the ActivityScore reward that will be awarded to teams in each bracket.
public static CalculateBracketRewards ( int contestId ) : List
contestId int
Résultat List

CalculateBracketSizes() public static méthode

Calculates the number of teams qualifying for each reward bracket in a contest.
public static CalculateBracketSizes ( int teamCount ) : List
teamCount int Number of teams in the contest.
Résultat List

CreateNewContest() public static méthode

Saves a contest as a new entry in the DB.
public static CreateNewContest ( Contest contest ) : int
contest ActivEarth.Objects.Competition.Contests.Contest Contest object to add to the DB.
Résultat int

FindContests() public static méthode

Gets the list of currently joinable contests with a search query (searching contests by name).
public static FindContests ( string name, bool exactMatch ) : List
name string
exactMatch bool
Résultat List

GetActiveContests() public static méthode

Retrieves all active contests in the DB.
public static GetActiveContests ( bool loadTeams, bool loadTeamMembers ) : List
loadTeams bool
loadTeamMembers bool
Résultat List

GetAllContests() public static méthode

public static GetAllContests ( ) : IEnumerable
Résultat IEnumerable

GetContestFromContestId() public static méthode

Retrieves a Contest from the DB based on its ID.
public static GetContestFromContestId ( int contestId, bool loadTeams, bool loadTeamMembers ) : Contest
contestId int Identifier of the contest to retrieve.
loadTeams bool
loadTeamMembers bool
Résultat ActivEarth.Objects.Competition.Contests.Contest

GetContestIdsFromGroupId() public static méthode

Returns the list of IDs of all contests that a group is currently participating in.
public static GetContestIdsFromGroupId ( int groupId ) : List
groupId int ID of the group to search for.
Résultat List

GetContestIdsFromUserId() public static méthode

Returns the list of IDs of all contests that a user is currently participating in.
public static GetContestIdsFromUserId ( int userId ) : List
userId int ID of the user to search for.
Résultat List

GetContestNameFromContestId() public static méthode

Returns the name of a contest based on its ID.
public static GetContestNameFromContestId ( int contestId ) : string
contestId int
Résultat string

GetStatisticFromContestId() public static méthode

Lookup for the statistic being tracked by a specific challenge.
public static GetStatisticFromContestId ( int contestId ) : Statistic
contestId int ID of the contest to query.
Résultat Statistic

RemoveContestFromContestId() public static méthode

Deletes an existing Contest from the DB.
public static RemoveContestFromContestId ( int contestId ) : bool
contestId int ID for the Contest whose record needs to be removed.
Résultat bool

RemoveOldContests() public static méthode

Removes contests from the DB that have were deactivated more than two weeks ago.
public static RemoveOldContests ( ) : bool
Résultat bool

UpdateContest() public static méthode

Updates an existing Contest in the DB.
public static UpdateContest ( Contest contest ) : bool
contest ActivEarth.Objects.Competition.Contests.Contest Contest whose record needs updating.
Résultat bool

UpdateContestStandings() public static méthode

Updates the scores and bracket assignments for all teams in the contest.
public static UpdateContestStandings ( int contestId ) : void
contestId int Contest ID to update.
Résultat void