Example #1
0
        // Token: 0x06000772 RID: 1906 RVA: 0x00033044 File Offset: 0x00031244
        protected override SqlCommand ComposeSelectCollectionCommand(NotificationItemFilter filter)
        {
            SqlCommand sqlCommand = new SqlCommand("SELECT{0} * FROM NotificationBlogs LEFT JOIN NotificationItems ON \r\n                                         NotificationBlogs.BlogID = NotificationItems.NotificationID");
            SqlCommand result;

            try
            {
                StringBuilder stringBuilder = new StringBuilder();
                if (!filter.IncludeAcknowledged)
                {
                    SqlHelper.AddCondition(stringBuilder, "AcknowledgedAt IS NULL", "AND");
                }
                if (!filter.IncludeIgnored)
                {
                    SqlHelper.AddCondition(stringBuilder, "Ignored=0", "AND");
                }
                BlogFilter blogFilter = filter as BlogFilter;
                if (blogFilter != null && blogFilter.MaxResults > 0)
                {
                    sqlCommand.CommandText = string.Format(sqlCommand.CommandText, " TOP " + blogFilter.MaxResults);
                }
                else
                {
                    sqlCommand.CommandText = string.Format(sqlCommand.CommandText, string.Empty);
                }
                SqlCommand sqlCommand2 = sqlCommand;
                sqlCommand2.CommandText += stringBuilder.ToString();
                SqlCommand sqlCommand3 = sqlCommand;
                sqlCommand3.CommandText += " ORDER BY PublicationDate DESC";
                result = sqlCommand;
            }
            catch (Exception ex)
            {
                sqlCommand.Dispose();
                BlogItemDAL.log.Error(string.Format("Error while composing SELECT SQL command for {0} collection: ", base.GetType().Name) + ex.ToString());
                throw;
            }
            return(result);
        }
Example #2
0
 // Token: 0x06000778 RID: 1912 RVA: 0x00033362 File Offset: 0x00031562
 public static ICollection <BlogItemDAL> GetItems(BlogFilter filter)
 {
     return(NotificationItemDAL.GetItems <BlogItemDAL>(filter));
 }