コード例 #1
0
        public void Insert(Guid CtyId, Guid UsrId, bool CurIsOwner, int?CurStatus, DateTime?CurInsertedDate, Guid?UsrIdInvitedBy)
        {
            HirelCommunityUserCur item = new HirelCommunityUserCur();

            item.CtyId = CtyId;

            item.UsrId = UsrId;

            item.CurIsOwner = CurIsOwner;

            item.CurStatus = CurStatus;

            item.CurInsertedDate = CurInsertedDate;

            item.UsrIdInvitedBy = UsrIdInvitedBy;


            item.Save(UserName);
        }
コード例 #2
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);
        }
コード例 #3
0
 public bool Destroy(object CtyId)
 {
     return(HirelCommunityUserCur.Destroy(CtyId) == 1);
 }