コード例 #1
0
        public override void Apply(StringCriteria criteria)
        {
            if (DateStart != DateTime.MinValue)
            {
                criteria.Add(string.Format("Created >= '{0}'", DateStart));
            }

            base.Apply(criteria);
        }
コード例 #2
0
ファイル: TransitPost.cs プロジェクト: belmirojr/dblog
        public override void Apply(StringCriteria criteria)
        {
            if (!string.IsNullOrEmpty(Query))
            {
                criteria.AddJoin(string.Format("INNER JOIN FREETEXTTABLE(Post, (Title, Body), '{0}') AS KEY_TBL ON Post.Post_Id = KEY_TBL.[KEY]",
                                               Renderer.SqlEncode(Query)));
            }

            if (TopicId != 0)
            {
                criteria.Add(string.Format("EXISTS (SELECT * FROM PostTopic WHERE PostTopic.Post_Id = Post.Post_Id AND PostTopic.Topic_Id = {0})",
                                           TopicId));
            }

            if (DateStart != DateTime.MinValue)
            {
                criteria.Add(string.Format("Created >= '{0}'", DateStart));
            }

            if (DateEnd != DateTime.MaxValue)
            {
                criteria.Add(string.Format("Created <= '{0}'", DateEnd));
            }

            if (PublishedOnly)
            {
                criteria.Add("Publish = 1");
            }

            if (DisplayedOnly)
            {
                criteria.Add("Display = 1");
            }

            if (string.IsNullOrEmpty(Query))
            {
                criteria.AddOrder("Sticky", WebServiceQuerySortDirection.Descending);
            }

            base.Apply(criteria);
        }
コード例 #3
0
 protected virtual void AddCriterion(StringCriterion stringCriterion)
 {
     StringCriteria.Add(stringCriterion);
 }