本文整理汇总了C#中UserAccount.RemoveCache方法的典型用法代码示例。如果您正苦于以下问题:C# UserAccount.RemoveCache方法的具体用法?C# UserAccount.RemoveCache怎么用?C# UserAccount.RemoveCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAccount
的用法示例。
在下文中一共展示了UserAccount.RemoveCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessRequest
//.........这里部分代码省略.........
#endregion
break;
case SiteEnums.QueryStringNames.menu:
#region menu
mu = MembershipWrapper.GetUser();
int userCountChat = 0;
int userMessages = 0;
int unconfirmedUsers = 0;
int notifications = 0;
if (mu != null)
{
// log off users who are offline
var uasOffline = new UserAccounts();
uasOffline.GetWhoIsOffline(true);
foreach (UserAccount uaoff1 in uasOffline)
{
var cru = new ChatRoomUser();
cru.GetChatRoomUserByUserAccountID(uaoff1.UserAccountID);
if (cru.ChatRoomUserID > 0)
{
cru.DeleteChatRoomUser();
}
var offlineUser = new UserAccount(uaoff1.UserAccountID);
offlineUser.RemoveCache();
}
userCountChat = ChatRoomUsers.GetChattingUserCount();
userMessages = DirectMessages.GetDirectMessagesToUserCount(mu);
unconfirmedUsers =
UserConnections.GetCountUnconfirmedConnections(Convert.ToInt32(mu.ProviderUserKey));
}
// get users online
int onlineUsers = UserAccounts.GetOnlineUserCount();
if (mu != null)
{
notifications =
StatusUpdateNotifications.GetStatusUpdateNotificationCountForUser(
Convert.ToInt32(mu.ProviderUserKey));
}
string timedMessge = string.Format(
@"{{""UserCountChat"": ""{0}"",
""UserMessages"": ""{1}"",
""OnlineUsers"": ""{2}"",
""Notifications"": ""{3}"",
""UnconfirmedUsers"": ""{4}""}}", userCountChat, userMessages, onlineUsers, notifications,
unconfirmedUsers);
context.Response.Write(timedMessge);
#endregion
break;
示例2: LogOff
public ActionResult LogOff()
{
if (Membership.GetUser() == null)
{
FormsAuthentication.SignOut();
return RedirectToAction("Index", "Home");
}
ua = new UserAccount(Membership.GetUser().UserName);
ua.IsOnLine = false;
ua.SigningOut = true;
ua.Update();
ua.RemoveCache();
ChatRoomUser cru = new ChatRoomUser();
cru.GetChatRoomUserByUserAccountID(ua.UserAccountID);
cru.DeleteChatRoomUser();
FormsAuthentication.SignOut();
return RedirectToAction("Index", "Home");
}
示例3: ProcessRequest
//.........这里部分代码省略.........
// get count in video room
int userCountChat = 0;
// get new mail
int userMessages = 0;
// get new users
int unconfirmedUsers = 0;
// status notifications
int notifications = 0;
if (mu != null)
{
// log off users who are offline
UserAccounts uasOffline = new UserAccounts();
uasOffline.GetWhoIsOffline(true);
UserAccount offlineUser = null;
foreach (UserAccount uaoff1 in uasOffline)
{
ChatRoomUser cru = new ChatRoomUser();
cru.GetChatRoomUserByUserAccountID(uaoff1.UserAccountID);
if (cru.ChatRoomUserID > 0)
{
cru.DeleteChatRoomUser();
}
offlineUser = new UserAccount(uaoff1.UserAccountID);
offlineUser.RemoveCache();
}
userCountChat = ChatRoomUsers.GetChattingUserCount();
userMessages = BootBaronLib.AppSpec.DasKlub.BOL.DirectMessages.GetDirectMessagesToUserCount(mu);
unconfirmedUsers = BootBaronLib.AppSpec.DasKlub.BOL.UserConnections.GetCountUnconfirmedConnections(Convert.ToInt32(mu.ProviderUserKey));
}
// get users online
int onlineUsers = UserAccounts.GetOnlineUserCount();
if (mu != null)
{
notifications = StatusUpdateNotifications.GetStatusUpdateNotificationCountForUser(Convert.ToInt32(mu.ProviderUserKey));
}
string timedMessge = string.Format(
@"{{""UserCountChat"": ""{0}"",
""UserMessages"": ""{1}"",
""OnlineUsers"": ""{2}"",
""Notifications"": ""{3}"",
""UnconfirmedUsers"": ""{4}""}}",userCountChat,userMessages,onlineUsers,notifications,unconfirmedUsers);
context.Response.Write(timedMessge);
#endregion
break;
case SiteEnums.QueryStringNames.random:
#region random
if (!string.IsNullOrEmpty(context.Request.QueryString[SiteEnums.QueryStringNames.currentvidid.ToString()]))
{
context.Response.Write(Video.GetRandomJSON(