void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions serviceoptions = new ServiceQueryOptions(gridManage.PageSize, gridManage.CurrentPageIndex);
     gridManage.DataSource = SessionManager.GetCollection<TransitAccountGroup>(
         serviceoptions, SessionManager.GroupService.GetAccountGroups);
     panelLinks.Update();
 }
 void PlaceWebsites_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions(PlaceWebsites.PageSize, PlaceWebsites.CurrentPageIndex);
     PlaceWebsites.DataSource = SessionManager.GetCollection<TransitPlaceWebsite, int>(
         PlaceId, options, SessionManager.PlaceService.GetPlaceWebsites);
     panelGrid.Update();
 }
Beispiel #3
0
 public ServiceQueryOptions GetServiceQueryOptions()
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = Grid.CurrentPageIndex;
     options.PageSize = Grid.PageSize;
     return options;
 }
 void queue_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = queue.CurrentPageIndex;
     options.PageSize = queue.PageSize;
     queue.DataSource = SessionManager.PlaceService.GetPlaceQueueItems(SessionManager.Ticket, RequestId, options);
 }
Beispiel #5
0
 public List <TransitAccountGroup> GetPublicAccountGroups(string ticket, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("IsPrivate", false) };
     Order[]      orders      = { Order.Desc("Created") };
     return(WebServiceImpl <TransitAccountGroup, ManagedAccountGroup, AccountGroup> .GetList(
                ticket, options, expressions, orders));
 }
 void gridManageFavorites_OnGetDataSource(object sender, EventArgs e)
 {
         ServiceQueryOptions serviceoptions = new ServiceQueryOptions(
             gridManageFavorites.PageSize, gridManageFavorites.CurrentPageIndex);
         gridManageFavorites.DataSource = SessionManager.GetCollection<TransitPlace>(
             serviceoptions, SessionManager.PlaceService.GetFavoritePlaces);
 }
 public List <TransitDiscussion> GetDiscussions(string ticket, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("Personal", false) };
     Order[]      orders      = { Order.Desc("Modified") };
     return(WebServiceImpl <TransitDiscussion, ManagedDiscussion, Discussion> .GetList(
                ticket, options, expressions, orders));
 }
Beispiel #8
0
 public List <TransitBug> GetBugs(string ticket, int project_id, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("Project.Id", project_id) };
     Order[]      orders      = { Order.Desc("Created") };
     return(WebServiceImpl <TransitBug, ManagedBug, Bug> .GetList(
                ticket, options, expressions, orders));
 }
Beispiel #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ServiceQueryOptions options = new ServiceQueryOptions();
         options.PageNumber = 0;
         options.PageSize = 10;
         // get new members
         rssRepeaterMembers.DataSource = SessionManager.GetCollection<TransitAccountGroupAccount, int>(
             AccountGroupId, options, SessionManager.GroupService.GetAccountGroupAccounts);
         rssRepeaterMembers.DataBind();
         // get new places
         rssRepeaterPlaces.DataSource = SessionManager.GetCollection<TransitAccountGroupPlace, int>(
             AccountGroupId, options, SessionManager.GroupService.GetAccountGroupPlaces);
         rssRepeaterPlaces.DataBind();
         // get new discussion posts
         discussionsRss.ObjectId = RequestId;
         discussionsRss.Type = "AccountGroup";
         // get new blog posts
         if (AccountGroup.AccountBlogId > 0)
         {
             rssRepeaterBlogItems.DataSource = SessionManager.GetCollection<TransitAccountBlogPost, TransitAccountBlogPostQueryOptions>(
                 GetBlogPostsOptions(), options, SessionManager.BlogService.GetAccountBlogPosts);
             rssRepeaterBlogItems.DataBind();
         }
     }
 }
Beispiel #10
0
 public List <TransitState> GetStatesByCountryId(string ticket, int id, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("Country.Id", id) };
     Order[]      orders      = { Order.Asc("Name") };
     return(WebServiceImpl <TransitState, ManagedState, State> .GetList(
                ticket, options, expressions, orders));
 }
Beispiel #11
0
 public List <TransitMadLib> GetMadLibs(string ticket, int id, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("Account.Id", id) };
     Order[]      orders      = { Order.Desc("Created") };
     return(WebServiceImpl <TransitMadLib, ManagedMadLib, MadLib> .GetList(
                ticket, options, expressions, orders));
 }
