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 save_Click(object sender, EventArgs e) { TransitAccountMessage tw = new TransitAccountMessage(); tw.Subject = inputSubject.Text; if (string.IsNullOrEmpty(tw.Subject)) tw.Subject = "Untitled"; tw.Body = inputBody.Content; tw.RecepientAccountId = tw.AccountId = RequestId; tw.AccountMessageFolderId = 0; SessionManager.AccountService.CreateOrUpdateAccountMessage(SessionManager.Ticket, tw); Redirect(ReturnUrl); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { linkCancel.NavigateUrl = ReturnUrl; TransitAccountMessage message = Message; if (message.UnRead) { message.UnRead = false; SessionManager.CreateOrUpdate <TransitAccountMessage>( message, SessionManager.AccountService.CreateOrUpdateAccountMessage); SessionManager.InvalidateCache <TransitAccountMessageFolder>(); } messageSenderLink.HRef = messageFrom.NavigateUrl = string.Format("AccountView.aspx?id={0}", message.SenderAccountId); messageFrom.Text = Renderer.Render(message.SenderAccountName); messageTo.NavigateUrl = string.Format("AccountView.aspx?id={0}", message.RecepientAccountId); messageTo.Text = Renderer.Render(message.RecepientAccountName); messageSent.Text = SessionManager.ToAdjustedString(message.Sent); messageSenderImage.ImageUrl = string.Format("AccountPictureThumbnail.aspx?id={0}&width=75&height=75", message.SenderAccountPictureId); messageSubject.Text = Renderer.Render(message.Subject); messageBody.Text = base.RenderEx(message.Body); messageFrom.Visible = labelMessageFrom.Visible = (message.SenderAccountId != SessionManager.Account.Id); messageTo.Visible = labelMessageTo.Visible = (message.RecepientAccountId != SessionManager.Account.Id); linkReply.NavigateUrl = string.Format("AccountMessageEdit.aspx?id={0}&pid={1}&ReturnUrl={2}", message.SenderAccountId, message.Id, UrlEncode(Request.Url.PathAndQuery)); linkMove.NavigateUrl = string.Format("AccountMessageMove.aspx?id={0}&ReturnUrl={1}", message.Id, UrlEncode(ReturnUrl)); linkFlag.NavigateUrl = string.Format("AccountFlagEdit.aspx?aid={0}&url={1}&type=Spam&ReturnUrl={2}", message.SenderAccountId, Renderer.UrlEncode(string.Format("AccountMessageView.aspx?id={0}", message.Id)), Renderer.UrlEncode(Request.Url.PathAndQuery)); 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.Url)); StackSiteMap(sitemapdata); } }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DomainClass cs = SessionManager.GetDomainClass("AccountMessage"); inputSubject.MaxLength = cs["Subject"].MaxLengthInChars; TransitAccount ta = SessionManager.AccountService.GetAccountById(SessionManager.Ticket, RequestId); if (ta == null) { ReportWarning("Account does not exist."); panelMessage.Visible = false; return; } imageAccountTo.ImageUrl = string.Format("AccountPictureThumbnail.aspx?id={0}&width=75&height=75", ta.PictureId); linkAccountTo.Text = Renderer.Render(ta.Name); linkAccountTo.NavigateUrl = linkAccountTo2.HRef = "AccountView.aspx?id=" + ta.Id.ToString(); linkBack.NavigateUrl = ReturnUrl; StringBuilder body = new StringBuilder(); if (ParentId != 0) { TransitAccountMessage rp = SessionManager.AccountService.GetAccountMessageById( SessionManager.Ticket, ParentId); panelReplyTo.Visible = true; messageFrom.NavigateUrl = accountlink.HRef = "AccountView.aspx?id=" + rp.SenderAccountId.ToString(); messageFrom.Visible = labelMessageFrom.Visible = (rp.SenderAccountId != SessionManager.Account.Id); messageTo.Visible = labelMessageTo.Visible = (rp.RecepientAccountId != SessionManager.Account.Id); messageFrom.Text = Renderer.Render(rp.SenderAccountName); messageBody.Text = RenderEx(rp.Body); messageSent.Text = SessionManager.ToAdjustedString(rp.Sent); replytoImage.ImageUrl = string.Format("AccountPictureThumbnail.aspx?id={0}&width=75&height=75", rp.SenderAccountPictureId); messageSubject.Text = Renderer.Render(rp.Subject); inputSubject.Text = rp.Subject.StartsWith("Re:") ? rp.Subject : "Re: " + rp.Subject; body.AppendFormat("<P>[quote]<DIV>on {0} {1} wrote:</DIV><DIV>{2}</DIV>[/quote]</P>", rp.Sent.ToString("d"), rp.SenderAccountName, rp.Body); } if (!string.IsNullOrEmpty(SessionManager.Account.Signature)) { body.Append("<BR /><BR />"); body.Append("<P>"); body.Append(Renderer.RenderEx(SessionManager.Account.Signature)); body.Append("</P>"); } inputBody.Content = body.ToString(); if (!SessionManager.HasVerified()) { ReportWarning("You don't have any verified e-mail addresses and/or profile photos.\n" + "You must add/confirm a valid e-mail address and upload a profile photo before sending messages."); manageAdd.Enabled = false; } SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("People", Request, "AccountsView.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode(ta.Name, Request, string.Format("AccountView.aspx?id={0}", ta.Id))); sitemapdata.Add(new SiteMapDataAttributeNode("Compose Message", Request.Url)); StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
public int CreateOrUpdateAccountMessage(string ticket, TransitAccountMessage message) { return WebServiceImpl<TransitAccountMessage, ManagedAccountMessage, AccountMessage>.CreateOrUpdate( ticket, message); }