@@ -288,30 +288,53 @@ private void LoadData(int pageId)
288
288
this . isTrusted = Utilities . IsTrusted ( ( int ) this . ForumInfo . FeatureSettings . DefaultTrustValue , this . ForumUser . TrustLevel , DotNetNuke . Modules . ActiveForums . Controllers . PermissionController . HasPerm ( this . ForumInfo . Security . Trust , this . ForumUser . UserRoles ) ) ;
289
289
290
290
// TODO: Eventually this will use DAL2 to load from stored procedure into object model, but for now populate topic object model from stored procedure results
291
- this . topic = new DotNetNuke . Modules . ActiveForums . Entities . TopicInfo ( ) ;
292
- this . topic . Content = new DotNetNuke . Modules . ActiveForums . Entities . ContentInfo ( ) ;
293
- this . topic . TopicId = this . TopicId ;
294
- this . topic . ModuleId = this . ForumModuleId ;
295
- this . topic . PortalId = this . PortalId ;
296
- this . topic . IsPinned = Utilities . SafeConvertBool ( this . drForum [ "IsPinned" ] ) ;
297
- this . topic . IsLocked = Utilities . SafeConvertBool ( this . drForum [ "IsLocked" ] ) ;
298
- this . topic . ViewCount = Utilities . SafeConvertInt ( this . drForum [ "ViewCount" ] ) ;
299
- this . topic . ReplyCount = Utilities . SafeConvertInt ( this . drForum [ "ReplyCount" ] ) ;
300
- this . topic . TopicType = Utilities . SafeConvertInt ( this . drForum [ "TopicType" ] ) < 1
291
+ this . topic = new DotNetNuke . Modules . ActiveForums . Entities . TopicInfo
292
+ {
293
+ ModuleId = this . ForumModuleId ,
294
+ PortalId = this . PortalId ,
295
+ TopicId = this . TopicId ,
296
+ IsPinned = Utilities . SafeConvertBool ( this . drForum [ "IsPinned" ] ) ,
297
+ IsLocked = Utilities . SafeConvertBool ( this . drForum [ "IsLocked" ] ) ,
298
+ IsApproved = Utilities . SafeConvertBool ( this . drForum [ "IsApproved" ] ) ,
299
+ IsDeleted = Utilities . SafeConvertBool ( this . drForum [ "IsDeleted" ] ) ,
300
+ IsRejected = Utilities . SafeConvertBool ( this . drForum [ "IsRejected" ] ) ,
301
+ IsArchived = Utilities . SafeConvertBool ( this . drForum [ "IsArchived" ] ) ,
302
+ IsAnnounce = Utilities . SafeConvertBool ( this . drForum [ "IsAnnounce" ] ) ,
303
+ AnnounceStart = Utilities . SafeConvertDateTime ( this . drForum [ "AnnounceStart" ] ) ,
304
+ AnnounceEnd = Utilities . SafeConvertDateTime ( this . drForum [ "AnnounceEnd" ] ) ,
305
+ ViewCount = Utilities . SafeConvertInt ( this . drForum [ "ViewCount" ] ) ,
306
+ ReplyCount = Utilities . SafeConvertInt ( this . drForum [ "ReplyCount" ] ) ,
307
+ TopicType = Utilities . SafeConvertInt ( this . drForum [ "TopicType" ] ) < 1
301
308
? TopicTypes . Topic
302
- : TopicTypes . Poll ;
303
- this . topic . StatusId = Utilities . SafeConvertInt ( this . drForum [ "StatusId" ] ) ;
304
- this . topic . Rating = Utilities . SafeConvertInt ( this . drForum [ "TopicRating" ] ) ;
305
- this . topic . TopicUrl = this . drForum [ "URL" ] . ToString ( ) ;
306
- this . topic . TopicData = this . drForum [ "TopicData" ] . ToString ( ) ;
307
- this . topic . NextTopic = Utilities . SafeConvertInt ( this . drForum [ "NextTopic" ] ) ;
308
- this . topic . PrevTopic = Utilities . SafeConvertInt ( this . drForum [ "PrevTopic" ] ) ;
309
- this . topic . Content = new DotNetNuke . Modules . ActiveForums . Entities . ContentInfo ( ) ;
310
- this . topic . Content . Subject = System . Net . WebUtility . HtmlDecode ( this . drForum [ "Subject" ] . ToString ( ) ) ;
311
- this . topic . Content . Body = System . Net . WebUtility . HtmlDecode ( this . drForum [ "Body" ] . ToString ( ) ) ;
312
- this . topic . Content . AuthorId = Utilities . SafeConvertInt ( this . drForum [ "AuthorId" ] ) ;
313
- this . topic . Content . AuthorName = this . drForum [ "TopicAuthor" ] . ToString ( ) ;
314
- this . topic . Content . DateCreated = Utilities . SafeConvertDateTime ( this . drForum [ "DateCreated" ] ) ;
309
+ : TopicTypes . Poll ,
310
+ StatusId = Utilities . SafeConvertInt ( this . drForum [ "StatusId" ] ) ,
311
+ Rating = Utilities . SafeConvertInt ( this . drForum [ "TopicRating" ] ) ,
312
+ TopicIcon = this . drForum [ "TopicIcon" ] . ToString ( ) ,
313
+ Priority = Convert . ToInt32 ( this . drForum [ "Priority" ] ) ,
314
+ TopicUrl = this . drForum [ "URL" ] . ToString ( ) ,
315
+ TopicData = this . drForum [ "TopicData" ] . ToString ( ) ,
316
+ NextTopic = Utilities . SafeConvertInt ( this . drForum [ "NextTopic" ] ) ,
317
+ PrevTopic = Utilities . SafeConvertInt ( this . drForum [ "PrevTopic" ] ) ,
318
+ Content = new DotNetNuke . Modules . ActiveForums . Entities . ContentInfo
319
+ {
320
+ ModuleId = this . ForumModuleId ,
321
+ Subject = System . Net . WebUtility . HtmlDecode ( this . drForum [ "Subject" ] . ToString ( ) ) ,
322
+ Summary = System . Net . WebUtility . HtmlDecode ( this . drForum [ "Summary" ] . ToString ( ) ) ,
323
+ Body = System . Net . WebUtility . HtmlDecode ( this . drForum [ "Body" ] . ToString ( ) ) ,
324
+ AuthorId = Utilities . SafeConvertInt ( this . drForum [ "AuthorId" ] ) ,
325
+ AuthorName = this . drForum [ "TopicAuthor" ] . ToString ( ) ,
326
+ DateCreated = Utilities . SafeConvertDateTime ( this . drForum [ "DateCreated" ] ) ,
327
+ } ,
328
+ LastReply = new DotNetNuke . Modules . ActiveForums . Entities . ReplyInfo
329
+ {
330
+ TopicId = this . TopicId ,
331
+ Content = new DotNetNuke . Modules . ActiveForums . Entities . ContentInfo
332
+ {
333
+ DateCreated = Utilities . SafeConvertDateTime ( this . drForum [ "LastPostDate" ] ) ,
334
+ AuthorId = Utilities . SafeConvertInt ( this . drForum [ "LastPostAuthorId" ] ) ,
335
+ } ,
336
+ } ,
337
+ } ;
315
338
316
339
this . topic . Author = new DotNetNuke . Modules . ActiveForums . Entities . AuthorInfo ( this . PortalId , this . ForumModuleId , this . topic . Content . AuthorId ) ;
317
340
this . topic . Author . ForumUser . UserInfo . DisplayName = this . drForum [ "DisplayName" ] . ToString ( ) ;
@@ -323,11 +346,6 @@ private void LoadData(int pageId)
323
346
324
347
this . topic . Forum = this . ForumInfo ;
325
348
326
- this . topic . LastReply = new DotNetNuke . Modules . ActiveForums . Entities . ReplyInfo ( ) ;
327
- this . topic . LastReply . TopicId = this . TopicId ;
328
- this . topic . LastReply . Content = new DotNetNuke . Modules . ActiveForums . Entities . ContentInfo ( ) ;
329
- this . topic . LastReply . Content . DateCreated = Utilities . SafeConvertDateTime ( this . drForum [ "LastPostDate" ] ) ;
330
- this . topic . LastReply . Content . AuthorId = Utilities . SafeConvertInt ( this . drForum [ "LastPostAuthorId" ] ) ;
331
349
332
350
this . topic . LastReply . Author = new DotNetNuke . Modules . ActiveForums . Entities . AuthorInfo ( this . PortalId , this . ForumModuleId , this . topic . LastReply . Content . AuthorId ) ;
333
351
this . topic . LastReply . Author . ForumUser . UserInfo . DisplayName = this . drForum [ "LastPostDisplayName" ] . ToString ( ) ;
@@ -1017,13 +1035,16 @@ private string ParseContent(DataRow dr, string template, int rowcount)
1017
1035
1018
1036
var reply = new DotNetNuke . Modules . ActiveForums . Entities . ReplyInfo
1019
1037
{
1038
+ ModuleId = this . ForumModuleId ,
1039
+ PortalId = this . PortalId ,
1020
1040
ReplyId = dr . GetInt ( "ReplyId" ) ,
1021
1041
TopicId = dr . GetInt ( "TopicId" ) ,
1022
1042
StatusId = dr . GetInt ( "StatusId" ) ,
1023
1043
Topic = this . topic ,
1024
1044
ContentId = dr . GetInt ( "ContentId" ) ,
1025
1045
Content = new DotNetNuke . Modules . ActiveForums . Entities . ContentInfo
1026
1046
{
1047
+ ModuleId = this . ForumModuleId ,
1027
1048
ContentId = dr . GetInt ( "ContentId" ) ,
1028
1049
Body = System . Net . WebUtility . HtmlDecode ( dr . GetString ( "Body" ) ) ,
1029
1050
Subject = System . Net . WebUtility . HtmlDecode ( dr . GetString ( "Subject" ) ) ,
0 commit comments