當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。