本文整理汇总了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);
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
}