/// <summary> /// /// </summary> /// <returns></returns> internal bool SignUp(SignedUpInfo signedUpInfo) { using (var transactionScope = new TransactionScope(TransactionScopeOption.Required)) { var result = this.Save(); if (null != signedUpInfo) { signedUpInfo.SignedUpTime = this.CreatedTime; signedUpInfo.PassportId = this.PassportId; signedUpInfo.Save(); } transactionScope.Complete(); return(result); } }
public static UserPassport SignUp(string email, string userName, string password, ProfileType selectedProfileType, SignedUpInfo signedUpInfo) { var status = SignStatus.Error; var passport = SignUp(email, userName, password, selectedProfileType, signedUpInfo, out status); if (null == password) { throw new Exception(status.ToString()); } return(passport); }
/// <summary> /// /// </summary> /// <param name="mobilePhone"></param> /// <param name="password"></param> /// <param name="selectedProfileType"></param> /// <param name="signedUpInfo"></param> /// <param name="status"></param> /// <returns></returns> public static UserPassport SignUp(string mobilePhone, string password, ProfileType selectedProfileType, SignedUpInfo signedUpInfo, out SignStatus status) { status = SignStatus.None; status = CheckMobilePhone(mobilePhone); if (status != SignStatus.None) { return(null); } status = CheckPassword(password); if (status != SignStatus.None) { return(null); } return(SignUp(null, mobilePhone, null, password, selectedProfileType, signedUpInfo, out status)); }
private static UserPassport SignUp(string email, string mobilePhone, string userName, string password, ProfileType selectedProfileType, SignedUpInfo signedUpInfo, out SignStatus status) { var userPassport = new UserPassport() { UserSecurity = new UserSecurity(), Profile = new UserProfile() }; userPassport.Email = email; userPassport.MobilePhone = mobilePhone; userPassport.UserName = userName; userPassport.MultipleProfiles = selectedProfileType; userPassport.UserSecurity.Password = password; userPassport.Profile.CurrentProfileType = selectedProfileType; userPassport.Profile.CreatedTime = userPassport.CreatedTime; userPassport.Profile.LastSignedInTime = userPassport.Profile.CreatedTime; userPassport.Profile.LastActivityTime = userPassport.Profile.CreatedTime; userPassport.Profile.Email = email; status = SignStatus.Error; if (userPassport.SignUp(signedUpInfo)) { status = SignStatus.Success; if (selectedProfileType == ProfileType.OrganizationProfile) { OrganizationProfile.Transform(userPassport, new OrganizationProfile()); } if (null != OnSignUp) { OnSignUp(userPassport); } } return(userPassport); }
/// <summary> /// /// </summary> /// <param name="email"></param> /// <param name="userName"></param> /// <param name="password"></param> /// <param name="selectedProfileType"></param> /// <param name="signedUpInfo"></param> /// <param name="status"></param> /// <returns></returns> public static UserPassport SignUp(string email, string userName, string password, ProfileType selectedProfileType, SignedUpInfo signedUpInfo, out SignStatus status) { status = CheckEmail(email); if (status != SignStatus.None) { return(null); } status = CheckUserName(userName); if (status != SignStatus.None) { return(null); } status = CheckPassword(password); if (status != SignStatus.None) { return(null); } return(SignUp(email, null, userName, password, selectedProfileType, signedUpInfo, out status)); }