Permalink
Browse files

Port to LLBLGen Pro v3.5

Converted several queries to queryspec. Not done yet.
  • Loading branch information...
Solutionsdesign
Solutionsdesign committed Jun 6, 2012
1 parent d31bd7b commit b11b88589112aae8080da2308a760ae5b8158112
Showing with 788 additions and 813 deletions.
  1. +68 −95 BL/ForumGuiHelper.cs
  2. +2 −2 BL/Globals.cs
  3. +47 −63 BL/MessageGuiHelper.cs
  4. +17 −15 BL/MessageManager.cs
  5. +5 −1 BL/SD.HnD.BL.csproj
  6. +1 −1 DAL/CollectionClasses/ActionRightCollection.cs
  7. +1 −1 DAL/CollectionClasses/AttachmentCollection.cs
  8. +1 −1 DAL/CollectionClasses/AuditActionCollection.cs
  9. +1 −1 DAL/CollectionClasses/AuditDataCoreCollection.cs
  10. +1 −1 DAL/CollectionClasses/AuditDataMessageRelatedCollection.cs
  11. +1 −1 DAL/CollectionClasses/AuditDataThreadRelatedCollection.cs
  12. +1 −1 DAL/CollectionClasses/BookmarkCollection.cs
  13. +1 −1 DAL/CollectionClasses/ForumCollection.cs
  14. +1 −1 DAL/CollectionClasses/ForumRoleForumActionRightCollection.cs
  15. +1 −1 DAL/CollectionClasses/IPBanCollection.cs
  16. +1 −1 DAL/CollectionClasses/MessageCollection.cs
  17. +1 −1 DAL/CollectionClasses/RoleAuditActionCollection.cs
  18. +1 −1 DAL/CollectionClasses/RoleCollection.cs
  19. +1 −1 DAL/CollectionClasses/RoleSystemActionRightCollection.cs
  20. +1 −1 DAL/CollectionClasses/RoleUserCollection.cs
  21. +1 −1 DAL/CollectionClasses/SectionCollection.cs
  22. +1 −1 DAL/CollectionClasses/SupportQueueCollection.cs
  23. +1 −1 DAL/CollectionClasses/SupportQueueThreadCollection.cs
  24. +1 −1 DAL/CollectionClasses/SystemDataCollection.cs
  25. +1 −1 DAL/CollectionClasses/ThreadCollection.cs
  26. +1 −1 DAL/CollectionClasses/ThreadSubscriptionCollection.cs
  27. +1 −1 DAL/CollectionClasses/UserCollection.cs
  28. +1 −1 DAL/CollectionClasses/UserTitleCollection.cs
  29. +1 −1 DAL/ConstantsEnums.cs
  30. +1 −1 DAL/DaoClasses/ActionRightDAO.cs
  31. +1 −1 DAL/DaoClasses/AttachmentDAO.cs
  32. +1 −1 DAL/DaoClasses/AuditActionDAO.cs
  33. +1 −1 DAL/DaoClasses/AuditDataCoreDAO.cs
  34. +1 −1 DAL/DaoClasses/AuditDataMessageRelatedDAO.cs
  35. +1 −1 DAL/DaoClasses/AuditDataThreadRelatedDAO.cs
  36. +1 −1 DAL/DaoClasses/BookmarkDAO.cs
  37. +2 −3 DAL/DaoClasses/CommonDaoBase.cs
  38. +1 −1 DAL/DaoClasses/ForumDAO.cs
  39. +1 −1 DAL/DaoClasses/ForumRoleForumActionRightDAO.cs
  40. +1 −1 DAL/DaoClasses/IPBanDAO.cs
  41. +1 −1 DAL/DaoClasses/MessageDAO.cs
  42. +1 −1 DAL/DaoClasses/RoleAuditActionDAO.cs
  43. +1 −1 DAL/DaoClasses/RoleDAO.cs
  44. +1 −1 DAL/DaoClasses/RoleSystemActionRightDAO.cs
  45. +1 −1 DAL/DaoClasses/RoleUserDAO.cs
  46. +1 −1 DAL/DaoClasses/SectionDAO.cs
  47. +1 −1 DAL/DaoClasses/SupportQueueDAO.cs
  48. +1 −1 DAL/DaoClasses/SupportQueueThreadDAO.cs
  49. +1 −1 DAL/DaoClasses/SystemDataDAO.cs
  50. +1 −1 DAL/DaoClasses/ThreadDAO.cs
  51. +1 −1 DAL/DaoClasses/ThreadSubscriptionDAO.cs
  52. +1 −1 DAL/DaoClasses/TypedListDAO.cs
  53. +1 −1 DAL/DaoClasses/UserDAO.cs
  54. +1 −1 DAL/DaoClasses/UserTitleDAO.cs
  55. +9 −17 DAL/EntityBaseClasses/ActionRightEntityBase.cs
  56. +10 −18 DAL/EntityBaseClasses/AttachmentEntityBase.cs
  57. +9 −17 DAL/EntityBaseClasses/AuditActionEntityBase.cs
  58. +11 −19 DAL/EntityBaseClasses/AuditDataCoreEntityBase.cs
  59. +12 −16 DAL/EntityBaseClasses/AuditDataMessageRelatedEntityBase.cs
  60. +12 −16 DAL/EntityBaseClasses/AuditDataThreadRelatedEntityBase.cs
  61. +11 −19 DAL/EntityBaseClasses/BookmarkEntityBase.cs
  62. +11 −19 DAL/EntityBaseClasses/ForumEntityBase.cs
  63. +12 −20 DAL/EntityBaseClasses/ForumRoleForumActionRightEntityBase.cs
  64. +10 −18 DAL/EntityBaseClasses/IPBanEntityBase.cs
  65. +11 −19 DAL/EntityBaseClasses/MessageEntityBase.cs
  66. +11 −19 DAL/EntityBaseClasses/RoleAuditActionEntityBase.cs
  67. +9 −17 DAL/EntityBaseClasses/RoleEntityBase.cs
  68. +11 −19 DAL/EntityBaseClasses/RoleSystemActionRightEntityBase.cs
  69. +11 −19 DAL/EntityBaseClasses/RoleUserEntityBase.cs
  70. +9 −17 DAL/EntityBaseClasses/SectionEntityBase.cs
  71. +9 −17 DAL/EntityBaseClasses/SupportQueueEntityBase.cs
  72. +13 −21 DAL/EntityBaseClasses/SupportQueueThreadEntityBase.cs
  73. +11 −19 DAL/EntityBaseClasses/SystemDataEntityBase.cs
  74. +12 −20 DAL/EntityBaseClasses/ThreadEntityBase.cs
  75. +11 −19 DAL/EntityBaseClasses/ThreadSubscriptionEntityBase.cs
  76. +10 −18 DAL/EntityBaseClasses/UserEntityBase.cs
  77. +9 −17 DAL/EntityBaseClasses/UserTitleEntityBase.cs
  78. +1 −1 DAL/EntityClasses/ActionRightEntity.cs
  79. +1 −1 DAL/EntityClasses/AttachmentEntity.cs
  80. +1 −1 DAL/EntityClasses/AuditActionEntity.cs
  81. +1 −1 DAL/EntityClasses/AuditDataCoreEntity.cs
  82. +1 −1 DAL/EntityClasses/AuditDataMessageRelatedEntity.cs
  83. +1 −1 DAL/EntityClasses/AuditDataThreadRelatedEntity.cs
  84. +1 −1 DAL/EntityClasses/BookmarkEntity.cs
  85. +6 −1 DAL/EntityClasses/CommonEntityBase.cs
  86. +1 −1 DAL/EntityClasses/ForumEntity.cs
  87. +1 −1 DAL/EntityClasses/ForumRoleForumActionRightEntity.cs
  88. +1 −1 DAL/EntityClasses/IPBanEntity.cs
  89. +1 −1 DAL/EntityClasses/MessageEntity.cs
  90. +1 −1 DAL/EntityClasses/RoleAuditActionEntity.cs
  91. +1 −1 DAL/EntityClasses/RoleEntity.cs
  92. +1 −1 DAL/EntityClasses/RoleSystemActionRightEntity.cs
  93. +1 −1 DAL/EntityClasses/RoleUserEntity.cs
  94. +1 −1 DAL/EntityClasses/SectionEntity.cs
  95. +1 −1 DAL/EntityClasses/SupportQueueEntity.cs
  96. +1 −1 DAL/EntityClasses/SupportQueueThreadEntity.cs
  97. +1 −1 DAL/EntityClasses/SystemDataEntity.cs
  98. +1 −1 DAL/EntityClasses/ThreadEntity.cs
  99. +1 −1 DAL/EntityClasses/ThreadSubscriptionEntity.cs
  100. +1 −1 DAL/EntityClasses/UserEntity.cs
  101. +1 −1 DAL/EntityClasses/UserTitleEntity.cs
  102. +1 −1 DAL/FactoryClasses/DaoFactory.cs
  103. +1 −1 DAL/FactoryClasses/EntityFactories.cs
  104. +1 −1 DAL/FactoryClasses/EntityFieldFactory.cs
  105. +1 −1 DAL/FactoryClasses/EntityFieldsFactory.cs
  106. +237 −0 DAL/FactoryClasses/QueryFactory.cs
  107. +1 −1 DAL/HelperClasses/FieldCreationClasses.cs
  108. +1 −1 DAL/HelperClasses/FieldInfoProvider.cs
  109. +1 −1 DAL/HelperClasses/InheritanceInfoProvider.cs
  110. +24 −24 DAL/HelperClasses/PersistenceInfoProvider.cs
  111. +1 −1 DAL/HelperClasses/ResultsetFields.cs
  112. +1 −1 DAL/HelperClasses/Transaction.cs
  113. +0 −50 DAL/HelperClasses/TransactionComPlus.cs
  114. +1 −1 DAL/HelperClasses/TypeDefaultValue.cs
  115. +1 −1 DAL/Linq/LinqMetaData.cs
  116. +1 −1 DAL/RelationClasses/ActionRightRelations.cs
  117. +1 −1 DAL/RelationClasses/AttachmentRelations.cs
  118. +1 −1 DAL/RelationClasses/AuditActionRelations.cs
  119. +1 −1 DAL/RelationClasses/AuditDataCoreRelations.cs
  120. +1 −1 DAL/RelationClasses/AuditDataMessageRelatedRelations.cs
  121. +1 −1 DAL/RelationClasses/AuditDataThreadRelatedRelations.cs
  122. +1 −1 DAL/RelationClasses/BookmarkRelations.cs
  123. +1 −1 DAL/RelationClasses/DynamicRelation.cs
  124. +1 −1 DAL/RelationClasses/ForumRelations.cs
  125. +1 −1 DAL/RelationClasses/ForumRoleForumActionRightRelations.cs
  126. +1 −1 DAL/RelationClasses/IPBanRelations.cs
  127. +1 −1 DAL/RelationClasses/MessageRelations.cs
  128. +1 −1 DAL/RelationClasses/RoleAuditActionRelations.cs
  129. +1 −1 DAL/RelationClasses/RoleRelations.cs
  130. +1 −1 DAL/RelationClasses/RoleSystemActionRightRelations.cs
  131. +1 −1 DAL/RelationClasses/RoleUserRelations.cs
  132. +1 −1 DAL/RelationClasses/SectionRelations.cs
  133. +1 −1 DAL/RelationClasses/SupportQueueRelations.cs
  134. +1 −1 DAL/RelationClasses/SupportQueueThreadRelations.cs
  135. +1 −1 DAL/RelationClasses/SystemDataRelations.cs
  136. +1 −1 DAL/RelationClasses/ThreadRelations.cs
  137. +1 −1 DAL/RelationClasses/ThreadSubscriptionRelations.cs
  138. +1 −1 DAL/RelationClasses/UserRelations.cs
  139. +1 −1 DAL/RelationClasses/UserTitleRelations.cs
  140. +10 −6 DAL/SD.HnD.DAL.csproj
  141. +1 −1 DAL/StoredProcedureCallerClasses/ActionProcedures.cs
  142. +1 −1 DAL/StoredProcedureCallerClasses/RetrievalProcedures.cs
  143. +2 −5 DAL/TypedListClasses/ForumMessagesTypedList.cs
  144. +2 −5 DAL/TypedListClasses/ForumsWithSectionNameTypedList.cs
  145. +2 −5 DAL/TypedListClasses/MessagesInThreadTypedList.cs
  146. +2 −5 DAL/TypedListClasses/SearchResultTypedList.cs
  147. +1 −1 GUI/Admin/ManageIPBans.aspx
  148. +1 −1 GUI/Admin/ManageSupportQueues.aspx
  149. +2 −0 GUI/Global.asax
  150. +1 −1 GUI/MoveThread.aspx
  151. +5 −2 LLBLGenPro Projects/HnD.llblgenproj
  152. BIN RuntimeLibraries/SD.LLBLGen.Pro.DQE.SqlServer.NET20.dll
  153. BIN RuntimeLibraries/SD.LLBLGen.Pro.LinqSupportClasses.NET35.dll
  154. BIN RuntimeLibraries/SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll
  155. BIN RuntimeLibraries/SD.LLBLGen.Pro.ORMSupportClasses.Web.dll
  156. BIN RuntimeLibraries/SD.LLBLGen.Pro.QuerySpec.dll
