Ejemplo n.º 1
0
        public LoggedInSessionInfo CreateUserAccount(UserAccountDto userAccount)
        {
            var userSession = new LoggedInSessionInfo {
            };

            userAccount.GravatarUrl = UserService.GetGravatarHash(userAccount.EmailAddress);
            var userId = accountRepository.Save(userAccount);

            //Create a default team for the user
            var team = new TeamDto {
                Name = userAccount.Name.Replace(" ", "-"), CreatedById = userId
            };

            if (team.Name.Length > 19)
            {
                team.Name = team.Name.Substring(0, 19);
            }

            var teamId = teamRepository.SaveTeam(team);

            teamRepository.SaveTeamMember(teamId, userId, userId);

            teamRepository.SaveDefaultTeamForUser(userId, teamId);

            userSession.TeamId          = teamId;
            userSession.UserId          = userId;
            userSession.UserDisplayName = userAccount.Name;
            return(userSession);
        }
 protected void SetUserIDToSession(LoggedInSessionInfo sessionInfo)
 {
     HttpContext.Current.Session["TB_UserID"]   = sessionInfo.UserId;
     HttpContext.Current.Session["TB_TeamID"]   = sessionInfo.TeamId;
     HttpContext.Current.Session["TB_NickName"] = sessionInfo.UserDisplayName;
 }
Ejemplo n.º 3
0
 public void SetUserIDToSession(LoggedInSessionInfo loggedInSessionInfo)
 {
     _session.SetInt32(userIdKey, loggedInSessionInfo.UserId);
     _session.SetInt32(teamIdKey, loggedInSessionInfo.TeamId);
 }
Ejemplo n.º 4
0
 protected void SetUserIDToSession(LoggedInSessionInfo sessionInfo)
 {
     Session["TB_UserID"]   = sessionInfo.UserId;
     Session["TB_TeamID"]   = sessionInfo.TeamId;
     Session["TB_NickName"] = sessionInfo.UserDisplayName;
 }