protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (SessionManager.IsLoggedIn) { TransitAccountMessageFolder inbox = SessionManager.GetInstance <TransitAccountMessageFolder, int, string>( SessionManager.AccountId, "inbox", SessionManager.AccountService.GetAccountMessageSystemFolder); if (inbox != null) { linkRequestsStar.Visible = (inbox.UnReadMessageCount > 0); linkInbox.InnerText = string.Format("{0} ({1})", HttpContext.GetGlobalResourceObject("Links", "Inbox"), inbox.UnReadMessageCount); } linkRequests.InnerText = string.Format("{0} ({1})", HttpContext.GetGlobalResourceObject("Links", "Requests"), SessionManager.GetCount <TransitAccountFriendRequest, int>( SessionManager.AccountId, SessionManager.SocialService.GetAccountFriendRequestsCount)); linkInvitations.InnerText = string.Format("{0} ({1})", HttpContext.GetGlobalResourceObject("Links", "Invitations"), SessionManager.GetCount <TransitAccountGroupAccountInvitation, int>( SessionManager.AccountId, SessionManager.GroupService.GetAccountGroupAccountInvitationsByAccountIdCount)); linkAccountPlaceRequests.InnerText = string.Format("{0} ({1})", HttpContext.GetGlobalResourceObject("Links", "Requests"), SessionManager.GetCount <TransitAccountPlaceRequest, int>( SessionManager.AccountId, SessionManager.PlaceService.GetAccountPlaceRequestsByAccountIdCount)); } } }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id = RequestId; SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Messages", Request, "AccountMessageFoldersManage.aspx")); DomainClass cs = SessionManager.GetDomainClass("AccountMessageFolder"); inputName.MaxLength = cs["Name"].MaxLengthInChars; if (id > 0) { TransitAccountMessageFolder tw = SessionManager.AccountService.GetAccountMessageFolderById(SessionManager.Ticket, id); inputName.Text = Renderer.Render(tw.Name); sitemapdata.Add(new SiteMapDataAttributeNode(tw.Name, Request.Url)); } else { sitemapdata.Add(new SiteMapDataAttributeNode("New Folder", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { linkCancel.NavigateUrl = ReturnUrl; TransitAccountMessage message = SessionManager.AccountService.GetAccountMessageById( SessionManager.Ticket, RequestId); messageSenderLink.HRef = messageFrom.NavigateUrl = string.Format("AccountView.aspx?id={0}", message.SenderAccountId); messageFrom.Text = messageSenderName.Text = Renderer.Render(message.SenderAccountName); messageTo.NavigateUrl = string.Format("AccountView.aspx?id={0}", message.RecepientAccountId); messageTo.Text = Renderer.Render(message.RecepientAccountName); messageSent.Text = message.Sent.ToString(); messageSenderImage.ImageUrl = string.Format("AccountPictureThumbnail.aspx?id={0}", message.SenderAccountPictureId); messageSubject.Text = Renderer.Render(message.Subject); List<TransitAccountMessageFolder> folders = SessionManager.AccountService.GetAccountMessageFolders( SessionManager.Ticket, SessionManager.AccountId, null); TransitAccountMessageFolder none = new TransitAccountMessageFolder(); none.FullPath = none.Name = "Please choose ..."; folders.Insert(0, none); listFolders.DataSource = folders; listFolders.DataBind(); SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Messages", Request, "AccountMessageFoldersManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode(message.Subject, Request, string.Format("AccountMessageView.aspx?id={0}", message.Id))); sitemapdata.Add(new SiteMapDataAttributeNode("Move", Request.Url)); StackSiteMap(sitemapdata); } }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { linkCancel.NavigateUrl = ReturnUrl; TransitAccountMessage message = SessionManager.AccountService.GetAccountMessageById( SessionManager.Ticket, RequestId); messageSenderLink.HRef = messageFrom.NavigateUrl = string.Format("AccountView.aspx?id={0}", message.SenderAccountId); messageFrom.Text = messageSenderName.Text = Renderer.Render(message.SenderAccountName); messageTo.NavigateUrl = string.Format("AccountView.aspx?id={0}", message.RecepientAccountId); messageTo.Text = Renderer.Render(message.RecepientAccountName); messageSent.Text = message.Sent.ToString(); messageSenderImage.ImageUrl = string.Format("AccountPictureThumbnail.aspx?id={0}", message.SenderAccountPictureId); messageSubject.Text = Renderer.Render(message.Subject); List <TransitAccountMessageFolder> folders = SessionManager.AccountService.GetAccountMessageFolders( SessionManager.Ticket, SessionManager.AccountId, null); TransitAccountMessageFolder none = new TransitAccountMessageFolder(); none.FullPath = none.Name = "Please choose ..."; folders.Insert(0, none); listFolders.DataSource = folders; listFolders.DataBind(); SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Messages", Request, "AccountMessageFoldersManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode(message.Subject, Request, string.Format("AccountMessageView.aspx?id={0}", message.Id))); sitemapdata.Add(new SiteMapDataAttributeNode("Move", Request.Url)); StackSiteMap(sitemapdata); } }
public void Page_Load() { if (!IsPostBack) { if (SessionManager.IsLoggedIn) { panelLoggedIn.Visible = true; panelJoin.Visible = false; loggedInAccountName.Text = Renderer.Render(SessionManager.Account.Name); TransitAccountMessageFolder inbox = SessionManager.GetInstance <TransitAccountMessageFolder, int, string>( SessionManager.AccountId, "inbox", SessionManager.AccountService.GetAccountMessageSystemFolder); if (inbox != null) { linkRequestsStar.Visible = (inbox.UnReadMessageCount > 0); linkInbox.InnerText = string.Format("{0} ({1})", HttpContext.GetGlobalResourceObject("Links", "Inbox"), inbox.UnReadMessageCount); } linkRequests.InnerText = string.Format("{0} ({1})", HttpContext.GetGlobalResourceObject("Links", "Requests"), SessionManager.GetCount <TransitAccountFriendRequest, int>( SessionManager.AccountId, SessionManager.SocialService.GetAccountFriendRequestsCount)); linkInvitations.InnerText = string.Format("{0} ({1})", HttpContext.GetGlobalResourceObject("Links", "Invitations"), SessionManager.GetCount <TransitAccountGroupAccountInvitation, int>( SessionManager.AccountId, SessionManager.GroupService.GetAccountGroupAccountInvitationsByAccountIdCount)); } else { panelLoggedIn.Visible = false; panelJoin.Visible = true; int accountsCount = SessionManager.GetCount <TransitAccount>(SessionManager.AccountService.GetAccountsCount); if (accountsCount > 100) { accountsCount = accountsCount / 10 * 10; } if (accountsCount > 1000) { accountsCount = accountsCount / 100 * 100; } panelJoinLinkAccounts.Text = accountsCount.ToString(); panelJoinWebsiteName.Text = Renderer.Render(SessionManager.GetCachedConfiguration("SnCore.Name", "SnCore")); } } }
public void save_Click(object sender, EventArgs e) { TransitAccountMessageFolder tw = (RequestId > 0) ? SessionManager.AccountService.GetAccountMessageFolderById(SessionManager.Ticket, RequestId) : new TransitAccountMessageFolder(); tw.Name = inputName.Text; if (RequestId == 0) { tw.AccountMessageFolderParentId = GetId("pid"); } SessionManager.CreateOrUpdate <TransitAccountMessageFolder>( tw, SessionManager.AccountService.CreateOrUpdateAccountMessageFolder); Redirect("AccountMessageFoldersManage.aspx"); }
void GetFolderInformationData(object sender, EventArgs e) { TransitAccountMessageFolder folder = SessionManager.AccountService.GetAccountMessageFolderById( SessionManager.Ticket, FolderId); labelFolderName.Text = Renderer.Render(folder.Name); emptyPanel.Visible = ((folder.Name == "trash") || (folder.Name == "sent")) && folder.System; if (messagesView.Items.Count == 0) { noticeFolder.Text = "no messages"; } else { StringBuilder noticefoldertext = new StringBuilder(); noticefoldertext.AppendFormat("{0} message{1}", folder.MessageCount, folder.MessageCount == 1 ? string.Empty : "s"); if (folder.UnReadMessageCount > 0) { noticefoldertext.AppendFormat(", {0} unread", folder.UnReadMessageCount); } noticeFolder.Text = noticefoldertext.ToString(); } }
public int CreateOrUpdateAccountMessageFolder(string ticket, TransitAccountMessageFolder messagefolder) { return WebServiceImpl<TransitAccountMessageFolder, ManagedAccountMessageFolder, AccountMessageFolder>.CreateOrUpdate( ticket, messagefolder); }