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); } }
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"); }
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"); }
public static List<Group> GetGroupsForUser(User user) { return GetGroupsForUser(user.ID.Value); }
public static Dictionary<Venue, int> GetVenuesForUser(User user, bool limit) { return GetVenuesForUser(user.ID.Value, limit); }
public static Dictionary<Venue, int> GetVenuesForUser(User user) { return GetVenuesForUser(user, false); }