C# Class ActivEarth.DAO.UserStatisticDAO

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

Public Methods

Method Description
CreateNewStatisticForUser ( int userId, Statistic statType, float val ) : int

Saves a user statistic as a new entry in the DB.

GetAllStatisticsByUserId ( int userId ) : List

Retrieves all of a User's Statistics from the DB.

GetStatisticFromStatisticId ( int statisticId ) : UserStatistic

Retrieve's a UserStatistic from the DB based on the statistic's ID.

GetStatisticFromUserIdAndStatType ( int userId, Statistic statType ) : UserStatistic

Retrieves a User's Statistic from the DB based on the user's ID and statistic type.

UpdateUserStatistic ( UserStatistic statistic ) : bool

Updates an existing UserStatistic in the DB.

Method Details

CreateNewStatisticForUser() public static method

Saves a user statistic as a new entry in the DB.
public static CreateNewStatisticForUser ( int userId, Statistic statType, float val ) : int
userId int User to create stat for.
statType Statistic Statistic type to create.
val float Value of the statistic.
return int

GetAllStatisticsByUserId() public static method

Retrieves all of a User's Statistics from the DB.
public static GetAllStatisticsByUserId ( int userId ) : List
userId int ID of user to fetch statistic info for.
return List

GetStatisticFromStatisticId() public static method

Retrieve's a UserStatistic from the DB based on the statistic's ID.
public static GetStatisticFromStatisticId ( int statisticId ) : UserStatistic
statisticId int ID of statistic to fetch.
return ActivEarth.Objects.Profile.UserStatistic

GetStatisticFromUserIdAndStatType() public static method

Retrieves a User's Statistic from the DB based on the user's ID and statistic type.
public static GetStatisticFromUserIdAndStatType ( int userId, Statistic statType ) : UserStatistic
userId int ID of user to fetch statistic info for.
statType Statistic Type of statistic to retrieve from user.
return ActivEarth.Objects.Profile.UserStatistic

UpdateUserStatistic() public static method

Updates an existing UserStatistic in the DB.
public static UpdateUserStatistic ( UserStatistic statistic ) : bool
statistic ActivEarth.Objects.Profile.UserStatistic UserStatistic whose record needs updating.
return bool