Beispiel #12
0
    private void GetData()
    {
        ServiceQueryOptions serviceoptions = new ServiceQueryOptions();
        serviceoptions.PageSize = accounts.RepeatColumns;

        // accounts
        accounts.DataSource = SessionManager.GetCollection<TransitFeature, string>(
            "Account", serviceoptions, SessionManager.ObjectService.GetFeatures);
        accounts.DataBind();

        // places
        places.DataSource = SessionManager.GetCollection<TransitFeature, string>(
            "Place", serviceoptions, SessionManager.ObjectService.GetFeatures);
        places.DataBind();

        // feeds
        accountfeeds.DataSource = SessionManager.GetCollection<TransitFeature, string>(
            "AccountFeed", serviceoptions, SessionManager.ObjectService.GetFeatures);
        accountfeeds.DataBind();

        // events
        TransitAccountEventInstanceQueryOptions eventoptions = new TransitAccountEventInstanceQueryOptions();
        eventoptions.StartDateTime = DateTime.UtcNow;
        eventoptions.EndDateTime = DateTime.MaxValue;
        accountevents.DataSource = SessionManager.GetCollection<TransitAccountEventInstance, TransitAccountEventInstanceQueryOptions>(
            eventoptions, serviceoptions, SessionManager.EventService.GetAccountEventInstances);
        accountevents.DataBind();
    }
Beispiel #13
0
 public List <TransitAccountStory> GetAllAccountStories(string ticket, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("Publish", true) };
     Order[]      orders      = { Order.Desc("Created") };
     return(WebServiceImpl <TransitAccountStory, ManagedAccountStory, AccountStory> .GetList(
                ticket, options, expressions, orders));
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = gridManage.CurrentPageIndex;
     options.PageSize = gridManage.PageSize;
     gridManage.DataSource = SessionManager.MarketingService.GetCampaigns(SessionManager.Ticket, options);
 }
Beispiel #15
0
 public List<TransitAccountGroup> GetPublicAccountGroups(string ticket, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("IsPrivate", false) };
     Order[] orders = { Order.Desc("Created") };
     return WebServiceImpl<TransitAccountGroup, ManagedAccountGroup, AccountGroup>.GetList(
         ticket, options, expressions, orders);
 }
    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"]);

            ServiceQueryOptions serviceoptions = new ServiceQueryOptions();
            serviceoptions.PageSize = pagesize;
            serviceoptions.PageNumber = pagenumber;

            TransitAccountFeedQueryOptions options = new TransitAccountFeedQueryOptions();
            gridManage.DataSource = SessionManager.SyndicationService.GetAccountFeeds(
                SessionManager.Ticket, options, serviceoptions);
            gridManage.DataBind();

            if (pagenumber > 0)
                linkPrev.HRef = string.Format("AccountFeedsViewList.aspx?PageNumber={0}&PageSize={1}&PageCount={2}",
                    pagenumber - 1, pagesize, pagecount);

            if (pagenumber < pagecount - 1)
                linkNext.HRef = string.Format("AccountFeedsViewList.aspx?PageNumber={0}&PageSize={1}&PageCount={2}",
                    pagenumber + 1, pagesize, pagecount);
        }
    }
Beispiel #17
0
 public List <TransitRefererAccount> GetRefererAccounts(string ticket, ServiceQueryOptions options)
 {
     return(WebServiceImpl <TransitRefererAccount, ManagedRefererAccount, RefererAccount> .GetList(
                ticket, options, "SELECT {ra.*} FROM RefererAccount {ra}, RefererHost rh" +
                " WHERE ra.RefererHost_Id = rh.RefererHost_Id" +
                " ORDER BY rh.Total DESC", "ra"));
 }
Beispiel #18
0
 public List <TransitCity> GetCitiesByStateId(string ticket, int id, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("State.Id", id) };
     Order[]      orders      = { Order.Asc("Name") };
     return(WebServiceImpl <TransitCity, ManagedCity, City> .GetList(
                ticket, options, expressions, orders));
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageSize = gridManage.PageSize;
     options.PageNumber = gridManage.CurrentPageIndex;
     gridManage.DataSource = SessionManager.AccountService.GetAllAccountRedirects(SessionManager.Ticket, options);
 }
