C# Класс ActivEarth.DAO.TeamDAO

Показать файл Открыть проект

Открытые методы

Метод Описание
CreateNewTeam ( ContestTeam team ) : int

Saves a Team as a new entry in the DB.

CreateNewTeamMember ( ContestTeamMember teamMember, int teamId ) : int

Creates a new DB entry for a team member.

CreateNewTeamMember ( int userId, int teamId ) : int

Creates a new DB entry for a team member.

GetCompetitorCount ( int contestId ) : int

Retrieves the number of competitors for a contest.

GetTeamFromTeamId ( int teamId, bool loadMembers ) : ContestTeam

Retrieves a Team from the DB based on its ID.

GetTeamFromUserIdAndContestId ( int userId, int contestId, bool loadMembers ) : ContestTeam

Retrieves the team from a given contest which contains a given member.

GetTeamIdsFromGroupId ( int groupId ) : List

Retrieves all team IDs which match the provided group.

GetTeamIdsFromUserId ( int userId ) : List

Retrieves all team IDs of which the provided user is a member.

GetTeamMembersFromTeamId ( int teamId ) : List

Retrieves the list of team members for a particular team.

GetTeamsFromContestId ( int contestId, bool loadMembers ) : List

Retrieves all teams competing in a particular contest.

LockTeam ( ContestTeam team ) : void

Notes each user's state at the beginning of a contest so that the delta score can be calculated. Sets the initialized flag to true, allowing the calculation of delta scores.

RemoveTeam ( int teamId ) : bool

Removes an existing Team from the DB.

RemoveTeamMemberFromUserIdAndContestId ( int userId, int contestId ) : bool

Removes a team member DB entry.

RemoveTeamMembersFromTeamId ( int teamId ) : bool

Removes all team member entries pertaining to a given team.

UpdateTeam ( ContestTeam team ) : bool

Updates an existing Team in the DB.

UpdateTeamMembers ( ContestTeam team ) : bool

Updates the entry of any members already existing on the team, and creates new entries for new members of the team.

UpdateTeamScore ( int teamId ) : void

Recalculates and updates the team's contest score.

UserCompetingInContest ( int userId, int contestId ) : bool

Queries the DB to see if a user is registered for a particular contest.

Приватные методы

Метод Описание
CalculateUserScore ( int userId, float initial, Statistic statistic ) : float

Calculates the user's change in the relevant statistic since the beginning of the contest; their 'score' for the contest.

GetContestIdFromTeamId ( int teamId ) : int

Retrieves the contest ID for the contest that a team is participating in.

Описание методов

CreateNewTeam() публичный статический Метод

Saves a Team as a new entry in the DB.
public static CreateNewTeam ( ContestTeam team ) : int
team ActivEarth.Objects.Competition.Contests.ContestTeam Team object to add to the DB.
Результат int

CreateNewTeamMember() публичный статический Метод

Creates a new DB entry for a team member.
public static CreateNewTeamMember ( ContestTeamMember teamMember, int teamId ) : int
teamMember ActivEarth.Objects.Competition.Contests.ContestTeamMember Member to be added to the DB.
teamId int Team ID that the member should be added to.
Результат int

CreateNewTeamMember() публичный статический Метод

Creates a new DB entry for a team member.
public static CreateNewTeamMember ( int userId, int teamId ) : int
userId int ID of the Member to be added to the DB.
teamId int Team ID that the member should be added to.
Результат int

GetCompetitorCount() публичный статический Метод

Retrieves the number of competitors for a contest.
public static GetCompetitorCount ( int contestId ) : int
contestId int ID of the contest.
Результат int

GetTeamFromTeamId() публичный статический Метод

Retrieves a Team from the DB based on its ID.
public static GetTeamFromTeamId ( int teamId, bool loadMembers ) : ContestTeam
teamId int Identifier of the team to retrieve.
loadMembers bool Indicates whether or not the team member list should be populated.
Результат ActivEarth.Objects.Competition.Contests.ContestTeam

GetTeamFromUserIdAndContestId() публичный статический Метод

Retrieves the team from a given contest which contains a given member.
public static GetTeamFromUserIdAndContestId ( int userId, int contestId, bool loadMembers ) : ContestTeam
userId int ID of the user to match the team to.
contestId int ID of the contest to match the team to.
loadMembers bool Indicates whether or not the team member lists should be populated.
Результат ActivEarth.Objects.Competition.Contests.ContestTeam

GetTeamIdsFromGroupId() публичный статический Метод

Retrieves all team IDs which match the provided group.
public static GetTeamIdsFromGroupId ( int groupId ) : List
groupId int
Результат List

GetTeamIdsFromUserId() публичный статический Метод

Retrieves all team IDs of which the provided user is a member.
public static GetTeamIdsFromUserId ( int userId ) : List
userId int
Результат List

GetTeamMembersFromTeamId() публичный статический Метод

Retrieves the list of team members for a particular team.
public static GetTeamMembersFromTeamId ( int teamId ) : List
teamId int Team ID to retrieve the members for.
Результат List

GetTeamsFromContestId() публичный статический Метод

Retrieves all teams competing in a particular contest.
public static GetTeamsFromContestId ( int contestId, bool loadMembers ) : List
contestId int ID of the contest to load teams for.
loadMembers bool Indicates whether or not the team member lists should be populated.
Результат List

LockTeam() публичный статический Метод

Notes each user's state at the beginning of a contest so that the delta score can be calculated. Sets the initialized flag to true, allowing the calculation of delta scores.
public static LockTeam ( ContestTeam team ) : void
team ActivEarth.Objects.Competition.Contests.ContestTeam
Результат void

RemoveTeam() публичный статический Метод

Removes an existing Team from the DB.
public static RemoveTeam ( int teamId ) : bool
teamId int
Результат bool

RemoveTeamMemberFromUserIdAndContestId() публичный статический Метод

Removes a team member DB entry.
public static RemoveTeamMemberFromUserIdAndContestId ( int userId, int contestId ) : bool
userId int User to remove.
contestId int Contest to remove the user from.
Результат bool

RemoveTeamMembersFromTeamId() публичный статический Метод

Removes all team member entries pertaining to a given team.
public static RemoveTeamMembersFromTeamId ( int teamId ) : bool
teamId int Team to remove the members from.
Результат bool

UpdateTeam() публичный статический Метод

Updates an existing Team in the DB.
public static UpdateTeam ( ContestTeam team ) : bool
team ActivEarth.Objects.Competition.Contests.ContestTeam Team whose record needs updating.
Результат bool

UpdateTeamMembers() публичный статический Метод

Updates the entry of any members already existing on the team, and creates new entries for new members of the team.
public static UpdateTeamMembers ( ContestTeam team ) : bool
team ActivEarth.Objects.Competition.Contests.ContestTeam Team whose members must be updated.
Результат bool

UpdateTeamScore() публичный статический Метод

Recalculates and updates the team's contest score.
public static UpdateTeamScore ( int teamId ) : void
teamId int
Результат void

UserCompetingInContest() публичный статический Метод

Queries the DB to see if a user is registered for a particular contest.
public static UserCompetingInContest ( int userId, int contestId ) : bool
userId int ID of the user.
contestId int ID of the contest to query.
Результат bool