View
@@ -24,6 +24,8 @@
using System.Collections.Generic;
using SD.LLBLGen.Pro.ORMSupportClasses;
using SD.LLBLGen.Pro.QuerySpec;
using SD.LLBLGen.Pro.QuerySpec.SelfServicing;
using SD.HnD.DAL.CollectionClasses;
using SD.HnD.DAL.TypedListClasses;
using SD.HnD.DAL.FactoryClasses;
@@ -49,12 +51,8 @@ public class ForumGuiHelper
public static ForumMessagesTypedList GetLastPostedMessagesInForum(int amount, int forumID)
{
ForumMessagesTypedList forumMessages = new ForumMessagesTypedList();
PredicateExpression filter = new PredicateExpression();
filter.Add( (ForumFields.ForumID == forumID));
filter.AddWithAnd((ForumFields.HasRSSFeed == true));
SortExpression sorter = new SortExpression(MessageFields.PostingDate | SortOperator.Descending);
forumMessages.Fill(amount, sorter, false, filter);
forumMessages.Fill(amount, new SortExpression(MessageFields.PostingDate.Ascending()), false,
(ForumFields.ForumID == forumID).And(ForumFields.HasRSSFeed == true));
return forumMessages;
}
@@ -111,33 +109,22 @@ public static ForumMessagesTypedList GetLastPostedMessagesInForum(int amount, in
// Set up query conditions using Predicate Expressions
// we'll keep the sticky threads filter and the forum filter in separate variables as we'll re-use them later on.
FieldCompareValuePredicate stickyThreadsFilter = (FieldCompareValuePredicate)(ThreadFields.IsSticky == true);
FieldCompareValuePredicate forumFilter = (FieldCompareValuePredicate)(ThreadFields.ForumID == forumID);
PredicateExpression filter = new PredicateExpression();
filter.Add(forumFilter);
// combine the following two predicates into one predicate expression, as either one of them has to be true, but as a whole combined they should
// act as a single operator to the AND operator with the forumfilter.
PredicateExpression messageLimiterSubFilter = new PredicateExpression();
messageLimiterSubFilter.Add(stickyThreadsFilter);
messageLimiterSubFilter.AddWithOr(ThreadFields.ThreadLastPostingDate >= limiterDate);
filter.AddWithAnd(messageLimiterSubFilter);
var forumFilter = ThreadFields.ForumID == forumID;
var filter = forumFilter.And(stickyThreadsFilter.Or(ThreadFields.ThreadLastPostingDate >= limiterDate));
// if the user can't view threads started by others, filter out threads started by users different from userID
if(!canViewNormalThreadsStartedByOthers)
{
// caller can't view threads started by others: add a filter so that threads not started by calling user aren't enlisted.
// however sticky threads are always returned so the filter contains a check so the limit is only applied on threads which aren't sticky
PredicateExpression threadsByOthersFilter = new PredicateExpression();
threadsByOthersFilter.Add(ThreadFields.StartedByUserID==userID);
// add a filter for sticky threads, add it with 'OR', so sticky threads are always accepted
threadsByOthersFilter.AddWithOr(ThreadFields.IsSticky == true);
filter.AddWithAnd(threadsByOthersFilter);
filter.AddWithAnd((ThreadFields.StartedByUserID == userID).Or(ThreadFields.IsSticky == true));
}
//Set up the sort expressions
SortExpression sorter = new SortExpression(ThreadFields.IsSticky | SortOperator.Descending);
sorter.Add(ThreadFields.IsClosed | SortOperator.Ascending);
sorter.Add(ThreadFields.ThreadLastPostingDate | SortOperator.Descending);
SortExpression sorter = new SortExpression(ThreadFields.IsSticky.Descending());
sorter.Add(ThreadFields.IsClosed.Ascending());
sorter.Add(ThreadFields.ThreadLastPostingDate.Descending());
DataTable threads = new DataTable();
TypedListDAO dao = new TypedListDAO();
@@ -154,17 +141,16 @@ public static ForumMessagesTypedList GetLastPostedMessagesInForum(int amount, in
threads = new DataTable();
// first fetch the sticky threads.
filter = new PredicateExpression();
filter.Add(forumFilter);
filter.AddWithAnd(stickyThreadsFilter);
sorter = new SortExpression(ThreadFields.ThreadLastPostingDate | SortOperator.Descending);
filter = forumFilter.And(stickyThreadsFilter);
sorter = new SortExpression(ThreadFields.ThreadLastPostingDate.Descending());
dao.GetMultiAsDataTable(fields, threads, 0, sorter, filter, relations, true, null, null, 0, 0);
// then fetch the rest. Fetch it into the same datatable object to append the rows to the already fetched sticky threads (if any)
stickyThreadsFilter.Value=false;
dao.GetMultiAsDataTable(fields, threads, minNumberOfThreadsToFetch, sorter, filter, relations, true, null, null, 0, 0);
// sort closed threads to the bottom.
// sort closed threads to the bottom. Do this in-memory as it's a sort operation after projection. Doing it on the server would mean
// a sort operation before projection.
return new DataView(threads, string.Empty, ThreadFieldIndex.IsClosed.ToString() + " ASC", DataViewRowState.CurrentRows);
}
else
@@ -181,14 +167,11 @@ public static ForumMessagesTypedList GetLastPostedMessagesInForum(int amount, in
public static ForumsWithSectionNameTypedList GetAllForumsWithSectionNames()
{
ForumsWithSectionNameTypedList toReturn = new ForumsWithSectionNameTypedList();
SortExpression sorter = new SortExpression();
sorter.Add(SectionFields.OrderNo | SortOperator.Ascending);
sorter.Add(SectionFields.SectionName | SortOperator.Ascending);
sorter.Add(ForumFields.OrderNo| SortOperator.Ascending);
sorter.Add(ForumFields.ForumName | SortOperator.Ascending);
SortExpression sorter = new SortExpression(SectionFields.OrderNo.Ascending());
sorter.Add(SectionFields.SectionName.Ascending());
sorter.Add(ForumFields.OrderNo.Ascending());
sorter.Add(ForumFields.ForumName.Ascending());
toReturn.Fill(0, sorter);
return toReturn;
}
@@ -200,15 +183,11 @@ public static ForumsWithSectionNameTypedList GetAllForumsWithSectionNames()
/// <returns>Entity collection with entities for all forums in this section sorted alphabitacally</returns>
public static ForumCollection GetAllForumsInSection(int sectionID)
{
//create the filter with the ID passed to the method.
PredicateExpression filter = new PredicateExpression(ForumFields.SectionID == sectionID);
// Sort forums on orderno ascending, then on name alphabetically
SortExpression sorter = new SortExpression(ForumFields.OrderNo | SortOperator.Ascending);
sorter.Add(ForumFields.ForumName | SortOperator.Ascending);
ForumCollection toReturn = new ForumCollection();
toReturn.GetMulti(filter, 0, sorter);
var q = new QueryFactory().Forum
.Where(ForumFields.SectionID == sectionID)
.OrderBy(ForumFields.OrderNo.Ascending(), ForumFields.ForumName.Ascending());
var toReturn = new ForumCollection();
toReturn.GetMulti(q);
return toReturn;
}
@@ -240,6 +219,7 @@ public static ForumCollection GetAllForumsInSection(int sectionID)
// fetch all forums with statistics in a dynamic list, while filtering on the list of accessable forums for this user.
// Also filter on the threads viewable by the passed in userid, which is the caller of the method. If a forum isn't in the list of
// forumsWithThreadsFromOthers, only the sticky threads and the threads started by userid should be counted / taken into account.
// Create the filter separate of the query itself, as it's re-used multiple times.
PredicateExpression threadFilter = new PredicateExpression();
if((forumsWithThreadsFromOthers!=null) && (forumsWithThreadsFromOthers.Count > 0))
{
@@ -262,65 +242,58 @@ public static ForumCollection GetAllForumsInSection(int sectionID)
onlyOwnThreadsFilter.Add(ThreadFields.ForumID != forumsWithThreadsFromOthers);
}
// the filter on either sticky or threads started by the calling user
onlyOwnThreadsFilter.AddWithAnd(new PredicateExpression(ThreadFields.IsSticky == true)
.AddWithOr(ThreadFields.StartedByUserID==userID));
onlyOwnThreadsFilter.AddWithAnd((ThreadFields.IsSticky == true).Or(ThreadFields.StartedByUserID==userID));
threadFilter.AddWithOr(onlyOwnThreadsFilter);
}
else
{
// there are no forums enlisted in which the user has the right to view threads from others. So just filter on
// sticky threads or threads started by the calling user.
threadFilter.Add(new PredicateExpression(ThreadFields.IsSticky == true)
.AddWithOr(ThreadFields.StartedByUserID == userID));
threadFilter.Add((ThreadFields.IsSticky == true).Or(ThreadFields.StartedByUserID == userID));
}
ResultsetFields fields = new ResultsetFields(8);
fields.DefineField(ForumFields.ForumID, 0);
fields.DefineField(ForumFields.ForumName, 1);
fields.DefineField(ForumFields.ForumDescription, 2);
fields.DefineField(ForumFields.ForumLastPostingDate, 3);
// add a scalar query which retrieves the # of threads in the specific forum. Utilizes an index on the FK field to forum in thread
// this will result in the query:
// (
// SELECT COUNT(ThreadID) FROM Thread
// WHERE ForumID = Forum.ForumID AND threadfilter.
// ) As AmountThreads
fields.DefineField(new EntityField("AmountThreads",
new ScalarQueryExpression(ThreadFields.ThreadID.SetAggregateFunction(AggregateFunction.Count),
new PredicateExpression(ThreadFields.ForumID == ForumFields.ForumID).AddWithAnd(threadFilter))), 4);
// add a scalar query which retrieves the # of messages in the threads of this forum. Utilizies an index on the FK field in thread to forum.
// this will result in the query:
// (
// SELECT COUNT(MessageID) FROM Message
// WHERE ThreadID IN
// (
// SELECT ThreadID FROM Thread WHERE ForumID = Forum.ForumID AND threadfilter
// )
// ) AS AmountMessages
fields.DefineField(new EntityField("AmountMessages",
new ScalarQueryExpression(MessageFields.MessageID.SetAggregateFunction(AggregateFunction.Count),
new FieldCompareSetPredicate(
MessageFields.ThreadID, // field to compare with the results in the IN clause
ThreadFields.ThreadID, // field to select in the select inside the IN clause
SetOperator.In, // operator,
new PredicateExpression(ThreadFields.ForumID == ForumFields.ForumID).AddWithAnd(threadFilter) // the filter for the subquery inside the IN clause
))), 5); // rest of the DefineField method.
fields.DefineField(ForumFields.HasRSSFeed, 6);
fields.DefineField(ForumFields.SectionID, 7);
DataTable results = new DataTable();
TypedListDAO dao = new TypedListDAO();
// sort per section: orderno and name, then per forum: orderno and name, so the views are already sorted automatically.
SortExpression sorter = new SortExpression();
sorter.Add(ForumFields.OrderNo | SortOperator.Ascending);
sorter.Add(ForumFields.ForumName | SortOperator.Ascending);
// use a field compare range predicate to filter on the forums accessable to the user
dao.GetMultiAsDataTable(fields, results, 0, sorter, (ForumFields.ForumID == accessableForums), null, true, null, null, 0, 0);
// Now per section create a new DataView in memory using in-memory filtering on the DataTable.
var qf = new QueryFactory();
var q = qf.Create()
.Select(ForumFields.ForumID,
ForumFields.ForumName,
ForumFields.ForumDescription,
ForumFields.ForumLastPostingDate,
// add a scalar query which retrieves the # of threads in the specific forum.
// this will result in the query:
// (
// SELECT COUNT(ThreadID) FROM Thread
// WHERE ForumID = Forum.ForumID AND threadfilter.
// ) As AmountThreads
qf.Create()
.Select(ThreadFields.ThreadID.Count())
.CorrelatedOver(ThreadFields.ForumID == ForumFields.ForumID)
.Where(threadFilter)
.ToScalar().As("AmountThreads"),
// add a scalar query which retrieves the # of messages in the threads of this forum.
// this will result in the query:
// (
// SELECT COUNT(MessageID) FROM Message
// WHERE ThreadID IN
// (
// SELECT ThreadID FROM Thread WHERE ForumID = Forum.ForumID AND threadfilter
// )
// ) AS AmountMessages
qf.Create()
.Select(MessageFields.MessageID.Count())
.Where(MessageFields.ThreadID.In(
qf.Create()
.Select(ThreadFields.ThreadID)
.CorrelatedOver(ThreadFields.ForumID == ForumFields.ForumID)
.Where(threadFilter)))
.ToScalar().As("AmountMessages"),
ForumFields.HasRSSFeed,
ForumFields.SectionID)
.Where(ForumFields.ForumID == accessableForums)
.OrderBy(ForumFields.OrderNo.Ascending(), ForumFields.ForumName.Ascending());
var results = new TypedListDAO().FetchAsDataTable(q);
// Now per section create a new DataView in memory using in-memory filtering on the DataTable.
foreach(SectionEntity section in availableSections)
{
// Create view for current section and filter out rows we don't want. Do this with in-memory filtering of the dataview, so we don't
View
@@ -29,11 +29,11 @@ public static class Globals
/// <summary>
/// Version of HnD
/// </summary>
public static readonly string Version = "2.1";
public static readonly string Version = "3.5";
/// <summary>
/// Build of HnD
/// </summary>
public static readonly string Build = "09082011";
public static readonly string Build = "06062012";
/// <summary>
/// Release type of this version
/// </summary>
Oops, something went wrong.

0 comments on commit b11b885

Please sign in to comment.