Beispiel #20
0
 public List <TransitBugNote> GetBugNotes(string ticket, int bug_id, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("Bug.Id", bug_id) };
     Order[]      orders      = { Order.Desc("Modified") };
     return(WebServiceImpl <TransitBugNote, ManagedBugNote, BugNote> .GetList(
                ticket, options, expressions, orders));
 }
 void accountWebsites_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions(accountWebsites.PageSize, accountWebsites.CurrentPageIndex);
     accountWebsites.DataSource = SessionManager.GetCollection<TransitAccountWebsite, int>(
         AccountId, options, SessionManager.AccountService.GetAccountWebsites);
     panelGrid.Update();
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions(gridManage.PageSize, gridManage.CurrentPageIndex);
     gridManage.DataSource = SessionManager.GetCollection<TransitAccount, string, string, string>(
         Request["GroupName"], Request["PropertyName"], Request["PropertyValue"], options,
         SessionManager.AccountService.GetAccountsByPropertyValue);
 }
Beispiel #23
0
 public static List <TransitType> GetList(string ticket, ServiceQueryOptions options, ICriterion[] expressions, Order[] orders, GetTransformedInstanceDelegate functor)
 {
     using (SnCore.Data.Hibernate.Session.OpenConnection())
     {
         ISession session           = SnCore.Data.Hibernate.Session.Current;
         ManagedSecurityContext sec = new ManagedSecurityContext(session, ticket);
         ICriteria criteria         = session.CreateCriteria(typeof(DataType));
         // optional criterion expressions
         if (expressions != null)
         {
             foreach (ICriterion criterion in expressions)
             {
                 criteria.Add(criterion);
             }
         }
         // options orders
         if (orders != null)
         {
             foreach (Order order in orders)
             {
                 criteria.AddOrder(order);
             }
         }
         // query options
         if (options != null && options.PageSize > 0)
         {
             criteria.SetMaxResults(options.PageSize);
         }
         if (options != null && options.FirstResult > 0)
         {
             criteria.SetFirstResult(options.FirstResult);
         }
         return(GetTransformedList(session, sec, criteria.List <DataType>(), functor));
     }
 }
 void placesList_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions(placesList.PageSize, placesList.CurrentPageIndex);
     placesList.DataSource = SessionManager.GetCollection<TransitAccountPlace, int>(
         AccountId, options, SessionManager.PlaceService.GetAccountPlaces);
     panelGrid.Update();
 }
    public string GetReplies(int post_id, int thread_id)
    {
        StringBuilder result = new StringBuilder();
        
        ServiceQueryOptions options = new ServiceQueryOptions();
        options.PageNumber = 0;
        options.PageSize = 3;
        IList<TransitDiscussionPost> items = SessionManager.GetCollection<TransitDiscussionPost, int>(
            thread_id, options, SessionManager.DiscussionService.GetDiscussionThreadPostsByOrder);
        
        foreach (TransitDiscussionPost t_instance in items)
        {
            if (t_instance.Id == post_id)
                continue;

            result.Append(string.Format("<div>&#187; <b>{0}</b> replied {1}</a></div>",
                Renderer.Render(t_instance.AccountName), 
                SessionManager.ToAdjustedString(t_instance.Created)));
        }
        
        if (result.Length > 0)
        {
            result.Insert(0, "<div class=\"sncore_message_reply\">");
            result.Append("</div>");
        }

        return result.ToString();
    }
