C# Class ActivEarth.DAO.BadgeDAO

Afficher le fichier Open project: mlcamilli/ActivEarth

Méthodes publiques

Méthode Description
CreateNewBadge ( Badge badge ) : int

Saves a badge as a new entry in the DB.

GetAllBadges ( ) : IEnumerable
GetBadgeFromBadgeId ( int badgeId ) : Badge

Retrieves a badge matching a provided ID.

GetBadgeFromUserIdAndStatistic ( int userId, Statistic statistic ) : Badge

Retrieves a badge of a particular statistic for a specific user.

GetBadgesFromUserId ( int userId ) : List

Retrieves the collection of badges belonging to a given user.

UpdateBadge ( Badge badge ) : bool

Updates an existing Badge in the DB.

Private Methods

Méthode Description
LoadExternalBadgeData ( Badge badge ) : void

Loads the information stored in external tables for the badge (LevelRequirements, LevelRewards, etc.)

Method Details

CreateNewBadge() public static méthode

Saves a badge as a new entry in the DB.
public static CreateNewBadge ( Badge badge ) : int
badge ActivEarth.Objects.Competition.Badges.Badge Badge object to add to the DB.
Résultat int

GetAllBadges() public static méthode

public static GetAllBadges ( ) : IEnumerable
Résultat IEnumerable

GetBadgeFromBadgeId() public static méthode

Retrieves a badge matching a provided ID.
public static GetBadgeFromBadgeId ( int badgeId ) : Badge
badgeId int Identifier of the badge.
Résultat ActivEarth.Objects.Competition.Badges.Badge

GetBadgeFromUserIdAndStatistic() public static méthode

Retrieves a badge of a particular statistic for a specific user.
public static GetBadgeFromUserIdAndStatistic ( int userId, Statistic statistic ) : Badge
userId int Identifier of the badge owner.
statistic Statistic Statistic tracked by the badge.
Résultat ActivEarth.Objects.Competition.Badges.Badge

GetBadgesFromUserId() public static méthode

Retrieves the collection of badges belonging to a given user.
public static GetBadgesFromUserId ( int userId ) : List
userId int
Résultat List

UpdateBadge() public static méthode

Updates an existing Badge in the DB.
public static UpdateBadge ( Badge badge ) : bool
badge ActivEarth.Objects.Competition.Badges.Badge Badge whose record needs updating.
Résultat bool