C# Class JustPressPlay.Models.Repositories.UserRepository

Inheritance: Repository
显示文件 Open project: RIT-MAGIC/JustPressPlay Class Usage Examples

Public Methods

Method Description
AcceptFriendRequest ( int id ) : System.Boolean

Accepts a friend request between the specified id (the source) and the logged in user (the destination)

AddFriend ( int id ) : System.Boolean

Attempts to add a friend (sends a request)

AddOrUpdateFacebookSettings ( user user, bool notificationsEnabled, bool automaticSharingEnabled ) : void

Adds (or, if it exists, updates) a user's Facebook settings

DeclineFriendRequest ( int id ) : System.Boolean

Declines a friend request between the specified id (the source) and the logged in user (the destination)

GetAllActiveUsers ( ) : List
GetAllCaretakers ( ) : List
GetAllUsers ( ) : List
GetCommunicationSettingsById ( int id ) : int
GetPrivacySettingsById ( int id ) : int
GetUser ( int id ) : user
GetUser ( string username ) : user
GetUserByEmail ( string email ) : user
GetUserFacebookSettingsById ( int userId ) : facebook_connection

Attempts to get a user's Facebook settings

IgnoreFriendRequest ( int id ) : System.Boolean

Ignores a friend request between the specified id (the source) and the logged in user (the destination)

RemoveFriend ( int id ) : System.Boolean

Removes a friendship between the specified id and the logged in user

Save ( ) : void
UpdateFacebookDataForExistingConnection ( user user, string fbUserId, string accessToken, System.DateTime accessTokenExpiration ) : void

Updates the Facebook connection data (i.e. access token, etc) for a given user. It is assumed there is already a Facebook connection entry in the database.

UpdateLastLogin ( string username ) : void
UpdateUserSettings ( int userId, int communicationSettings, int privacySettings ) : void
UserEditProfile ( int userID, String image, String displayName, String sixWordBio, String fullBio ) : bool
UserRepository ( UnitOfWork unitOfWork ) : System

Creates a new user repository

Method Details

AcceptFriendRequest() public method

Accepts a friend request between the specified id (the source) and the logged in user (the destination)
public AcceptFriendRequest ( int id ) : System.Boolean
id int The id of the source of the friend request
return System.Boolean

AddFriend() public method

Attempts to add a friend (sends a request)
public AddFriend ( int id ) : System.Boolean
id int The id of the user to add as a friend
return System.Boolean

AddOrUpdateFacebookSettings() public method

Adds (or, if it exists, updates) a user's Facebook settings
public AddOrUpdateFacebookSettings ( user user, bool notificationsEnabled, bool automaticSharingEnabled ) : void
user user
notificationsEnabled bool
automaticSharingEnabled bool
return void

DeclineFriendRequest() public method

Declines a friend request between the specified id (the source) and the logged in user (the destination)
public DeclineFriendRequest ( int id ) : System.Boolean
id int The id of the source of the friend request
return System.Boolean

GetAllActiveUsers() public method

public GetAllActiveUsers ( ) : List
return List

GetAllCaretakers() public method

public GetAllCaretakers ( ) : List
return List

GetAllUsers() public method

public GetAllUsers ( ) : List
return List

GetCommunicationSettingsById() public method

public GetCommunicationSettingsById ( int id ) : int
id int
return int

GetPrivacySettingsById() public method

public GetPrivacySettingsById ( int id ) : int
id int
return int

GetUser() public method

public GetUser ( int id ) : user
id int
return user

GetUser() public method

public GetUser ( string username ) : user
username string
return user

GetUserByEmail() public method

public GetUserByEmail ( string email ) : user
email string
return user

GetUserFacebookSettingsById() public method

Attempts to get a user's Facebook settings
public GetUserFacebookSettingsById ( int userId ) : facebook_connection
userId int The user's ID
return facebook_connection

IgnoreFriendRequest() public method

Ignores a friend request between the specified id (the source) and the logged in user (the destination)
public IgnoreFriendRequest ( int id ) : System.Boolean
id int The id of the source of the friend request
return System.Boolean

RemoveFriend() public method

Removes a friendship between the specified id and the logged in user
public RemoveFriend ( int id ) : System.Boolean
id int The id of the friend to remove
return System.Boolean

Save() public method

public Save ( ) : void
return void

UpdateFacebookDataForExistingConnection() public method

Updates the Facebook connection data (i.e. access token, etc) for a given user. It is assumed there is already a Facebook connection entry in the database.
public UpdateFacebookDataForExistingConnection ( user user, string fbUserId, string accessToken, System.DateTime accessTokenExpiration ) : void
user user The user to be updated
fbUserId string The user's ID on Facebook
accessToken string The access token provided by Facebook
accessTokenExpiration System.DateTime The date/time the access token will expire
return void

UpdateLastLogin() public method

public UpdateLastLogin ( string username ) : void
username string
return void

UpdateUserSettings() public method

public UpdateUserSettings ( int userId, int communicationSettings, int privacySettings ) : void
userId int
communicationSettings int
privacySettings int
return void

UserEditProfile() public method

public UserEditProfile ( int userID, String image, String displayName, String sixWordBio, String fullBio ) : bool
userID int
image String
displayName String
sixWordBio String
fullBio String
return bool

UserRepository() public method

Creates a new user repository
public UserRepository ( UnitOfWork unitOfWork ) : System
unitOfWork UnitOfWork The unit of work that created this repository
return System