Beispiel #26
0
 public List<TransitAccountBlog> GetAccountBlogs(string ticket, int id, ServiceQueryOptions options)
 {
     ICriterion[] expression = { Expression.Eq("Account.Id", id) };
     Order[] orders = { Order.Desc("Created") };
     return WebServiceImpl<TransitAccountBlog, ManagedAccountBlog, AccountBlog>.GetList(
         ticket, options, expression, orders);
 }
 public void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = gridManage.CurrentPageIndex;
     options.PageSize = gridManage.PageSize;
     gridManage.DataSource = SessionManager.GetCollection<TransitDiscussionPost>(
         options, SessionManager.DiscussionService.GetDiscussionTopOfThreads);
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageSize = gridManage.PageSize;
     options.PageNumber = gridManage.CurrentPageIndex;
     gridManage.DataSource = SessionManager.PlaceService.GetPlaceAttributes(
         SessionManager.Ticket, RequestId, options);
 }
 void picturesView_OnGetDataSource(object sender, EventArgs e)
 {
     AccountPicturesQueryOptions po = new AccountPicturesQueryOptions();
     po.Hidden = false;
     ServiceQueryOptions options = new ServiceQueryOptions(picturesView.PageSize, picturesView.CurrentPageIndex);
     picturesView.DataSource = SessionManager.GetCollection<TransitAccountPicture, int, AccountPicturesQueryOptions>(
         AccountId, po, options, SessionManager.AccountService.GetAccountPictures);
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = discussionThreadView.CurrentPageIndex;
     options.PageSize = discussionThreadView.PageSize;
     discussionThreadView.DataSource = SessionManager.GetCollection<TransitDiscussionPost, DiscussionQueryOptions>(
         QueryOptions, options, SessionManager.DiscussionService.GetUserDiscussionThreads);
 }
 void accountsList_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = accountsList.CurrentPageIndex;
     options.PageSize = accountsList.PageSize;
     accountsList.DataSource = SessionManager.GetCollection<TransitAccountPlaceFavorite, int>(
         PlaceId, options, SessionManager.PlaceService.GetAccountPlaceFavorites);
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageSize = gridManage.PageSize;
     options.PageNumber = gridManage.CurrentPageIndex;
     gridManage.DataSource = SessionManager.EventService.GetAccountEventsByAccountId(
         SessionManager.Ticket, SessionManager.AccountId, SessionManager.UtcOffset.Ticks, options);
 }
 void gridActivity_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageSize = gridActivity.PageSize;
     options.PageNumber = gridActivity.CurrentPageIndex;
     gridActivity.DataSource = SessionManager.GetCollection<TransitAccountAuditEntry>(
         options, SessionManager.SocialService.GetAccountAuditEntries);
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = gridManage.CurrentPageIndex;
     options.PageSize = gridManage.PageSize;
     gridManage.DataSource = SessionManager.SyndicationService.GetAccountFeeds(
         SessionManager.Ticket, GetOptions(), options);
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageSize = gridManage.PageSize;
     options.PageNumber = gridManage.CurrentPageIndex;
     gridManage.DataSource = SessionManager.StoryService.GetAccountStoryPictures(
         SessionManager.Ticket, RequestId, options);
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions serviceoptions = new ServiceQueryOptions();
     serviceoptions.PageSize = gridManage.PageSize;
     serviceoptions.PageNumber = gridManage.CurrentPageIndex;
     gridManage.DataSource = SessionManager.GetCollection<TransitFeature, string>(
         "Account", serviceoptions, SessionManager.ObjectService.GetFeatures);
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = gridManage.CurrentPageIndex;
     options.PageSize = gridManage.PageSize;
     gridManage.DataSource = SessionManager.GetCollection<TransitAccountFriend, TransitAccountFriendQueryOptions>(
         GetOptions(), options, SessionManager.SocialService.GetAccountFriends);
 }
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = gridManage.CurrentPageIndex;
     options.PageSize = gridManage.PageSize;
     gridManage.DataSource = SessionManager.GetCollection<TransitAccountInvitation, int>(
         SessionManager.AccountId, options, SessionManager.AccountService.GetAccountInvitationsByAccountId);
 }
 void accountSurveyAnswers_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageSize = accountSurveyAnswers.PageSize;
     options.PageNumber = accountSurveyAnswers.CurrentPageIndex;
     accountSurveyAnswers.DataSource = SessionManager.GetCollection<TransitAccountSurveyAnswer, int>(
         SurveyQuestionId, options, SessionManager.AccountService.GetAccountSurveyAnswersByQuestionId);
 }
 void listSent_OnGetDataSource(object sender, EventArgs e)
 {
     ServiceQueryOptions options = new ServiceQueryOptions();
     options.PageNumber = listSent.CurrentPageIndex;
     options.PageSize = listSent.PageSize;
     listSent.DataSource = SessionManager.SocialService.GetSentAccountFriendRequests(
         SessionManager.Ticket, SessionManager.AccountId, options);
 }
