示例#1
0
        public static Guid CreateUserProfileCommunity(UserDataContext udc, UserProfile userProfile)
        {
            string layoutName    = CustomizationSection.CachedInstance.DefaultLayouts.ProfileCommunity;
            Guid   communityIdD  = Guid.NewGuid();
            Guid   currentPageId = Guid.NewGuid();
            string strUserKey    = userProfile.UserId.ToString();

            DataObjectProfileCommunity dataObjectCommunity = new DataObjectProfileCommunity(UserDataContext.GetUserDataContext(userProfile.Nickname));

            dataObjectCommunity.Status      = ObjectStatus.Public;
            dataObjectCommunity.Title       = userProfile.Nickname;
            dataObjectCommunity.CommunityID = communityIdD;
            dataObjectCommunity.Insert(udc);

            HitblCommunityCty community = new HitblCommunityCty();

            community.CtyInsertedDate = DateTime.Now;
            community.CtyUpdatedDate  = DateTime.Now;
            community.CtyVirtualUrl   = userProfile.Nickname;
            community.UsrIdInserted   = userProfile.UserId;
            community.UsrIdUpdated    = userProfile.UserId;
            community.CtyIsProfile    = true;
            community.CtyStatus       = (int)CommunityStatus.Initializing;
            community.CtyLayout       = layoutName;
            community.CtyTheme        = Constants.DEFAULT_THEME;
            community.CtyId           = communityIdD;
            community.Save();

            HirelCommunityUserCur.Insert(communityIdD, userProfile.UserId, true, 0, DateTime.Now, Guid.Empty);
            HirelCommunityUserCur.Insert(community.CtyId, new Guid(Constants.ADMIN_USERID), true, 0, DateTime.Now, Guid.Empty);

            userProfile.ProfileCommunityID = communityIdD;
            userProfile.Save();
            currentPageId       = PagesConfig.CreateNewPage(communityIdD, "Profile", "Private", "Dashboard").PagId;
            currentPageId       = PagesConfig.CreateNewPage(communityIdD, "Profile", "Start", "Home").PagId;
            community.CtyStatus = (int)CommunityStatus.Ready;
            community.Save();

            FriendHandler.TransferFriendAsCommunityMember(communityIdD, userProfile.UserId);

            return(communityIdD);
        }
示例#2
0
        public void Update(Guid CtyId, string CtyVirtualUrl, DateTime?CtyStartDate, DateTime?CtyEndDate, int?CtyStatus, int?CtyPriority, DateTime?CtyLastBatchRunning, DateTime CtyInsertedDate, DateTime?CtyUpdatedDate, string CtyLayout, string CtyTheme, Guid?UsrIdInserted, Guid?UsrIdUpdated, string CtyBodyStyle, string CtyHeaderStyle, string CtyFooterStyle, bool CtyIsProfile)
        {
            HitblCommunityCty item = new HitblCommunityCty();

            item.MarkOld();
            item.IsLoaded = true;

            item.CtyId = CtyId;

            item.CtyVirtualUrl = CtyVirtualUrl;

            item.CtyStartDate = CtyStartDate;

            item.CtyEndDate = CtyEndDate;

            item.CtyStatus = CtyStatus;

            item.CtyPriority = CtyPriority;

            item.CtyLastBatchRunning = CtyLastBatchRunning;

            item.CtyInsertedDate = CtyInsertedDate;

            item.CtyUpdatedDate = CtyUpdatedDate;

            item.CtyLayout = CtyLayout;

            item.CtyTheme = CtyTheme;

            item.UsrIdInserted = UsrIdInserted;

            item.UsrIdUpdated = UsrIdUpdated;

            item.CtyBodyStyle = CtyBodyStyle;

            item.CtyHeaderStyle = CtyHeaderStyle;

            item.CtyFooterStyle = CtyFooterStyle;

            item.CtyIsProfile = CtyIsProfile;

            item.Save(UserName);
        }