Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="passport"></param>
        /// <param name="newProfile"></param>
        /// <returns></returns>
        public static bool OpenOrganizationService(UserPassport passport, OrganizationProfile newProfile)
        {
            passport.AssertNotNull("passport");
            newProfile.AssertNotNull("newProfile");

            return(OrganizationProfile.Transform(passport, newProfile));
        }
Beispiel #2
0
        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);
        }