Beispiel #41
0
 public List <TransitConfiguration> GetConfigurations(string ticket, ServiceQueryOptions options)
 {
     using (SnCore.Data.Hibernate.Session.OpenConnection())
     {
         ISession session           = SnCore.Data.Hibernate.Session.Current;
         ManagedSecurityContext sec = new ManagedSecurityContext(session, ticket);
         return(WebServiceQueryOptions <TransitConfiguration> .Apply(options,
                                                                     WebServiceImpl <TransitConfiguration, ManagedConfiguration, Configuration> .GetTransformedList(
                                                                         session, sec, ManagedConfiguration.GetAllConfigurations(session))));
     }
 }
Beispiel #42
0
        public List <TransitDiscussion> GetAccountDiscussions(string ticket, int id, ServiceQueryOptions options)
        {
            ICriterion[] expressions =
            {
                Expression.Eq("Personal",   false),
                Expression.Eq("Account.Id", id)
            };

            return(WebServiceImpl <TransitDiscussion, ManagedDiscussion, Discussion> .GetList(
                       ticket, options, expressions, null));
        }
Beispiel #43
0
 public List <TransitDiscussionPost> GetDiscussionTopOfThreads(string ticket, ServiceQueryOptions options)
 {
     return(WebServiceImpl <TransitDiscussionPost, ManagedDiscussionPost, DiscussionPost> .GetList(
                ticket, options,
                "SELECT {Post.*} FROM DiscussionPost {Post}, DiscussionThread Thread, Discussion Discussion" +
                " WHERE Post.DiscussionThread_Id = Thread.DiscussionThread_Id" +
                " AND Thread.Discussion_Id = Discussion.Discussion_Id" +
                " AND Post.DiscussionPostParent_Id IS NULL" +
                " AND Discussion.Personal = 0" +
                " ORDER BY Post.Sticky DESC, Thread.Modified DESC",
                "Post"));
 }
Beispiel #44
0
        public static List <T> Apply(ServiceQueryOptions options, IList <T> collection)
        {
            if (options == null)
            {
                List <T> result = new List <T>();
                result.AddRange(collection);
                return(result);
            }

            return(SnCore.Data.Hibernate.Collection <T> .ApplyServiceOptions(
                       options.FirstResult, options.PageSize, collection));
        }
Beispiel #45
0
        public TransitRssChannelItems GetAccountRssWatchItems(string ticket, int id, ServiceQueryOptions options)
        {
            using (SnCore.Data.Hibernate.Session.OpenConnection())
            {
                ISession session                = SnCore.Data.Hibernate.Session.Current;
                ManagedSecurityContext sec      = new ManagedSecurityContext(session, ticket);
                ManagedAccountRssWatch rsswatch = new ManagedAccountRssWatch(session, id);
                TransitRssChannelItems result   = rsswatch.GetSubscriptionUpdates(sec);
                result.Items = WebServiceQueryOptions <TransitRssItem> .Apply(options, result.Items);

                return(result);
            }
        }
Beispiel #46
0
 public List <TransitAccount> GetActiveAccounts(string ticket, ServiceQueryOptions options)
 {
     return(WebServiceImpl <TransitAccount, ManagedAccount, Account> .GetList(
                ticket, options,
                "SELECT Account FROM Account Account WHERE EXISTS (" +
                " FROM AccountPicture AccountPicture " +
                " WHERE AccountPicture.Account = Account AND AccountPicture.Hidden = 0" +
                ") AND EXISTS (" +
                " FROM AccountEmail AccountEmail " +
                " WHERE AccountEmail.Account = Account AND " +
                " AccountEmail.Verified = 1" +
                ") ORDER BY Account.LastLogin DESC"));
 }
Beispiel #47
0
        public List <TransitAccount> GetTagWordAccountsById(string ticket, int id, ServiceQueryOptions options)
        {
            StringBuilder query = new StringBuilder();

            query.AppendFormat(
                "SELECT acct FROM Account acct, TagWordAccount twa " +
                "WHERE acct.Id = twa.AccountId " +
                "AND twa.TagWord.Id = {0} " +
                "ORDER BY acct.LastLogin DESC",
                id);

            return(WebServiceImpl <TransitAccount, ManagedAccount, Account> .GetList(
                       ticket, options, query.ToString()));
        }
