diff --git a/Components/ArticleController.vb b/Components/ArticleController.vb index 75f6f34..3888247 100755 --- a/Components/ArticleController.vb +++ b/Components/ArticleController.vb @@ -30,7 +30,7 @@ Namespace Ventrian.NewsArticles Dim objArticles As New List(Of ArticleInfo) While dr.Read - objArticles.Add(CType(CBO.FillObject(dr, GetType(ArticleInfo), False), ArticleInfo)) + objArticles.Add(CBO.FillObject(Of ArticleInfo)(dr, False)) End While Dim nextResult As Boolean = dr.NextResult() @@ -124,7 +124,7 @@ Namespace Ventrian.NewsArticles Dim objArticle As ArticleInfo = CType(DataCache.GetCache(cacheKey), ArticleInfo) If (objArticle Is Nothing) Then - objArticle = CType(CBO.FillObject(DataProvider.Instance().GetArticle(articleID), GetType(ArticleInfo)), ArticleInfo) + objArticle = CBO.FillObject(Of ArticleInfo)(DataProvider.Instance().GetArticle(articleID)) If (objArticle Is Nothing) Then Return Nothing End If diff --git a/Components/CommentController.vb b/Components/CommentController.vb index b355b9c..b6e701d 100755 --- a/Components/CommentController.vb +++ b/Components/CommentController.vb @@ -56,7 +56,7 @@ Namespace Ventrian.NewsArticles Public Function GetComment(ByVal commentID As Integer) As CommentInfo - Return CType(CBO.FillObject(DataProvider.Instance().GetComment(commentID), GetType(CommentInfo)), CommentInfo) + Return CBO.FillObject(Of CommentInfo)(DataProvider.Instance().GetComment(commentID)) End Function diff --git a/Components/Controllers/PageController.vb b/Components/Controllers/PageController.vb index 9e4ff43..23a2e55 100755 --- a/Components/Controllers/PageController.vb +++ b/Components/Controllers/PageController.vb @@ -20,7 +20,7 @@ Namespace Ventrian.NewsArticles Public Function GetPage(ByVal pageId As Integer) As PageInfo - Return CType(CBO.FillObject(DataProvider.Instance().GetPage(pageId), GetType(PageInfo)), PageInfo) + Return CBO.FillObject(Of PageInfo)(DataProvider.Instance().GetPage(pageId)) End Function diff --git a/Components/CustomFields/CustomFieldController.vb b/Components/CustomFields/CustomFieldController.vb index ad1cbbe..7d8bd05 100755 --- a/Components/CustomFields/CustomFieldController.vb +++ b/Components/CustomFields/CustomFieldController.vb @@ -14,7 +14,7 @@ Namespace Ventrian.NewsArticles.Components.CustomFields Public Function [Get](ByVal customFieldID As Integer) As CustomFieldInfo - Return CType(CBO.FillObject(DataProvider.Instance().GetCustomField(customFieldID), GetType(CustomFieldInfo)), CustomFieldInfo) + Return CBO.FillObject(Of CustomFieldInfo)(DataProvider.Instance().GetCustomField(customFieldID)) End Function diff --git a/Components/Handout/HandoutController.vb b/Components/Handout/HandoutController.vb index 6586525..80a2ce8 100755 --- a/Components/Handout/HandoutController.vb +++ b/Components/Handout/HandoutController.vb @@ -27,7 +27,7 @@ Namespace Ventrian.NewsArticles Public Function GetHandout(ByVal handoutID As Integer) As HandoutInfo - Dim objHandout As HandoutInfo = CType(CBO.FillObject(DataProvider.Instance().GetHandout(handoutID), GetType(HandoutInfo)), HandoutInfo) + Dim objHandout As HandoutInfo = CBO.FillObject(Of HandoutInfo)(DataProvider.Instance().GetHandout(handoutID)) objHandout.Articles = CBO.FillCollection(Of HandoutArticle)(DataProvider.Instance().GetHandoutArticleList(handoutID)) diff --git a/Components/ImageController.vb b/Components/ImageController.vb index f951782..02c999b 100755 --- a/Components/ImageController.vb +++ b/Components/ImageController.vb @@ -8,7 +8,7 @@ Namespace Ventrian.NewsArticles Public Function [Get](ByVal imageID As Integer) As ImageInfo - Return CType(CBO.FillObject(DataProvider.Instance().GetImage(imageID), GetType(ImageInfo)), ImageInfo) + Return CBO.FillObject(Of ImageInfo)(DataProvider.Instance().GetImage(imageID)) End Function diff --git a/Components/Import/FeedController.vb b/Components/Import/FeedController.vb index 52529c5..8a7a9d8 100755 --- a/Components/Import/FeedController.vb +++ b/Components/Import/FeedController.vb @@ -8,7 +8,7 @@ Namespace Ventrian.NewsArticles.Import Public Function [Get](ByVal feedID As Integer) As FeedInfo - Return CType(CBO.FillObject(DataProvider.Instance().GetFeed(feedID), GetType(FeedInfo)), FeedInfo) + Return CBO.FillObject(Of FeedInfo)(DataProvider.Instance().GetFeed(feedID)) End Function diff --git a/Components/MirrorArticleController.vb b/Components/MirrorArticleController.vb index fc5fcd0..0be606a 100755 --- a/Components/MirrorArticleController.vb +++ b/Components/MirrorArticleController.vb @@ -24,7 +24,7 @@ Namespace Ventrian.NewsArticles Public Function GetMirrorArticle(ByVal articleID As Integer) As MirrorArticleInfo - Return CType(CBO.FillObject(DataProvider.Instance().GetMirrorArticle(articleID), GetType(MirrorArticleInfo)), MirrorArticleInfo) + Return CBO.FillObject(Of MirrorArticleInfo)(DataProvider.Instance().GetMirrorArticle(articleID)) End Function diff --git a/Components/MirrorArticleInfo.vb b/Components/MirrorArticleInfo.vb index 3a647b1..24cab50 100755 --- a/Components/MirrorArticleInfo.vb +++ b/Components/MirrorArticleInfo.vb @@ -6,6 +6,7 @@ Imports System Imports System.Data +Imports System.Linq Imports DotNetNuke Imports DotNetNuke.Common.Utilities @@ -83,11 +84,10 @@ Namespace Ventrian.NewsArticles If (objPortal IsNot Nothing) Then _portalName = objPortal.PortalName - Dim o As New PortalAliasController - Dim portalAliases As ArrayList = o.GetPortalAliasArrayByPortalID(_linkedPortalID) + Dim portalAliases As IEnumerable(Of PortalAliasInfo) = PortalAliasController.Instance.GetPortalAliasesByPortalId(_linkedPortalID) If (portalAliases.Count > 0) Then - _portalName = DotNetNuke.Common.AddHTTP(CType(portalAliases(0), PortalAliasInfo).HTTPAlias) + _portalName = DotNetNuke.Common.AddHTTP(portalAliases(0).HTTPAlias) End If End If End If diff --git a/Components/RatingController.vb b/Components/RatingController.vb index 621344c..bb59a1c 100755 --- a/Components/RatingController.vb +++ b/Components/RatingController.vb @@ -56,7 +56,7 @@ Namespace Ventrian.NewsArticles Dim objRating As RatingInfo = CType(DataCache.GetCache(cacheKey), RatingInfo) If (objRating Is Nothing) Then - objRating = CType(CBO.FillObject(DataProvider.Instance().GetRating(articleID, userID), GetType(RatingInfo)), RatingInfo) + objRating = CBO.FillObject(Of RatingInfo)(DataProvider.Instance().GetRating(articleID, userID)) If (objRating IsNot Nothing) Then DataCache.SetCache(cacheKey, objRating) Else @@ -77,7 +77,7 @@ Namespace Ventrian.NewsArticles Dim objRating As RatingInfo = CType(DataCache.GetCache(cacheKey), RatingInfo) If (objRating Is Nothing) Then - objRating = CType(CBO.FillObject(DataProvider.Instance().GetRatingByID(ratingID), GetType(RatingInfo)), RatingInfo) + objRating = CBO.FillObject(Of RatingInfo)(DataProvider.Instance().GetRatingByID(ratingID)) DataCache.SetCache(cacheKey, objRating) End If diff --git a/Components/TagController.vb b/Components/TagController.vb index 6a7c587..5e24869 100755 --- a/Components/TagController.vb +++ b/Components/TagController.vb @@ -30,7 +30,7 @@ Namespace Ventrian.NewsArticles Public Function [Get](ByVal tagID As Integer) As TagInfo - Return CType(CBO.FillObject(DataProvider.Instance().GetTag(tagID), GetType(TagInfo)), TagInfo) + Return CBO.FillObject(Of TagInfo)(DataProvider.Instance().GetTag(tagID)) End Function @@ -39,7 +39,7 @@ Namespace Ventrian.NewsArticles Dim objTag As TagInfo = CType(DataCache.GetCache("Tag-" & moduleID.ToString() & "-" & nameLowered), TagInfo) If (objTag Is Nothing) Then - objTag = CType(CBO.FillObject(DataProvider.Instance().GetTagByName(moduleID, nameLowered), GetType(TagInfo)), TagInfo) + objTag = CBO.FillObject(Of TagInfo)(DataProvider.Instance().GetTagByName(moduleID, nameLowered)) If Not (objTag Is Nothing) Then DataCache.SetCache("Tag-" & moduleID.ToString() & "-" & nameLowered, objTag) End If @@ -57,7 +57,7 @@ Namespace Ventrian.NewsArticles Public Function Add(ByVal objTag As TagInfo) As Integer - Return CType(DataProvider.Instance().AddTag(objTag.ModuleID, objTag.Name, objTag.NameLowered), Integer) + Return DataProvider.Instance().AddTag(objTag.ModuleID, objTag.Name, objTag.NameLowered) End Function diff --git a/Controls/UploadImages.ascx.vb b/Controls/UploadImages.ascx.vb index 99f5b03..2f2946c 100755 --- a/Controls/UploadImages.ascx.vb +++ b/Controls/UploadImages.ascx.vb @@ -157,7 +157,7 @@ Namespace Ventrian.NewsArticles.Controls width = Convert.ToInt32(objImage.Width / (objImage.Height / height)) End If - Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings() + Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings() Return Page.ResolveUrl("~/DesktopModules/DnnForge - NewsArticles/ImageHandler.ashx?Width=" & width.ToString() & "&Height=" & height.ToString() & "&HomeDirectory=" & Server.UrlEncode(settings.HomeDirectory) & "&FileName=" & Server.UrlEncode(objImage.Folder & objImage.FileName) & "&PortalID=" & settings.PortalId.ToString() & "&q=1") diff --git a/Installs/NewsArticles.00.10.00.zip b/Installs/NewsArticles.00.10.00.zip index e7fe72c..c3c45b0 100644 Binary files a/Installs/NewsArticles.00.10.00.zip and b/Installs/NewsArticles.00.10.00.zip differ diff --git a/Providers/FileProvider/FileController.vb b/Providers/FileProvider/FileController.vb index 2ebf5a5..827e879 100755 --- a/Providers/FileProvider/FileController.vb +++ b/Providers/FileProvider/FileController.vb @@ -25,7 +25,7 @@ Namespace Ventrian.NewsArticles Public Function [Get](ByVal fileID As Integer) As FileInfo - Return CType(CBO.FillObject(DataProvider.Instance().GetFile(fileID), GetType(FileInfo)), FileInfo) + Return CBO.FillObject(Of FileInfo)(DataProvider.Instance().GetFile(fileID)) End Function diff --git a/Ventrian.NewsArticles.vbproj.user b/Ventrian.NewsArticles.vbproj.user index a8021c9..a036481 100755 --- a/Ventrian.NewsArticles.vbproj.user +++ b/Ventrian.NewsArticles.vbproj.user @@ -1,7 +1,7 @@  - Debug|Any CPU + Release|Any CPU ShowAllFiles false diff --git a/ucApproveArticles.ascx.vb b/ucApproveArticles.ascx.vb index 6674a96..cc3015c 100755 --- a/ucApproveArticles.ascx.vb +++ b/ucApproveArticles.ascx.vb @@ -235,7 +235,7 @@ Namespace Ventrian.NewsArticles Dim objRoleController As New RoleController() - Dim objRoles As ArrayList = objRoleController.GetRoles() + Dim objRoles As IList(Of RoleInfo) = objRoleController.GetRoles(PortalId) For Each objRole As RoleInfo In objRoles Dim roleAccess As Boolean = False diff --git a/ucEditCategory.ascx.vb b/ucEditCategory.ascx.vb index 220ea6f..06757c6 100755 --- a/ucEditCategory.ascx.vb +++ b/ucEditCategory.ascx.vb @@ -85,9 +85,8 @@ Namespace Ventrian.NewsArticles Private Sub BindRoles() - Dim objRole As New RoleController Dim availableRoles As New ArrayList - Dim roles As ArrayList = objRole.GetPortalRoles(PortalId) + Dim roles As IList(Of RoleInfo) = RoleController.Instance.GetRoles(PortalId) If Not roles Is Nothing Then For Each Role As RoleInfo In roles diff --git a/ucSubmitNews.ascx.vb b/ucSubmitNews.ascx.vb index 8fc0802..f63059b 100755 --- a/ucSubmitNews.ascx.vb +++ b/ucSubmitNews.ascx.vb @@ -759,7 +759,7 @@ Namespace Ventrian.NewsArticles Dim objRoleController As New RoleController() - Dim objRoles As ArrayList = objRoleController.GetRoles() + Dim objRoles As IList(Of RoleInfo) = RoleController.Instance.GetRoles(PortalId) For Each objRole As RoleInfo In objRoles Dim roleAccess As Boolean = False diff --git a/ucViewOptions.ascx.vb b/ucViewOptions.ascx.vb index eee81b6..385bc54 100755 --- a/ucViewOptions.ascx.vb +++ b/ucViewOptions.ascx.vb @@ -5,6 +5,7 @@ ' Imports System.IO +Imports System.Linq Imports DotNetNuke.Common.Utilities Imports DotNetNuke.Entities.Modules @@ -72,13 +73,12 @@ Namespace Ventrian.NewsArticles Private Sub BindRoles() - Dim objRole As New RoleController - Dim availableRoles As ArrayList = New ArrayList - Dim roles As ArrayList + Dim roles As IList(Of RoleInfo) If (drpSecurityRoleGroups.SelectedValue = "-1") Then - roles = objRole.GetPortalRoles(PortalId) + roles = RoleController.Instance.GetRoles(PortalId) Else + Dim objRole As New RoleController roles = objRole.GetRolesByGroup(PortalId, Convert.ToInt32(drpSecurityRoleGroups.SelectedValue)) End If @@ -1473,10 +1473,9 @@ Namespace Ventrian.NewsArticles If (add) Then Dim objListItem As New ListItem objListItem.Value = objPortal.PortalID.ToString() & "-" & objTab.TabID.ToString() & "-" & objModule.ModuleID.ToString() - Dim o As New PortalAliasController - Dim aliases As ArrayList = o.GetPortalAliasArrayByPortalID(objPortal.PortalID) + Dim aliases As IEnumerable(Of PortalAliasInfo) = PortalAliasController.Instance.GetPortalAliasesByPortalId(objPortal.PortalID) If (aliases.Count > 0) Then - objListItem.Text = DotNetNuke.Common.AddHTTP(CType(aliases(0), PortalAliasInfo).HTTPAlias) & " -> " & strPath & " -> " & objModule.ModuleTitle + objListItem.Text = DotNetNuke.Common.AddHTTP(aliases(0).HTTPAlias) & " -> " & strPath & " -> " & objModule.ModuleTitle Else objListItem.Text = objPortal.PortalName & " -> " & strPath & " -> " & objModule.ModuleTitle End If