Exemplo n.º 1
0
        public static void BeginSignUpRequest(string email, string password, string forename, string surname, bool wlOptIn)
        {
            User newUser = new User();

            if (!string.IsNullOrEmpty(email))
                newUser.Email = email;
            if (!string.IsNullOrEmpty(password))
                newUser.Password = password;
            if (!string.IsNullOrEmpty(forename))
                newUser.Forename = forename;
            if (!string.IsNullOrEmpty(surname))
                newUser.Surname = surname;
            newUser.WindowsLiveEnabled = wlOptIn;

            try
            {
                newUser.Save();

                FormsAuthentication.SetAuthCookie(newUser.Email, false);

                if (wlOptIn)
                    HttpContext.Current.Response.Redirect(WindowsLiveHelper.GetWindowsLiveInviteURL());
                else
                    HttpContext.Current.Response.Redirect(LinkHelper.SignUp.Confirmation);
            }
            catch (Exception e)
            {
                throw new Exception("Problem saving user:", e);
            }
        }
Exemplo n.º 2
0
 public static void AddGroupUser(Group group, User user)
 {
     if (group.ID.HasValue && user.ID.HasValue)
         AddGroupUser(group.ID.Value, user.ID.Value);
     else
         throw new Exception("Cannot add a user to a group when either the user or group has not been saved");
 }
Exemplo n.º 3
0
 public static void RemoveGroupUser(Group group, User user)
 {
     if (group.ID.HasValue && user.ID.HasValue)
         RemoveGroupUser(group.ID.Value, user.ID.Value);
     else
         throw new Exception("Cannot remove a user from a group when either the user or group has not been saved");
 }
Exemplo n.º 4
0
 public static List<Group> GetGroupsForUser(User user)
 {
     return GetGroupsForUser(user.ID.Value);
 }
Exemplo n.º 5
0
 public static Dictionary<Venue, int> GetVenuesForUser(User user, bool limit)
 {
     return GetVenuesForUser(user.ID.Value, limit);
 }
Exemplo n.º 6
0
 public static Dictionary<Venue, int> GetVenuesForUser(User user)
 {
     return GetVenuesForUser(user, false);
 }