public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Account == null) { throw new Exception("Account does not exist."); } SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("People", Request, "AccountsView.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode(Account.Name, Request.Url)); StackSiteMap(sitemapdata); this.Title = Renderer.Render(Account.Name); accountLastLogin.Text = string.Format("last activity: {0}", SessionManager.Adjust(Account.LastLogin).ToString("d")); accountCity.Text = Renderer.Render(Account.City); accountState.Text = Renderer.Render(Account.State); accountCountry.Text = Renderer.Render(Account.Country); accountImage.Visible = Account.PictureId != 0; accountImage.ImageUrl = string.Format("AccountPictureThumbnail.aspx?id={0}", Account.PictureId); accountLinkPictures.HRef = string.Format("AccountPicturesView.aspx?id={0}", Account.Id); GetTestimonials(sender, e); GetPictures(sender, e); } }
protected void Page_Load(object sender, EventArgs e) { try { images.OnGetDataSource += new EventHandler(images_OnGetDataSource); logins.OnGetDataSource += new EventHandler(logins_OnGetDataSource); this.addFile.Attributes["onclick"] = inputImages.GetAddFileScriptReference() + "return false;"; if (!IsPostBack) { PostId = RequestId; SetDefaultButton(save); PageManager.SetDefaultButton(loginAdd, panelLogins.Controls); inputTopic.DataSource = SessionManager.GetCachedCollection <TransitTopic>( "GetTopics", SessionManager.Ticket, null); inputTopic.DataBind(); if (PostId > 0) { GetDataImages(sender, e); GetDataLogins(sender, e); inputTitle.Text = Post.Title; inputBody.Content = Post.RawBody; foreach (TransitTopic topic in Post.Topics) { inputTopic.Items.FindByValue(topic.Id.ToString()).Selected = true; } inputCreatedDate.SelectedDate = SessionManager.Adjust(Post.Created).Date; inputCreatedTime.SelectedTime = SessionManager.Adjust(Post.Created).TimeOfDay; inputPublish.Checked = Post.Publish; inputDisplay.Checked = Post.Display; inputSticky.Checked = Post.Sticky; inputExport.Checked = Post.Export; } else { images.Visible = false; logins.Visible = false; DateTime utcnow = DateTime.UtcNow; inputCreatedDate.SelectedDate = SessionManager.Adjust(utcnow).Date; inputCreatedTime.SelectedTime = SessionManager.Adjust(utcnow).TimeOfDay; inputPublish.Checked = true; inputDisplay.Checked = true; } } } catch (Exception ex) { ReportException(ex); } }
public void test_Click(object sender, EventArgs e) { TransitAccountEmailMessage message = new TransitAccountEmailMessage(); message.Body = string.Format("This e-mail was sent {0}.", SessionManager.Adjust(DateTime.UtcNow)); message.Subject = "SnCore mail message system test"; message.DeleteSent = true; message.MailTo = message.MailFrom = SessionManager.AccountService.GetActiveEmailAddress( SessionManager.Ticket, SessionManager.AccountId); SessionManager.AccountService.SendAccountEmailMessage( SessionManager.Ticket, message); ReportInfo("Test successful."); }
void GetPictureData(object sender, EventArgs e) { TransitAccountPicture p = GetAccountPicture(); inputPicture.Src = string.Format("AccountPictureThumbnail.aspx?id={0}", p.Id); inputName.Text = Renderer.Render(p.Name); inputDescription.Text = Renderer.Render(p.Description); inputCreated.Text = SessionManager.Adjust(p.Created).ToString("d"); inputCounter.Text = p.Counter.Total.ToString(); TransitAccount l = GetAccount(); //discussionComments.ReturnUrl = string.Format("AccountPictureView.aspx?id={0}", PictureId); //discussionComments.DiscussionId = SessionManager.GetCount<TransitDiscussion, string, int>( // typeof(AccountPicture).Name, PictureId, SessionManager.DiscussionService.GetOrCreateDiscussionId); //discussionComments.DataBind(); }
public void Page_Load(object sender, EventArgs e) { gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource); if (!IsPostBack) { TransitAccountRssWatch f = AccountRssWatch; Title = labelTitle.Text = Renderer.Render(f.Name); linkEditRssWatch.NavigateUrl = string.Format("AccountRssWatchEdit.aspx?id={0}", f.Id); labelSince.Text = string.Format("since {0}", SessionManager.Adjust(f.Sent).ToShortDateString()); SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Subscriptions", Request, "AccountRssWatchsManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode(f.Name, Request.Url)); StackSiteMap(sitemapdata); GetData(sender, e); } }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SyndicationService.TransitAccountFeedItem tfi = GetAccountFeedItem(); if (tfi == null) { Response.Redirect("AccountFeedItemsView.aspx"); return; } this.Title = string.Format("{0}'s {1} in {2}", Renderer.Render(tfi.AccountName), Renderer.Render(tfi.Title), Renderer.Render(tfi.AccountFeedName)); feeditemCreated.Text = SessionManager.Adjust(tfi.Created).ToString(); feeditemXPosted.NavigateUrl = Renderer.Render(tfi.Link); HtmlWriterOptions options = new HtmlWriterOptions(); options.RewriteImgSize = new Size(0, 0); options.BaseHref = Uri.IsWellFormedUriString(tfi.AccountFeedLinkUrl, UriKind.Absolute) ? new Uri(tfi.AccountFeedLinkUrl) : null; options.RewriteImgSrc = new Uri(SessionManager.WebsiteUri, "AccountFeedItemPicture.aspx?src={url}"); feeditemDescription.Text = Renderer.CleanHtml(tfi.Description, options); int discussion_id = SessionManager.GetCount <DiscussionService.TransitDiscussion, DiscussionService.ServiceQueryOptions, string, int>( "AccountFeedItem", RequestId, SessionManager.DiscussionService.GetOrCreateDiscussionId); linkDiscussion.NavigateUrl = string.Format("DiscussionView.aspx?id={0}", discussion_id); SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Blogs", Request, "AccountFeedItemsView.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode(tfi.AccountFeedName, Request, string.Format("AccountFeedView.aspx?id={0}", tfi.AccountFeedId))); sitemapdata.Add(new SiteMapDataAttributeNode(tfi.Title, Request.Url)); StackSiteMap(sitemapdata); } }
public DateTime Adjust(DateTime dt) { return(SessionManager.Adjust(dt)); }