Esempio n. 1
0
        public static DataForNewUser GetDataForNewUser(AuthUser user)
        {
            if (user == null || user == User.Guest)
            {
                return(null);
            }

            DataForNewUser userDataProxy = new DataForNewUser();

            ConvertUserProxy(userDataProxy, user);

            userDataProxy.GenderName     = user.GenderName;
            userDataProxy.ExtendedFields = new List <UserExtendedValueProxy>();

            foreach (UserExtendedValue extendedValue in user.ExtendedFields)
            {
                userDataProxy.ExtendedFields.Add(GetUserExtendedValueProxy(extendedValue));
            }

            userDataProxy.IPAddress       = user.LastVisitIP;
            userDataProxy.IsActive        = user.IsActive;
            userDataProxy.Password        = user.Password;
            userDataProxy.PasswordFormat  = (int)user.PasswordFormat;
            userDataProxy.Signature       = user.Signature;
            userDataProxy.SignatureFormat = (int)user.SignatureFormat;
            userDataProxy.TimeZone        = user.TimeZone;
            userDataProxy.InviterID       = user.InviterID;

            //getfriend

            FriendGroupCollection friendgroups = user.FriendGroups;

            userDataProxy.FriendGroups = new List <MaxLabs.Passport.Proxy.FriendGroupProxy>();

            foreach (FriendGroup fg in friendgroups)
            {
                MaxLabs.Passport.Proxy.FriendGroupProxy fgp = GetFriendGroupProxy(fg);
                userDataProxy.FriendGroups.Add(fgp);
                FriendCollection friends = FriendBO.Instance.GetFriends(user.UserID, fg.GroupID);

                foreach (MaxLabs.bbsMax.Entities.Friend friend in friends)
                {
                    fgp.Friends.Add(GetFriendProxy(friend));
                }
            }

            //getExtendedFields
            //userDataProxy.ExtendedFields = GetStringKeyValueList(user.ExtendedFields);

            return(userDataProxy);
        }
Esempio n. 2
0
        void UserBO_OnUserCreated(AuthUser newUser)
        {
            DataForNewUser data = ProxyConverter.GetDataForNewUser(newUser);

            CreateInstruct(0, InstructType.User_Create, data);
        }