Exemplo n.º 1
0
        private static void MemberSetUp(Member member)
        {
            CreateUserDirectories(member);

            var defaultGallery = new PhotoCollection()
            {
                WebPhotoCollectionID = UniqueID.NewWebID(),
                MemberID = member.MemberID,
                DTCreated = DateTime.Now,
                Name = member.NickName + "'s Gallery",
                Description = "My First Gallery!"
            };
            defaultGallery.Save();

            string StatusText = "New to next2Friends!";

            /* Create a new member profile for the member. */
            var profile = new MemberProfile()
            {
                MemberID = member.MemberID,
                DTLastUpdated = DateTime.Now,
                DefaultPhotoCollectionID = defaultGallery.PhotoCollectionID,
                TagLine = StatusText
            };
            profile.Save();

            MemberStatusText.UpdateStatusText(member.MemberID, StatusText);

            var message = new Message()
            {
                Body = "Welcome to Next2Friends",
                WebMessageID = UniqueID.NewWebID(),
                MemberIDFrom = 31,
                MemberIDTo = member.MemberID,
                DTCreated = DateTime.Now
            };
            message.Save();
            message.InReplyToID = message.MessageID;
            message.Save();

            /* Create the default settings for the member. */
            var settings = new MemberSettings()
            {
                NotifyNewPhotoComment = true,
                NotifyNewProfileComment = true,
                NotifyNewVideoComment = true,
                NotifyOnAAFComment = true,
                NotifyOnFriendRequest = true,
                NotifyOnNewMessage = true,
                NotifyOnNewsLetter = true,
                NotifyOnSubscriberEvent = true,
                MemberID = member.MemberID
            };
            settings.Save();

            var matchProfile = new MatchProfile()
            {
                MemberID = member.MemberID
            };
            matchProfile.Save();

            var device = new Device()
            {
                MemberID = member.MemberID,
                PrivateEncryptionKey = UniqueID.NewEncryptionKey(),
                CreatedDT = DateTime.Now,
                DeviceTagID = Guid.NewGuid().ToString()
            };
            device.Save();

            // Lawrence: Added block to register default friends and profile views
            try
            {
                // Add Lawrence as Auto Friend
                Friend.AddFriend(1, member.MemberID);
                // Add Anthony as Auto Friend
                Friend.AddFriend(3, member.MemberID);
                // Add Hans as Auto Friend
                Friend.AddFriend(24, member.MemberID);
                // Add Becca as Auto Friend
                Friend.AddFriend(30, member.MemberID);

                ContentViewed(new Member(1), member.MemberID, CommentType.Member);
                ContentViewed(new Member(3), member.MemberID, CommentType.Member);
                ContentViewed(new Member(24), member.MemberID, CommentType.Member);
                ContentViewed(new Member(30), member.MemberID, CommentType.Member);
            }
            catch { }

            SetOnlineNow(member.MemberID);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of Devices
        /// </summary>
        public static List<Device> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

            List<Device> arr = new List<Device>();

            Device obj;

            while (dr.Read())
            {
                obj = new Device();
                if (list.IsColumnPresent("DeviceID")) { obj._deviceID = (int)dr["DeviceID"]; }
                if (list.IsColumnPresent("DeviceTagID")) { obj._deviceTagID = (string)dr["DeviceTagID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("PrivateEncryptionKey")) { obj._privateEncryptionKey = (string)dr["PrivateEncryptionKey"]; }
                if (list.IsColumnPresent("CreatedDT")) { obj._createdDT = (DateTime)dr["CreatedDT"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }