void accountStories_OnGetDataSource(object sender, EventArgs e) { ServiceQueryOptions options = new ServiceQueryOptions(); options.PageNumber = accountStories.CurrentPageIndex; options.PageSize = accountStories.PageSize; AccountStoryQueryOptions queryoptions = new AccountStoryQueryOptions(); queryoptions.PublishedOnly = true; accountStories.DataSource = SessionManager.GetCollection<TransitAccountStory,int, AccountStoryQueryOptions>( AccountId, queryoptions, options, SessionManager.StoryService.GetAccountStories); }
public int GetAccountStoriesCount(string ticket, int id, AccountStoryQueryOptions queryoptions) { StringBuilder query = new StringBuilder(); query.AppendFormat("WHERE AccountStory.Account.Id = {0}", id); if (queryoptions != null && queryoptions.PublishedOnly) query.Append(" AND AccountStory.Publish = 1"); return WebServiceImpl<TransitAccountStory, ManagedAccountStory, AccountStory>.GetCount( ticket, query.ToString()); }
public List<TransitAccountStory> GetAccountStories(string ticket, int id, AccountStoryQueryOptions queryoptions, ServiceQueryOptions options) { List<ICriterion> expressions = new List<ICriterion>(); expressions.Add(Expression.Eq("Account.Id", id)); if (queryoptions != null && queryoptions.PublishedOnly) expressions.Add(Expression.Eq("Publish", true)); Order[] orders = { Order.Desc("Created") }; return WebServiceImpl<TransitAccountStory, ManagedAccountStory, AccountStory>.GetList( ticket, options, expressions.ToArray(), orders); }
void accountStories_OnGetDataSource(object sender, EventArgs e) { ServiceQueryOptions options = new ServiceQueryOptions(); options.PageNumber = accountStories.CurrentPageIndex; options.PageSize = accountStories.PageSize; AccountStoryQueryOptions queryoptions = new AccountStoryQueryOptions(); queryoptions.PublishedOnly = true; accountStories.DataSource = SessionManager.GetCollection <TransitAccountStory, int, AccountStoryQueryOptions>( AccountId, queryoptions, options, SessionManager.StoryService.GetAccountStories); }
public int GetAccountStoriesCount(string ticket, int id, AccountStoryQueryOptions queryoptions) { StringBuilder query = new StringBuilder(); query.AppendFormat("WHERE AccountStory.Account.Id = {0}", id); if (queryoptions != null && queryoptions.PublishedOnly) { query.Append(" AND AccountStory.Publish = 1"); } return(WebServiceImpl <TransitAccountStory, ManagedAccountStory, AccountStory> .GetCount( ticket, query.ToString())); }
public List <TransitAccountStory> GetAccountStories(string ticket, int id, AccountStoryQueryOptions queryoptions, ServiceQueryOptions options) { List <ICriterion> expressions = new List <ICriterion>(); expressions.Add(Expression.Eq("Account.Id", id)); if (queryoptions != null && queryoptions.PublishedOnly) { expressions.Add(Expression.Eq("Publish", true)); } Order[] orders = { Order.Desc("Created") }; return(WebServiceImpl <TransitAccountStory, ManagedAccountStory, AccountStory> .GetList( ticket, options, expressions.ToArray(), orders)); }