当前位置: 首页>>代码示例>>C#>>正文


C# SiteUser.UpdateLastActivityTime方法代码示例

本文整理汇总了C#中mojoPortal.Business.SiteUser.UpdateLastActivityTime方法的典型用法代码示例。如果您正苦于以下问题:C# SiteUser.UpdateLastActivityTime方法的具体用法?C# SiteUser.UpdateLastActivityTime怎么用?C# SiteUser.UpdateLastActivityTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mojoPortal.Business.SiteUser的用法示例。


在下文中一共展示了SiteUser.UpdateLastActivityTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadPersonalizationBlobs

        public static void LoadPersonalizationBlobs(
            SiteSettings siteSettings,
            WebPartManager webPartManager,
            string path,
            string userName,
            ref byte[] sharedDataBlob,
            ref byte[] userDataBlob)
        {
            if (siteSettings != null)
            {
                if ((userName != null) && (userName.Length > 0))
                {
                    SiteUser siteUser = new SiteUser(siteSettings, userName);
                    Guid userID = Guid.Empty;
                    if (siteUser.UserId > 0)
                    {
                        userID = siteUser.UserGuid;
                    }

                    if (userID != Guid.Empty)
                    {
                        userDataBlob = SitePersonalization.GetPersonalizationBlob(
                            siteSettings.SiteId,
                            path,
                            userID);

                        siteUser.UpdateLastActivityTime();

                        sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
                            siteSettings.SiteId,
                            path);

                    }
                }
                else
                {
                    //TODO: tracking/personalization for unauthenticated users?

                    sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
                            siteSettings.SiteId,
                            path);

                }

            }
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:46,代码来源:PersonalizationHelper.cs

示例2: ResetPersonalizationBlob

        public static void ResetPersonalizationBlob(
            SiteSettings siteSettings,
            WebPartManager webPartManager,
            string path,
            string userName)
        {
            //if (userName == null) return;
            //if (userName.Length == 0) return;
            if (siteSettings == null) return;
            if (path == null) return;
            if (path.Length == 0) return;
            if (webPartManager == null) return;

            // delete personlization settings for this user for this path
            if (!String.IsNullOrEmpty(userName))
            {
                SiteUser siteUser = new SiteUser(siteSettings, userName);
                Guid userID = Guid.Empty;
                if (siteUser.UserId > -1)
                {
                    userID = siteUser.UserGuid;
                }

                if (userID != Guid.Empty)
                {
                    SitePersonalization.ResetPersonalizationBlob(
                        siteSettings.SiteId,
                        path,
                        userID);

                    siteUser.UpdateLastActivityTime();

                }
            }
            else
            {
                SitePersonalization.ResetPersonalizationBlob(
                        siteSettings.SiteId,
                        path);
            }
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:41,代码来源:PersonalizationHelper.cs

示例3: GetUser

        public override MembershipUser GetUser(string username, bool userIsOnline)
        {
            /*
             * 	Takes, as input, a user name or user ID (the method is overloaded) and a
             * Boolean value indicating whether to update the user's LastActivityDate to
             * show that the user is currently online. GetUser returns a MembershipUser object
             * representing the specified user. If the user name or user ID is invalid (that is, if
             * it doesn't represent a registered user) GetUser returns null (Nothing in Visual Basic).
             */
            SiteSettings siteSettings = GetSiteSettings();

            if ((siteSettings != null) && (username != null)&&(username.Length > 0))
            {
                SiteUser siteUser = null;
                siteUser = new SiteUser(siteSettings, username);
                if (siteUser.UserId > 0)
                {
                    if (siteUser.IsDeleted) { return null; }

                    if (userIsOnline)
                    {
                        siteUser.UpdateLastActivityTime();
                    }
                    return this.CreateMembershipUserFromSiteUser(siteUser);
                }
            }

            return null;
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:29,代码来源:mojoMembershipProvider.cs

示例4: SavePersonalizationBlob

        public static void SavePersonalizationBlob(
            SiteSettings siteSettings,
            WebPartManager webPartManager,
            string path,
            string userName,
            byte[] dataBlob)
        {
            if (siteSettings != null)
            {
                if ((userName != null) && (userName.Length > 0))
                {
                    SiteUser siteUser = new SiteUser(siteSettings, userName);
                    Guid userID = Guid.Empty;
                    if (siteUser.UserId > 0)
                    {
                        userID = siteUser.UserGuid;
                    }

                    if (userID != Guid.Empty)
                    {

                        SitePersonalization.SavePersonalizationBlob(
                            siteSettings.SiteId,
                            path,
                            userID,
                            dataBlob,
                            DateTime.Now);

                        siteUser.UpdateLastActivityTime();

                    }
                }
                else
                {
                    SitePersonalization.SavePersonalizationBlobAllUsers(
                        siteSettings.SiteId,
                        path,
                        dataBlob,
                        DateTime.Now);

                }
            }
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:43,代码来源:PersonalizationHelper.cs


注:本文中的mojoPortal.Business.SiteUser.UpdateLastActivityTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。