public void GetData(object sender, EventArgs e) { IList <TransitAccountPlaceType> types = SessionManager.GetCollection <TransitAccountPlaceType>( null, SessionManager.PlaceService.GetAccountPlaceTypes); TransitAccountPlaceType selected = null; foreach (TransitAccountPlaceType Placetype in types) { if (Placetype.DefaultType) { selected = Placetype; break; } } if (selected == null) { types.Insert(0, new TransitAccountPlaceType()); } inputType.DataSource = types; inputType.DataBind(); if (selected != null) { ListItemManager.TrySelect(inputType, selected.Name); } }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request, "SystemPicturesManage.aspx")); inputType.DataSource = SessionManager.ObjectService.GetPictureTypes( SessionManager.Ticket, null); inputType.DataBind(); if (RequestId > 0) { TransitPicture t = SessionManager.ObjectService.GetPictureById( SessionManager.Ticket, RequestId); inputName.Text = t.Name; inputDescription.Text = t.Description; ListItemManager.TrySelect(inputType, t.Type); imageThumbnail.ImageUrl = string.Format("SystemPictureThumbnail.aspx?id={0}&CacheDuration=0", t.Id); sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url)); } else { sitemapdata.Add(new SiteMapDataAttributeNode("New Picture", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
private void GetFeedTypes(object sender, EventArgs e) { List <TransitFeedType> types = SessionManager.SyndicationService.GetFeedTypes(SessionManager.Ticket, null); TransitFeedType selected = null; foreach (TransitFeedType Feedtype in types) { if (Feedtype.DefaultType) { selected = Feedtype; break; } } if (selected == null) { types.Insert(0, new TransitFeedType()); } selectType.DataSource = types; selectType.DataBind(); if (selected != null) { ListItemManager.TrySelect(selectType, selected.Name); } }
private void GetPlaceTypes(object sender, EventArgs e) { IList <TransitPlaceType> types = SessionManager.GetCollection <TransitPlaceType>( null, SessionManager.PlaceService.GetPlaceTypes); TransitPlaceType selected = null; foreach (TransitPlaceType tp in types) { if (tp.DefaultType) { selected = tp; break; } } if (selected == null) { types.Insert(0, new TransitPlaceType()); } selectType.DataSource = types; selectType.DataBind(); if (selected != null) { ListItemManager.TrySelect(selectType, selected.Name); } }
public void Page_Load(object sender, EventArgs e) { if (!SessionManager.IsAdministrator) { throw new ManagedAccount.AccessDeniedException(); } if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Settings", Request, "SystemConfigurationsManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Outgoing E-Mail", Request.Url)); StackSiteMap(sitemapdata); DomainClass cs = SessionManager.GetDomainClass("Configuration"); int len = cs["OptionName"].MaxLengthInChars; inputServer.MaxLength = len; inputUsername.MaxLength = len; inputPassword.MaxLength = len; inputPort.MaxLength = len; inputPickupDirectoryLocation.MaxLength = len; inputDelivery.DataSource = smtpdeliverymethods; inputDelivery.DataBind(); ListItemManager.TrySelect(inputDelivery, SessionManager.GetCachedConfiguration("SnCore.Mail.Delivery", SmtpDeliveryMethod.Network.ToString())); inputServer.Text = SessionManager.GetCachedConfiguration("SnCore.Mail.Server", "localhost"); inputUsername.Text = SessionManager.GetCachedConfiguration("SnCore.Mail.Username", string.Empty); inputPort.Text = SessionManager.GetCachedConfiguration("SnCore.Mail.Port", "25"); inputPickupDirectoryLocation.Text = SessionManager.GetCachedConfiguration("SnCore.Mail.PickupDirectoryLocation", string.Empty); } SetDefaultButton(save); }
protected void SelectMonthly() { recMonthlyDay.Text = Schedule.MonthlyDay.ToString(); recMonthlyMonth.Text = Schedule.MonthlyMonth.ToString(); ListItemManager.TrySelect(recMonthlyDayIndex, Schedule.MonthlyExDayIndex); ListItemManager.TrySelect(recMonthlyDayName, Schedule.MonthlyExDayName); recMonthlyExMonth.Text = Schedule.MonthlyExMonth.ToString(); }
protected void SelectYearly() { ListItemManager.TrySelect(recYearlyMonth, Schedule.YearlyMonth); recYearlyDay.Text = Schedule.YearlyDay.ToString(); ListItemManager.TrySelect(recYearlyExDayName, Schedule.YearlyExDayName); ListItemManager.TrySelect(recYearlyExDayIndex, Schedule.YearlyExDayIndex); ListItemManager.TrySelect(recYearlyExMonth, Schedule.YearlyExMonth); }
public bool SelectLocation(object sender, LocationWithOptionsEventArgs e) { bool result = base.SelectLocation(sender, e); if (mType != null && !string.IsNullOrEmpty(e.Type)) { result = ListItemManager.TrySelect(mType, e.Type); } return(result); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); if (IsObjectBound) { int discussion_id = SessionManager.GetCount <TransitDiscussion, string, int>( Type, ObjectId, SessionManager.DiscussionService.GetOrCreateDiscussionId); TransitDiscussion td = SessionManager.GetPrivateInstance <TransitDiscussion, int>( discussion_id, SessionManager.DiscussionService.GetDiscussionById); sitemapdata.Add(new SiteMapDataAttributeNode(td.ParentObjectName, string.Format("{0}&ReturnUrl={1}", td.ParentObjectUri, Renderer.UrlEncode(Request.Url.PathAndQuery)))); sitemapdata.Add(new SiteMapDataAttributeNode("Discussions", Request.Url)); } else { sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Discussions", Request, "SystemDiscussionsManage.aspx")); } DomainClass cs = SessionManager.GetDomainClass("Discussion"); inputName.MaxLength = cs["Name"].MaxLengthInChars; inputDefaultView.DataSource = DiscussionViewType.DefaultTypes; inputDefaultView.DataBind(); linkBack.NavigateUrl = ReturnUrl; int id = RequestId; if (id > 0) { TransitDiscussion tw = SessionManager.DiscussionService.GetDiscussionById( SessionManager.Ticket, id); inputName.Text = Renderer.Render(tw.Name); inputDescription.Text = Renderer.Render(tw.Description); ListItemManager.TrySelect(inputDefaultView, tw.DefaultView); ListItemManager.SelectAdd(inputDefaultViewRows, tw.DefaultViewRows); sitemapdata.Add(new SiteMapDataAttributeNode(tw.Name, Request.Url)); } else { sitemapdata.Add(new SiteMapDataAttributeNode("New Discussion", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { for (int i = 1; i < 20; i++) { inputSpanColumns.Items.Add(new ListItem(i.ToString(), i.ToString())); inputSpanRows.Items.Add(new ListItem(i.ToString(), i.ToString())); inputSpanColumnsPreview.Items.Add(new ListItem(i.ToString(), i.ToString())); inputSpanRowsPreview.Items.Add(new ListItem(i.ToString(), i.ToString())); } SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Feed Types", Request, "FeedTypesManage.aspx")); DomainClass cs = SessionManager.GetDomainClass("FeedType"); inputName.MaxLength = cs["Name"].MaxLengthInChars; if (RequestId > 0) { TransitFeedType t = SessionManager.SyndicationService.GetFeedTypeById( SessionManager.Ticket, RequestId); inputName.Text = t.Name; inputDefaultType.Checked = t.DefaultType; ListItemManager.SelectAdd(inputSpanColumns, t.SpanColumns); ListItemManager.SelectAdd(inputSpanRows, t.SpanRows); ListItemManager.SelectAdd(inputSpanColumnsPreview, t.SpanColumnsPreview); ListItemManager.SelectAdd(inputSpanRowsPreview, t.SpanRowsPreview); if (!string.IsNullOrEmpty(t.Xsl)) { Xsl = t.Xsl; labelXsl.Text = string.Format("{0} Kb", ((double)t.Xsl.Length / 1024).ToString("0.00")); } else { linkXslClear.Enabled = false; } sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url)); } else { sitemapdata.Add(new SiteMapDataAttributeNode("New Feed Type", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TransitAccount ta = SessionManager.AccountService.GetAccountById( SessionManager.Ticket, AccountId); 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("Attributes", Request, string.Format("AccountAttributesManage.aspx?id={0}", ta.Id))); DomainClass cs = SessionManager.GetDomainClass("AccountAttribute"); inputUrl.MaxLength = cs["Url"].MaxLengthInChars; linkBack.NavigateUrl = string.Format("AccountAttributesManage.aspx?id={0}", AccountId); List <TransitAttribute> attributes = SessionManager.ObjectService.GetAttributes( SessionManager.Ticket, null); if (RequestId == 0) { attributes.Insert(0, new TransitAttribute()); } listAttributes.DataSource = attributes; listAttributes.DataBind(); if (RequestId > 0) { TransitAccountAttribute attribute = SessionManager.AccountService.GetAccountAttributeById( SessionManager.Ticket, RequestId); inputValue.Text = Renderer.Render(attribute.Value); inputUrl.Text = Renderer.Render(attribute.Url); inputDefaultUrl.Text = Renderer.Render(attribute.Attribute.DefaultUrl); inputDefaultValue.Text = Renderer.Render(attribute.Attribute.DefaultValue); ListItemManager.SelectAdd(listAttributes, attribute.AttributeId); listAttributes.Enabled = false; previewImage.ImageUrl = string.Format("SystemAttribute.aspx?id={0}", attribute.AttributeId); previewImage.Visible = true; sitemapdata.Add(new SiteMapDataAttributeNode(attribute.Attribute.Name, Request.Url)); } else { sitemapdata.Add(new SiteMapDataAttributeNode("New Attribute", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
internal void SelectTime() { selecttimeDropdown.ClearSelection(); if (mSelectedTime == null) { return; } TimeSpan ts = (TimeSpan)mSelectedTime; ListItemManager.TrySelect(selecttimeDropdown, ts.Ticks); }
public void Page_Load(object sender, EventArgs e) { gridManageReminderAccountProperties.OnGetDataSource += new EventHandler(gridManageReminderAccountProperties_OnGetDataSource); if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Reminders", Request, "SystemRemindersManage.aspx")); inputDataObject.DataSource = SessionManager.ObjectService.GetDataObjects( SessionManager.Ticket, null); inputDataObject.DataBind(); inputDataObject_SelectedIndexChanged(sender, e); if (RequestId > 0) { TransitReminder t = SessionManager.ObjectService.GetReminderById( SessionManager.Ticket, RequestId); inputUrl.Text = t.Url; ListItemManager.SelectAdd(inputDeltaHours, string.Format("Every {0} Hours", t.DeltaHours), t.DeltaHours); ListItemManager.TrySelect(inputDataObjectField, t.DataObjectField); inputEnabled.Checked = t.Enabled; inputRecurrent.Checked = t.Recurrent; GetAccountPropertiesData(sender, e); GetAccountProperties(sender, e); sitemapdata.Add(new SiteMapDataAttributeNode(t.Url, Request.Url)); } else { panelAccountProperties.Visible = false; sitemapdata.Add(new SiteMapDataAttributeNode("New Reminder", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); PageManager.SetDefaultButton(addAccountProperty, panelAccountProperties.Controls); PageManager.SetDefaultButton(inputTest, inputTestAccountId); }
public void Page_Load(object sender, EventArgs e) { gridManagePosts.OnGetDataSource += new EventHandler(gridManagePosts_OnGetDataSource); gridManageAuthors.OnGetDataSource += new EventHandler(gridManageAuthors_OnGetDataSource); if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Blogs", Request, "AccountBlogsManage.aspx")); DomainClass cs = SessionManager.GetDomainClass("AccountBlog"); inputName.MaxLength = cs["Name"].MaxLengthInChars; if (RequestId > 0) { TransitAccountBlog tf = SessionManager.BlogService.GetAccountBlogById( SessionManager.Ticket, RequestId); inputName.Text = tf.Name; inputDescription.Text = tf.Description; enableComments.Checked = tf.EnableComments; ListItemManager.SelectAdd(inputDefaultViewRows, tf.DefaultViewRows); if (!IsPostBack) { GetBlogPostsData(sender, e); GetBlogAuthorsData(sender, e); } linkNew.NavigateUrl = string.Format("AccountBlogPost.aspx?bid={0}", RequestId); linkNewAuthor.NavigateUrl = string.Format("AccountBlogAuthorEdit.aspx?bid={0}", RequestId); accountredirect.TargetUri = linkPreview.NavigateUrl = string.Format("AccountBlogView.aspx?id={0}", RequestId); sitemapdata.Add(new SiteMapDataAttributeNode(tf.Name, Request.Url)); } else { panelEntries.Visible = false; linkPreview.Visible = false; sitemapdata.Add(new SiteMapDataAttributeNode("New Blog", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(linkSave); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Cities", Request, "SystemCitiesManage.aspx")); DomainClass cs = SessionManager.GetDomainClass("City"); inputName.MaxLength = cs["Name"].MaxLengthInChars; inputTag.MaxLength = cs["Tag"].MaxLengthInChars; string defaultcountry = SessionManager.GetCachedConfiguration("SnCore.Country.Default", "United States"); inputCountry.DataSource = SessionManager.GetCollection <TransitCountry, string>( defaultcountry, (ServiceQueryOptions)null, SessionManager.LocationService.GetCountriesWithDefault); inputCountry.DataBind(); if (RequestId > 0) { TransitCity tc = SessionManager.LocationService.GetCityById( SessionManager.Ticket, RequestId); inputName.Text = tc.Name; inputTag.Text = tc.Tag; ListItemManager.TrySelect(inputCountry, tc.Country); inputCountry_SelectedIndexChanged(sender, e); ListItemManager.TrySelect(inputState, tc.State); sitemapdata.Add(new SiteMapDataAttributeNode(tc.Name, Request.Url)); } else if (!string.IsNullOrEmpty(Request["city"])) { LocationSelectorCountryState ls = new LocationSelectorCountryState( this, true, inputCountry, inputState); ls.SelectLocation(sender, new LocationEventArgs(Request)); inputName.Text = Request["city"]; } else { inputCountry_SelectedIndexChanged(sender, e); panelMerge.Visible = false; sitemapdata.Add(new SiteMapDataAttributeNode("New City", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); PageManager.SetDefaultButton(mergeLookup, panelMerge.Controls); }
public void Page_Load(object sender, EventArgs e) { gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource); if (!IsPostBack) { listboxSelectType.DataSource = Enum.GetNames(typeof(TransitTagWordQueryOptions)); listboxSelectType.DataBind(); ListItemManager.TrySelect(listboxSelectType, "New"); listboxSelectType_SelectedIndexChanged(sender, e); SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Tag Words", Request.Url)); StackSiteMap(sitemapdata); } }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Flags", Request, "AccountFlagsManage.aspx")); inputType.DataSource = SessionManager.AccountService.GetAccountFlagTypes( SessionManager.Ticket, null); inputType.DataBind(); string type = Request["type"]; ListItemManager.TrySelect(inputType, type); TransitAccount account = SessionManager.AccountService.GetAccountById( SessionManager.Ticket, GetId("aid")); if (account == null) { ReportWarning("Account has already been deleted."); panelMessage.Visible = false; return; } linkKeen.NavigateUrl = string.Format("AccountView.aspx?id={0}", account.Id.ToString()); linkKeen.Text = Renderer.Render(account.Name); imageKeen.ImageUrl = string.Format("AccountPictureThumbnail.aspx?id={0}&width=75&height=75", account.PictureId); inputDescription.Text = string.Format("Dear Administrator,\n\nI would like to report {0} from {1}. Please take a look at {2}.\n\nThx\n{3}", Renderer.Render(Request["type"]), Renderer.Render(account.Name), Renderer.Render(Request["url"]), Renderer.Render(SessionManager.Account.Name)); sitemapdata.Add(new SiteMapDataAttributeNode(string.Format("Report {0}", Renderer.Render(Request["type"])), Request.Url)); linkBack.NavigateUrl = ReturnUrl; StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Account Property Groups", Request, "SystemAccountPropertyGroupsManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode(PropertyGroup.Name, Request, string.Format("SystemAccountPropertyGroupEdit.aspx?id={0}", PropertyGroupId))); DomainClass cs = SessionManager.GetDomainClass("AccountProperty"); inputName.MaxLength = cs["Name"].MaxLengthInChars; linkBack.NavigateUrl = string.Format("SystemAccountPropertyGroupEdit.aspx?id={0}", PropertyGroupId); inputTypeName.Items.Add(new ListItem("String", Type.GetType("System.String").ToString())); inputTypeName.Items.Add(new ListItem("Array", Type.GetType("System.Array").ToString())); inputTypeName.Items.Add(new ListItem("Text", Type.GetType("System.Text.StringBuilder").ToString())); inputTypeName.Items.Add(new ListItem("Integer", Type.GetType("System.Int32").ToString())); inputTypeName.Items.Add(new ListItem("Boolean", Type.GetType("System.Boolean").ToString())); // inputTypeName.Items.Add(new ListItem(Type.GetType("System.DateTime").ToString())); if (RequestId > 0) { TransitAccountProperty t = SessionManager.AccountService.GetAccountPropertyById( SessionManager.Ticket, RequestId); inputName.Text = t.Name; inputDescription.Text = t.Description; inputDefaultValue.Text = t.DefaultValue; inputPublish.Checked = t.Publish; sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url)); ListItemManager.SelectAdd(inputTypeName, t.Type); } else { sitemapdata.Add(new SiteMapDataAttributeNode("New Property", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
public bool SelectLocation(object sender, LocationWithOptionsEventArgs e) { bool result = base.SelectLocation(sender, e); if (e.Clear || (mType != null && !string.IsNullOrEmpty(e.Type))) { mType.ClearSelection(); result = ListItemManager.TrySelect(mType, e.Type); } if (e.Clear || (mPicturesOnly != null && !string.IsNullOrEmpty(e.PicturesOnly))) { bool picturesonly = false; if (bool.TryParse(e.PicturesOnly, out picturesonly)) { mPicturesOnly.Checked = picturesonly; result = true; } } return(result); }
public void Page_Load(object sender, EventArgs e) { LocationSelector.LocationChanged += new EventHandler(LocationSelector_LocationChanged); if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Preferences", Request.Url)); StackSiteMap(sitemapdata); DomainClass cs = SessionManager.GetDomainClass("Account"); inputName.MaxLength = cs["Name"].MaxLengthInChars; inputCity.MaxLength = cs["City"].MaxLengthInChars; inputSignature.MaxLength = cs["Signature"].MaxLengthInChars; inputName.Text = SessionManager.Account.Name; inputBirthday.SelectedDate = SessionManager.Account.Birthday; inputBirthday.DataBind(); inputCity.Text = SessionManager.Account.City; inputTimeZone.SelectedTzIndex = SessionManager.Account.TimeZone; LocationSelector.SelectLocation(sender, new LocationEventArgs(SessionManager.Account)); LocationSelector_LocationChanged(sender, e); inputSignature.Text = SessionManager.Account.Signature; groups.AccountId = SessionManager.Account.Id; accountredirect.TargetUri = string.Format("AccountView.aspx?id={0}", SessionManager.Account.Id); // TODO: cache inputLocale.DataSource = SessionManager.GetCollection <TransitCultureInfo>( SessionManager.SystemService.GetInstalledCultures); inputLocale.DataBind(); inputLocale.Items.Insert(0, new ListItem("Web Browser Language", "0")); ListItemManager.TrySelect(inputLocale, SessionManager.Account.LCID.ToString()); } }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TransitDiscussionThread tt = SessionManager.DiscussionService.GetDiscussionThreadById( SessionManager.Ticket, RequestId); TransitDiscussion td = SessionManager.DiscussionService.GetDiscussionById( SessionManager.Ticket, tt.DiscussionId); TransitDiscussionPost tp = SessionManager.DiscussionService.GetDiscussionThreadPost( SessionManager.Ticket, tt.Id); this.Title = Renderer.Render(td.Name); if (td.ObjectId != 0 && !string.IsNullOrEmpty(td.ParentObjectType)) { listDiscussions.DataSource = SessionManager.DiscussionService.GetDiscussionsByObjectId( SessionManager.Ticket, td.ParentObjectType, td.ObjectId, null); } else { listDiscussions.DataSource = SessionManager.DiscussionService.GetDiscussions( SessionManager.Ticket, null); } listDiscussions.DataBind(); ListItemManager.TrySelect(listDiscussions, tt.DiscussionId); SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Discussions", Request, "DiscussionsView.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode(td.Name, Request, string.Format("DiscussionView.aspx?id={0}", td.Id))); sitemapdata.Add(new SiteMapDataAttributeNode(tp.Subject, Request, string.Format("DiscussionThreadView.aspx?id={0}&did={1}", tp.DiscussionThreadId, td.Id))); sitemapdata.Add(new SiteMapDataAttributeNode("Move", Request.Url)); StackSiteMap(sitemapdata); } }
protected override void OnPreRender(EventArgs e) { if (SelectionChanged == null) { selectdateDay.AutoPostBack = false; selectdateMonth.AutoPostBack = false; selectdateYear.AutoPostBack = false; } if (!IsPostBack && mSelectedDateTime != null) { DateTime d = (DateTime)mSelectedDateTime; ListItemManager.TrySelect(selectdateMonth, d.Month); ListItemManager.TrySelect(selectdateDay, d.Day); ListItemManager.SelectAdd(selectdateYear, d.Year); if (HasSelection) { selectDateCalendar.SelectedDate = SelectedDate; selectDateCalendar.VisibleDate = SelectedDate; } } base.OnPreRender(e); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("States", Request, "SystemStatesManage.aspx")); DomainClass cs = SessionManager.GetDomainClass("State"); inputName.MaxLength = cs["Name"].MaxLengthInChars; int id = RequestId; string defaultcountry = SessionManager.GetCachedConfiguration("SnCore.Country.Default", "United States"); inputCountry.DataSource = SessionManager.GetCollection <TransitCountry, string>( defaultcountry, (ServiceQueryOptions)null, SessionManager.LocationService.GetCountriesWithDefault); inputCountry.DataBind(); if (id > 0) { TransitState tw = SessionManager.LocationService.GetStateById( SessionManager.Ticket, id); inputName.Text = Renderer.Render(tw.Name); ListItemManager.TrySelect(inputCountry, tw.Country); sitemapdata.Add(new SiteMapDataAttributeNode(tw.Name, Request.Url)); } else { sitemapdata.Add(new SiteMapDataAttributeNode("New State", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Addresses", Request, "AccountAddressesManage.aspx")); DomainClass cs = SessionManager.GetDomainClass("AccountAddress"); inputApt.MaxLength = cs["Apt"].MaxLengthInChars; inputCity.MaxLength = cs["City"].MaxLengthInChars; inputStreet.MaxLength = cs["Street"].MaxLengthInChars; inputZip.MaxLength = cs["Zip"].MaxLengthInChars; inputName.MaxLength = cs["Name"].MaxLengthInChars; TransitAccountAddress tw = null; int id = RequestId; if (id > 0) { tw = SessionManager.AccountService.GetAccountAddressById(SessionManager.Ticket, id); inputName.Text = Renderer.Render(tw.Name); inputApt.Text = Renderer.Render(tw.Apt); inputStreet.Text = Renderer.Render(tw.Street); inputCity.Text = Renderer.Render(tw.City); inputZip.Text = Renderer.Render(tw.Zip); sitemapdata.Add(new SiteMapDataAttributeNode(tw.Name, Request.Url)); } else { sitemapdata.Add(new SiteMapDataAttributeNode("New Address", Request.Url)); } StackSiteMap(sitemapdata); List <TransitCountry> countries = new List <TransitCountry>(); if (tw == null || tw.Country.Length == 0) { countries.Add(new TransitCountry()); } string defaultcountry = SessionManager.GetCachedConfiguration("SnCore.Country.Default", "United States"); countries.AddRange(SessionManager.GetCollection <TransitCountry, string>( defaultcountry, (ServiceQueryOptions)null, SessionManager.LocationService.GetCountriesWithDefault)); List <TransitState> states = new List <TransitState>(); if (tw == null || tw.State.Length == 0) { states.Add(new TransitState()); } states.AddRange(SessionManager.GetCollection <TransitState>( (ServiceQueryOptions)null, SessionManager.LocationService.GetStates)); inputCountry.DataSource = countries; inputCountry.DataBind(); inputState.DataSource = states; inputState.DataBind(); if (tw != null) { ListItemManager.SelectAdd(inputCountry, tw.Country); ListItemManager.SelectAdd(inputState, tw.State); } } SetDefaultButton(manageAdd); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Syndication", Request, "AccountFeedsManage.aspx")); DomainClass cs = SessionManager.GetDomainClass("AccountFeed"); inputName.MaxLength = cs["Name"].MaxLengthInChars; inputFeedUrl.MaxLength = cs["FeedUrl"].MaxLengthInChars; inputUsername.MaxLength = cs["Username"].MaxLengthInChars; inputPassword.MaxLength = cs["Password"].MaxLengthInChars; inputLinkUrl.MaxLength = cs["LinkUrl"].MaxLengthInChars; GetFeedTypes(sender, e); string feedtype = Request.Params["type"]; ListItemManager.TrySelect(selectType, feedtype); if (RequestId > 0) { TransitAccountFeed tf = SessionManager.SyndicationService.GetAccountFeedById( SessionManager.Ticket, RequestId); inputName.Text = tf.Name; inputDescription.Text = tf.Description; inputLinkUrl.Text = tf.LinkUrl; inputFeedUrl.Text = tf.FeedUrl; inputUsername.Text = tf.Username; inputShown.Checked = !tf.Hidden; inputPublish.Checked = tf.Publish; inputPublishImgs.Checked = tf.PublishImgs; inputPublishMedia.Checked = tf.PublishMedia; inputPassword.Attributes["value"] = tf.Password; if (tf.UpdateFrequency > 0) { ListItemManager.SelectAdd( inputUpdateFrequency, string.Format("Every {0} Hours", tf.UpdateFrequency), tf.UpdateFrequency); } ListItemManager.TrySelect(selectType, tf.FeedType); sitemapdata.Add(new SiteMapDataAttributeNode(tf.Name, Request.Url)); feedredirect.TargetUri = string.Format("AccountFeedView.aspx?id={0}", tf.Id); } else { if (Request.Params["name"] != null) { inputName.Text = Request.Params["name"]; inputUsername.Enabled = false; inputPassword.Enabled = false; inputUpdateFrequency.Enabled = false; } if (Request.Params["feed"] != null) { inputFeedUrl.Text = Request.Params["feed"]; inputFeedUrl.Enabled = false; } if (Request.Params["link"] != null) { inputLinkUrl.Text = Request.Params["link"]; inputLinkUrl.Enabled = false; } if (Request.Params["description"] != null) { inputDescription.Text = Request.Params["description"]; } string type = Request.Params["type"]; ListItemManager.TrySelect(selectType, type); sitemapdata.Add(new SiteMapDataAttributeNode("New Feed", Request.Url)); feedredirect.Visible = false; } StackSiteMap(sitemapdata); } SetDefaultButton(linkSave); }
public void Page_Load(object sender, EventArgs e) { place.Choose += new EventHandler(event_Changed); schedule.Confirm += new EventHandler(event_Changed); if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Events", Request, "AccountEventsManage.aspx")); DomainClass cs = SessionManager.GetDomainClass("AccountEvent"); inputName.MaxLength = cs["Name"].MaxLengthInChars; inputPhone.MaxLength = cs["Phone"].MaxLengthInChars; inputEmail.MaxLength = cs["Email"].MaxLengthInChars; inputWebsite.MaxLength = cs["Website"].MaxLengthInChars; inputCost.MaxLength = cs["Cost"].MaxLengthInChars; GetAccountEventTypes(sender, e); linkBack.NavigateUrl = ReturnUrl; linkDelete.Visible = linkSummarize.Visible = (RequestId > 0); if (RequestId > 0) { TransitAccountEvent tav = SessionManager.EventService.GetAccountEventById( SessionManager.Ticket, RequestId, SessionManager.UtcOffset.Ticks); inputName.Text = tav.Name; inputWebsite.Text = tav.Website; inputDescription.Text = tav.Description; inputPhone.Text = tav.Phone; inputEmail.Text = tav.Email; inputCost.Text = tav.Cost; inputPublish.Checked = tav.Publish; ListItemManager.TrySelect(selectType, tav.AccountEventType); schedule.Schedule = SessionManager.ObjectService.GetScheduleById(SessionManager.Ticket, tav.ScheduleId); place.Place = SessionManager.PlaceService.GetPlaceById(SessionManager.Ticket, tav.PlaceId); titleEvent.Text = Renderer.Render(tav.Name); sitemapdata.Add(new SiteMapDataAttributeNode(tav.Name, Request.Url)); } else if (!string.IsNullOrEmpty(Request["ical"])) { TransitAccountEventICALEmitter emitter = TransitAccountEventICALEmitter.Parse( Request["ical"], SessionManager.UtcOffset, SessionManager.GetCachedConfiguration("SnCore.Web.UserAgent", "SnCore/1.0")); inputName.Text = emitter.AccountEvent.Name; inputWebsite.Text = emitter.AccountEvent.Website; inputDescription.Text = emitter.AccountEvent.Description; inputPhone.Text = emitter.AccountEvent.Phone; inputEmail.Text = emitter.AccountEvent.Email; inputCost.Text = emitter.AccountEvent.Cost; inputPublish.Checked = emitter.AccountEvent.Publish; ListItemManager.TrySelect(selectType, emitter.AccountEvent.AccountEventType); schedule.Schedule = emitter.Schedule; place.Place = emitter.Place; titleEvent.Text = Renderer.Render(emitter.AccountEvent.Name); sitemapdata.Add(new SiteMapDataAttributeNode("New ICal Event", Request.Url)); } else { sitemapdata.Add(new SiteMapDataAttributeNode("New Event", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); 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 posting."); manageAdd.Enabled = false; } }
public void Page_Load(object sender, EventArgs e) { gridPlaceNamesManage.OnGetDataSource += new EventHandler(gridPlaceNamesManage_OnGetDataSource); LocationSelector.LocationChanged += new EventHandler(LocationSelector_LocationChanged); if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx")); DomainClass cs = SessionManager.GetDomainClass("Place"); inputName.MaxLength = cs["Name"].MaxLengthInChars; inputStreet.MaxLength = cs["Street"].MaxLengthInChars; inputZip.MaxLength = cs["Zip"].MaxLengthInChars; inputCrossStreet.MaxLength = cs["CrossStreet"].MaxLengthInChars; inputPhone.MaxLength = cs["Phone"].MaxLengthInChars; inputFax.MaxLength = cs["Fax"].MaxLengthInChars; inputEmail.MaxLength = cs["Email"].MaxLengthInChars; DomainClass acs = SessionManager.GetDomainClass("PlaceName"); inputAltName.MaxLength = acs["Name"].MaxLengthInChars; gridPlaceNamesManage_OnGetDataSource(sender, e); gridPlaceNamesManage.DataBind(); ppg.PlaceId = RequestId; ppg.DataBind(); GetPlaceTypes(sender, e); if (RequestId > 0) { TransitPlace place = SessionManager.PlaceService.GetPlaceById(SessionManager.Ticket, RequestId); labelName.Text = Renderer.Render(place.Name); inputName.Text = place.Name; inputDescription.Text = place.Description; inputCrossStreet.Text = place.CrossStreet; inputEmail.Text = place.Email; inputFax.Text = place.Fax; inputPhone.Text = place.Phone; inputStreet.Text = place.Street; inputZip.Text = place.Zip; ListItemManager.TrySelect(selectType, place.Type); LocationSelector.SelectLocation(sender, new LocationEventArgs(place)); linkEditAttributes.NavigateUrl = string.Format("PlaceAttributesManage.aspx?id={0}", place.Id); linkEditPictures.NavigateUrl = string.Format("PlacePicturesManage.aspx?id={0}", place.Id); sitemapdata.Add(new SiteMapDataAttributeNode(place.Name, Request.Url)); placeredirect.TargetUri = string.Format("PlaceView.aspx?id={0}", place.Id); panelWebsite.Visible = false; websitesView.PlaceId = RequestId; } else { panelPlaceAltName.Visible = false; LocationSelector.ChangeCountry(sender, e); string type = Request.QueryString["type"]; ListItemManager.TrySelect(selectType, type); string name = Request.QueryString["name"]; if (!string.IsNullOrEmpty(name)) { inputName.Text = name; } if (!LocationSelector.SelectLocation(sender, new LocationEventArgs(Request))) { LocationSelector.ChangeCityWithAccountDefault(sender, new CityLocationEventArgs( Request.QueryString["city"])); } linkDelete.Visible = false; linkEditAttributes.Visible = false; linkEditPictures.Visible = false; sitemapdata.Add(new SiteMapDataAttributeNode("New Place", Request.Url)); placeredirect.Visible = false; websitesView.Visible = false; } LocationSelector_LocationChanged(sender, e); StackSiteMap(sitemapdata); } 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 editing places."); manageAdd.Enabled = false; } SetDefaultButton(manageAdd); }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DomainClass cs = SessionManager.GetDomainClass("Bug"); inputSubject.MaxLength = cs["Subject"].MaxLengthInChars; selectPriority.DataSource = SessionManager.BugService.GetBugPriorities( SessionManager.Ticket, null); selectPriority.DataBind(); selectSeverity.DataSource = SessionManager.BugService.GetBugSeverities( SessionManager.Ticket, null); selectSeverity.DataBind(); selectType.DataSource = SessionManager.BugService.GetBugTypes( SessionManager.Ticket, null); selectType.DataBind(); TransitBugProject project = SessionManager.BugService.GetBugProjectById( SessionManager.Ticket, ProjectId); SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Bugs", Request, "BugProjectsManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode(project.Name, Request, string.Format("BugProjectBugsManage.aspx?id={0}", project.Id))); if (RequestId > 0) { TransitBug bug = SessionManager.BugService.GetBugById( SessionManager.Ticket, RequestId); inputSubject.Text = bug.Subject; inputDetails.Text = bug.Details; ListItemManager.TrySelect(selectPriority, bug.Priority); ListItemManager.TrySelect(selectSeverity, bug.Severity); ListItemManager.TrySelect(selectType, bug.Type); linkBack.NavigateUrl = string.Format("BugView.aspx?id={0}", bug.Id); sitemapdata.Add(new SiteMapDataAttributeNode(string.Format("#{0}: {1}", bug.Id, bug.Subject), Request.Url)); } else { string type = Request.QueryString["type"]; ListItemManager.TrySelect(selectType, type); linkBack.NavigateUrl = string.Format("BugProjectBugsManage.aspx?id={0}", ProjectId); if (Request.QueryString["url"] != null) { inputSubject.Text = Request.QueryString["url"]; } if (Request.QueryString["message"] != null) { inputDetails.Text = Request.QueryString["message"]; } sitemapdata.Add(new SiteMapDataAttributeNode("New Bug", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
public void Page_Load(object sender, EventArgs e) { if (RequestId <= 0 && GetId("pid") == 0) { throw new Exception("Missing Place"); } LocationSelector.LocationChanged += new EventHandler(LocationSelector_LocationChanged); if (!IsPostBack) { DomainClass cs = SessionManager.GetDomainClass("PlaceChangeRequest"); inputName.MaxLength = cs["Name"].MaxLengthInChars; inputStreet.MaxLength = cs["Street"].MaxLengthInChars; inputZip.MaxLength = cs["Zip"].MaxLengthInChars; inputCrossStreet.MaxLength = cs["CrossStreet"].MaxLengthInChars; inputPhone.MaxLength = cs["Phone"].MaxLengthInChars; inputFax.MaxLength = cs["Fax"].MaxLengthInChars; inputEmail.MaxLength = cs["Email"].MaxLengthInChars; ArrayList types = new ArrayList(); types.Add(new TransitAccountPlaceType()); types.AddRange(SessionManager.PlaceService.GetPlaceTypes(SessionManager.Ticket, null)); selectType.DataSource = types; selectType.DataBind(); TransitPlace place = null; if (RequestId > 0) { TransitPlaceChangeRequest request = SessionManager.PlaceService.GetPlaceChangeRequestById( SessionManager.Ticket, RequestId); labelName.Text = Renderer.Render(request.Name); inputName.Text = request.Name; inputDescription.Text = request.Description; inputCrossStreet.Text = request.CrossStreet; inputEmail.Text = request.Email; inputFax.Text = request.Fax; inputPhone.Text = request.Phone; inputStreet.Text = request.Street; inputZip.Text = request.Zip; ListItemManager.TrySelect(selectType, request.Type); LocationSelector.SelectLocation(sender, new LocationEventArgs(request)); place = SessionManager.PlaceService.GetPlaceById( SessionManager.Ticket, request.PlaceId); } else { place = SessionManager.PlaceService.GetPlaceById( SessionManager.Ticket, PlaceId); labelName.Text = Renderer.Render(place.Name); inputName.Text = place.Name; inputDescription.Text = place.Description; inputCrossStreet.Text = place.CrossStreet; inputEmail.Text = place.Email; inputFax.Text = place.Fax; inputPhone.Text = place.Phone; inputStreet.Text = place.Street; inputZip.Text = place.Zip; ListItemManager.TrySelect(selectType, place.Type); LocationSelector.SelectLocation(sender, new LocationEventArgs(place)); } SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx")); sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "PlacesView.aspx", place.Country, place.State, place.City, place.Neighborhood, place.Type)); sitemapdata.Add(new SiteMapDataAttributeNode(place.Name, Request, string.Format("PlaceView.aspx?id={0}", place.Id))); sitemapdata.Add(new SiteMapDataAttributeNode("Request Changes", Request.Url)); StackSiteMap(sitemapdata); linkBack.NavigateUrl = (RequestId > 0 ? string.Format("AccountPlaceChangeRequestsManage.aspx?id={0}", RequestId) : string.Format("PlaceView.aspx?id={0}", place.Id)); } 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 editing places."); save.Enabled = false; } LocationSelector_LocationChanged(sender, e); SetDefaultButton(save); }