Beispiel #48
0
        public List <TransitAccount> FindRefererAccounts(string ticket, string uri, ServiceQueryOptions options)
        {
            string like = string.Format("%{0}%", Renderer.SqlEncode(uri));

            return(WebServiceImpl <TransitAccount, ManagedAccount, Account> .GetList(ticket, options,
                                                                                     "SELECT {Account.*} FROM {Account} WHERE EXISTS ( " +
                                                                                     " SELECT AccountWebsite.AccountWebsite_Id FROM AccountWebsite AccountWebsite " +
                                                                                     " WHERE Account.Account_Id = AccountWebsite.Account_Id AND AccountWebsite.Url LIKE '" + like + "'" +
                                                                                     " ) OR EXISTS (" +
                                                                                     " SELECT AccountFeed.AccountFeed_Id FROM AccountFeed AccountFeed " +
                                                                                     " WHERE Account.Account_Id = AccountFeed.Account_Id " +
                                                                                     " AND ( AccountFeed.LinkUrl LIKE '" + like + "' OR AccountFeed.FeedUrl LIKE '" + like + "')" +
                                                                                     ")", "Account"));
        }
Beispiel #49
0
 public List <TransitDiscussionPost> GetDiscussionThreads(string ticket, ServiceQueryOptions options)
 {
     return(WebServiceImpl <TransitDiscussionPost, ManagedDiscussionPost, DiscussionPost> .GetList(
                ticket, options,
                "SELECT {Post.*} FROM DiscussionPost {Post}" +
                " WHERE Post.DiscussionPost_Id IN ( " +
                " SELECT MAX(dp.DiscussionPost_Id) FROM DiscussionPost dp, DiscussionThread dt, Discussion d" +
                "  WHERE dp.DiscussionThread_Id = dt.DiscussionThread_Id" +
                "  AND d.Discussion_Id = dt.Discussion_Id" +
                "  AND d.Personal = 0" +
                "  GROUP BY dt.DiscussionThread_Id" +
                " ) ORDER BY Post.Sticky DESC, Post.Modified DESC",
                "Post"));
 }
Beispiel #50
0
 public static List <TransitType> GetList(string ticket, ServiceQueryOptions options, string sqlquery, string returnalias, GetTransformedInstanceDelegate functor)
 {
     using (SnCore.Data.Hibernate.Session.OpenConnection())
     {
         ISession session           = SnCore.Data.Hibernate.Session.Current;
         ManagedSecurityContext sec = new ManagedSecurityContext(session, ticket);
         IQuery query = session.CreateSQLQuery(sqlquery).AddEntity(returnalias, typeof(DataType));
         if (options != null && options.PageSize > 0)
         {
             query.SetMaxResults(options.PageSize);
         }
         if (options != null && options.FirstResult > 0)
         {
             query.SetFirstResult(options.FirstResult);
         }
         return(GetTransformedList(session, sec, query.List <DataType>(), functor));
     }
 }
Beispiel #51
0
 public static List <TransitType> GetListFromIds(string ticket, ServiceQueryOptions options, string sqlquery)
 {
     using (SnCore.Data.Hibernate.Session.OpenConnection())
     {
         ISession session           = SnCore.Data.Hibernate.Session.Current;
         ManagedSecurityContext sec = new ManagedSecurityContext(session, ticket);
         IQuery query = session.CreateQuery(sqlquery);
         if (options != null && options.PageSize > 0)
         {
             query.SetMaxResults(options.PageSize);
         }
         if (options != null && options.FirstResult > 0)
         {
             query.SetFirstResult(options.FirstResult);
         }
         return(GetTransformedList(session, sec, query.List <int>()));
     }
 }
Beispiel #52
0
 public static List <TransitType> GetListFromNamedQuery(string ticket, ServiceQueryOptions options, string namedquery, GetTransformedInstanceDelegate functor)
 {
     using (SnCore.Data.Hibernate.Session.OpenConnection())
     {
         ISession session           = SnCore.Data.Hibernate.Session.Current;
         ManagedSecurityContext sec = new ManagedSecurityContext(session, ticket);
         IQuery query = session.GetNamedQuery(namedquery);
         if (options != null && options.PageSize > 0)
         {
             query.SetMaxResults(options.PageSize);
         }
         if (options != null && options.FirstResult > 0)
         {
             query.SetFirstResult(options.FirstResult);
         }
         query = query.SetResultTransformer(Transformers.AliasToBean(typeof(DataType)));
         return(GetTransformedList(session, sec, query.List <DataType>(), functor));
     }
 }
