C# Class ActivEarth.DAO.BadgeDAO

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

Public Methods

Method 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

Method Description
LoadExternalBadgeData ( Badge badge ) : void

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

Method Details

CreateNewBadge() public static method

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

GetAllBadges() public static method

public static GetAllBadges ( ) : IEnumerable
return IEnumerable

GetBadgeFromBadgeId() public static method

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

GetBadgeFromUserIdAndStatistic() public static method

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.
return ActivEarth.Objects.Competition.Badges.Badge

GetBadgesFromUserId() public static method

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

UpdateBadge() public static method

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