本文整理匯總了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);
}
}
}