public override void Apply(StringCriteria criteria) { if (DateStart != DateTime.MinValue) { criteria.Add(string.Format("Created >= '{0}'", DateStart)); } base.Apply(criteria); }
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); }
protected virtual void AddCriterion(StringCriterion stringCriterion) { StringCriteria.Add(stringCriterion); }