public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int pagenumber = int.Parse(Request["PageNumber"]); int pagecount = int.Parse(Request["PageCount"]); int pagesize = int.Parse(Request["PageSize"]); TransitAccountEventQueryOptions options = new TransitAccountEventQueryOptions(); ServiceQueryOptions serviceoptions = new ServiceQueryOptions(); serviceoptions.PageSize = pagesize; serviceoptions.PageNumber = pagenumber; gridManage.DataSource = SessionManager.EventService.GetAccountEvents( SessionManager.Ticket, SessionManager.UtcOffset.Ticks, options, serviceoptions); gridManage.DataBind(); if (pagenumber > 0) { linkPrev.HRef = string.Format("AccountEventsViewList.aspx?PageNumber={0}&PageSize={1}&PageCount={2}", pagenumber - 1, pagesize, pagecount); } if (pagenumber < pagecount - 1) { linkNext.HRef = string.Format("AccountEventsViewList.aspx?PageNumber={0}&PageSize={1}&PageCount={2}", pagenumber + 1, pagesize, pagecount); } } }
public void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int pagenumber = int.Parse(Request["PageNumber"]); int pagecount = int.Parse(Request["PageCount"]); int pagesize = int.Parse(Request["PageSize"]); TransitAccountEventQueryOptions options = new TransitAccountEventQueryOptions(); ServiceQueryOptions serviceoptions = new ServiceQueryOptions(); serviceoptions.PageSize = pagesize; serviceoptions.PageNumber = pagenumber; gridManage.DataSource = SessionManager.EventService.GetAccountEvents( SessionManager.Ticket, SessionManager.UtcOffset.Ticks, options, serviceoptions); gridManage.DataBind(); if (pagenumber > 0) linkPrev.HRef = string.Format("AccountEventsViewList.aspx?PageNumber={0}&PageSize={1}&PageCount={2}", pagenumber - 1, pagesize, pagecount); if (pagenumber < pagecount - 1) linkNext.HRef = string.Format("AccountEventsViewList.aspx?PageNumber={0}&PageSize={1}&PageCount={2}", pagenumber + 1, pagesize, pagecount); } }
private void GetData(object sender, EventArgs e) { TransitAccountEventQueryOptions options = GetQueryOptions(); gridManage.CurrentPageIndex = 0; gridManage.VirtualItemCount = SessionManager.GetCount <TransitAccountEvent, TransitAccountEventQueryOptions>( options, SessionManager.EventService.GetAccountEventsCount); gridManage_OnGetDataSource(this, null); gridManage.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { linkSuggestFeature.HRef = string.Format("BugEdit.aspx?pid={0}&type=Suggestion", SessionManager.GetCachedConfiguration( "SnCore.NewFeature.ProjectId", "0")); linkReportBug.HRef = string.Format("BugEdit.aspx?pid={0}&type=Bug", SessionManager.GetCachedConfiguration( "SnCore.Bug.ProjectId", "0")); linkSiteDiscussion.HRef = string.Format("DiscussionView.aspx?id={0}", SessionManager.GetCachedConfiguration( "SnCore.Site.DiscussionId", "0")); linkBlog.HRef = string.Format("AccountBlogView.aspx?id={0}", SessionManager.GetCachedConfiguration( "SnCore.Blog.Id", "0")); AccountActivityQueryOptions aaqo = new AccountActivityQueryOptions(); listAccounts.DataSource = GetPagedList(SessionManager.SocialService.GetAccountActivityCount(SessionManager.Ticket, aaqo)); listAccounts.DataBind(); TransitAccountFeedQueryOptions fqo = new TransitAccountFeedQueryOptions(); listFeeds.DataSource = GetPagedList(SessionManager.SyndicationService.GetAccountFeedsCount(SessionManager.Ticket, fqo)); listFeeds.DataBind(); TransitPlaceQueryOptions pqo = new TransitPlaceQueryOptions(); listPlaces.DataSource = GetPagedList(SessionManager.PlaceService.GetPlacesCount(SessionManager.Ticket, pqo)); listPlaces.DataBind(); TransitAccountEventQueryOptions aeqo = new TransitAccountEventQueryOptions(); listAccountEvents.DataSource = GetPagedList(SessionManager.EventService.GetAccountEventsCount(SessionManager.Ticket, aeqo)); listAccountEvents.DataBind(); listAccountGroups.DataSource = GetPagedList(SessionManager.GroupService.GetAccountGroupsCount(SessionManager.Ticket)); listAccountGroups.DataBind(); listStories.DataSource = GetPagedList(SessionManager.StoryService.GetAllAccountStoriesCount(SessionManager.Ticket)); listStories.DataBind(); listDiscussions.DataSource = SessionManager.DiscussionService.GetDiscussions(SessionManager.Ticket, null); listDiscussions.DataBind(); listSurveys.DataSource = SessionManager.ObjectService.GetSurveys(SessionManager.Ticket, null); listSurveys.DataBind(); } }
private TransitAccountEventQueryOptions GetQueryOptions() { TransitAccountEventQueryOptions options = new TransitAccountEventQueryOptions(); options.City = inputCity.Text; options.Country = inputCountry.SelectedValue; options.State = inputState.SelectedValue; options.Neighborhood = inputNeighborhood.SelectedValue; options.Name = inputName.Text; options.Type = inputType.SelectedValue; return(options); }
void gridManage_OnGetDataSource(object sender, EventArgs e) { TransitAccountEventQueryOptions options = GetQueryOptions(); string args = string.Format("city={0}&country={1}&state={2}&name={3}&type={4}&neighborhood={5}", Renderer.UrlEncode(options.City), Renderer.UrlEncode(options.Country), Renderer.UrlEncode(options.State), Renderer.UrlEncode(options.Name), Renderer.UrlEncode(options.Type), Renderer.UrlEncode(options.Neighborhood)); linkRelRss.NavigateUrl = string.Format("AccountEventsRss.aspx?{0}", args); linkPermalink.NavigateUrl = string.Format("AccountEventsView.aspx?{0}", args); Title = titleEvents.Text = (string.IsNullOrEmpty(options.City) ? titleEvents.DefaultText : string.Format("{0}: {1}", titleEvents.DefaultText, options.City)); if (IsPostBack) { Title = string.Format("{0} - {1}", SessionManager.GetCachedConfiguration( "SnCore.Title", "SnCore"), titleEvents.Text); } ServiceQueryOptions serviceoptions = new ServiceQueryOptions(); serviceoptions.PageSize = gridManage.PageSize; serviceoptions.PageNumber = gridManage.CurrentPageIndex; gridManage.DataSource = SessionManager.GetCollection <TransitAccountEvent, long, TransitAccountEventQueryOptions>( SessionManager.UtcOffset.Ticks, options, serviceoptions, SessionManager.EventService.GetAccountEvents); if (((SnCoreMasterPage)Master).ScriptManager.IsInAsyncPostBack && !((SnCoreMasterPage)Master).ScriptManager.IsNavigating) { NameValueCollection history = new NameValueCollection(); history.Add("city", options.City); history.Add("country", options.Country); history.Add("state", options.State); history.Add("name", options.Name); history.Add("neighborhood", options.Neighborhood); history.Add("type", options.Type); history.Add("page", gridManage.CurrentPageIndex.ToString()); ((SnCoreMasterPage)Master).ScriptManager.AddHistoryPoint(history, Page.Title); } panelLinks.Update(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TransitAccountEventQueryOptions options = new TransitAccountEventQueryOptions(); options.SortAscending = Ascending; options.SortOrder = SortOrder; options.City = City; options.Country = Country; options.State = State; options.Name = Name; options.Type = Type; ServiceQueryOptions queryoptions = new ServiceQueryOptions(); queryoptions.PageNumber = 0; queryoptions.PageSize = 10; rssRepeater.DataSource = SessionManager.EventService.GetAccountEvents( SessionManager.Ticket, SessionManager.UtcOffset.Ticks, options, queryoptions); rssRepeater.DataBind(); } }
private TransitAccountEventQueryOptions GetQueryOptions() { TransitAccountEventQueryOptions options = new TransitAccountEventQueryOptions(); options.City = inputCity.Text; options.Country = inputCountry.SelectedValue; options.State = inputState.SelectedValue; options.Neighborhood = inputNeighborhood.SelectedValue; options.Name = inputName.Text; options.Type = inputType.SelectedValue; return options; }
public List <TransitAccountEvent> GetAccountEvents(string ticket, long utcoffsetTicks, TransitAccountEventQueryOptions qopt, ServiceQueryOptions options) { List <TransitAccountEvent> result = WebServiceImpl <TransitAccountEvent, ManagedAccountEvent, AccountEvent> .GetList( ticket, options, qopt.CreateQuery()); using (SnCore.Data.Hibernate.Session.OpenConnection()) { ISession session = SnCore.Data.Hibernate.Session.Current; ManagedSecurityContext sec = new ManagedSecurityContext(session, ticket); foreach (TransitAccountEvent t_instance in result) { t_instance.CreateSchedule(session, new TimeSpan(utcoffsetTicks), sec); } } return(result); }
public int GetAccountEventsCount(string ticket, TransitAccountEventQueryOptions qopt) { return(WebServiceImpl <TransitAccountEvent, ManagedAccountEvent, AccountEvent> .GetCount( ticket, qopt.CreateCountQuery())); }
public List<TransitAccountEvent> GetAccountEvents(string ticket, long utcoffsetTicks, TransitAccountEventQueryOptions qopt, ServiceQueryOptions options) { List<TransitAccountEvent> result = WebServiceImpl<TransitAccountEvent, ManagedAccountEvent, AccountEvent>.GetList( ticket, options, qopt.CreateQuery()); using (SnCore.Data.Hibernate.Session.OpenConnection()) { ISession session = SnCore.Data.Hibernate.Session.Current; ManagedSecurityContext sec = new ManagedSecurityContext(session, ticket); foreach (TransitAccountEvent t_instance in result) { t_instance.CreateSchedule(session, new TimeSpan(utcoffsetTicks), sec); } } return result; }
public int GetAccountEventsCount(string ticket, TransitAccountEventQueryOptions qopt) { return WebServiceImpl<TransitAccountEvent, ManagedAccountEvent, AccountEvent>.GetCount( ticket, qopt.CreateCountQuery()); }