C# Class ActivEarth.DAO.ContestDAO

ファイルを表示 Open project: mlcamilli/ActivEarth

Public Methods

Method 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 method

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.
return List

CalculateBracketRewards() public static method

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

CalculateBracketSizes() public static method

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.
return List

CreateNewContest() public static method

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.
return int

FindContests() public static method

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
return List

GetActiveContests() public static method

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

GetAllContests() public static method

public static GetAllContests ( ) : IEnumerable
return IEnumerable

GetContestFromContestId() public static method

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
return ActivEarth.Objects.Competition.Contests.Contest

GetContestIdsFromGroupId() public static method

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.
return List

GetContestIdsFromUserId() public static method

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.
return List

GetContestNameFromContestId() public static method

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

GetStatisticFromContestId() public static method

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

RemoveContestFromContestId() public static method

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.
return bool

RemoveOldContests() public static method

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

UpdateContest() public static method

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

UpdateContestStandings() public static method

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