Beispiel #53
0
 public List <TransitCampaignAccountRecepient> GetCampaignAccountRecepients(string ticket, int id, ServiceQueryOptions options)
 {
     ICriterion[] expressions = { Expression.Eq("Campaign.Id", id) };
     return(WebServiceImpl <TransitCampaignAccountRecepient, ManagedCampaignAccountRecepient, CampaignAccountRecepient> .GetList(
                ticket, options, expressions, null));
 }
Beispiel #54
0
 public List <TransitCampaign> GetCampaigns(string ticket, ServiceQueryOptions options)
 {
     return(WebServiceImpl <TransitCampaign, ManagedCampaign, Campaign> .GetList(
                ticket, options));
 }
Beispiel #55
0
 public List <TransitRefererHostDup> GetRefererHostDups(string ticket, ServiceQueryOptions options)
 {
     return(WebServiceImpl <TransitRefererHostDup, ManagedRefererHostDup, RefererHostDup> .GetList(
                ticket, options));
 }
Beispiel #56
0
 public List <TransitCounter> GetCounters(string ticket, ServiceQueryOptions options)
 {
     Order[] orders = { Order.Desc("Total") };
     return(WebServiceImpl <TransitCounter, ManagedCounter, Counter> .GetList(
                ticket, options, null, orders));
 }
Beispiel #57
0
 public List <TransitRefererQuery> GetRefererQueries(string ticket, ServiceQueryOptions options)
 {
     Order[] orders = { Order.Desc("Total") };
     return(WebServiceImpl <TransitRefererQuery, ManagedRefererQuery, RefererQuery> .GetList(
                ticket, options, null, orders));
 }
Beispiel #58
0
 public List <TransitRefererHost> GetRefererHosts(string ticket, RefererHostQueryOptions qopt, ServiceQueryOptions options)
 {
     return(WebServiceImpl <TransitRefererHost, ManagedRefererHost, RefererHost> .GetList(
                ticket, options, qopt.CreateQuery()));
 }
Beispiel #59
0
        public List <TransitAccount> SearchTagWordAccounts(string ticket, string search, ServiceQueryOptions options)
        {
            MatchCollection mc = Regex.Matches(search, @"\w+");

            if (mc.Count == 0)
            {
                return(null);
            }

            StringBuilder query = new StringBuilder();

            query.Append("SELECT DISTINCT acct FROM Account acct, TagWordAccount twa");
            query.Append(" WHERE acct.Id = twa.AccountId AND (");
            StringBuilder subquery = new StringBuilder();

            foreach (Match m in mc)
            {
                if (subquery.Length > 0)
                {
                    subquery.Append(" OR ");
                }

                subquery.Append(string.Format("twa.TagWord.Word LIKE '%{0}%'", m.Value.ToLower()));
            }
            query.Append(subquery);
            query.Append(") ORDER BY acct.LastLogin DESC");

            return(WebServiceImpl <TransitAccount, ManagedAccount, Account> .GetList(
                       ticket, options, query.ToString()));
        }
Beispiel #60
0
        public List <TransitTagWord> GetTagWords(string ticket, TransitTagWordQueryOptions queryoptions, ServiceQueryOptions options)
        {
            StringBuilder query = new StringBuilder();

            query.Append("SELECT word FROM TagWord word LEFT JOIN word.TagWordAccounts acct");
            query.Append(" GROUP BY word.Id, word.Promoted, word.Excluded, word.Word");
            switch (queryoptions)
            {
            case TransitTagWordQueryOptions.Excluded:
                query.Append(" WHERE Excluded = 1");
                break;

            case TransitTagWordQueryOptions.New:
                query.Append(" WHERE Excluded = 0 and Promoted = 0");
                break;

            case TransitTagWordQueryOptions.Promoted:
                query.Append(" WHERE Promoted = 1");
                break;
            }
            query.Append(" ORDER BY COUNT(acct) DESC");

            return(WebServiceImpl <TransitTagWord, ManagedTagWord, TagWord> .GetList(
                       ticket, options, query.ToString()));
        }