⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 viewarticlelist.ascx.vb

📁 如果不使用IIS,请先运行 XSP.exe,待提示已侦听 8080端口后
💻 VB
字号:
Imports DNNLite.Entites.Modules
Imports DNNLite.Comm
Imports System.Collections.Generic
Imports DNNLite.DesktopModules.Article
Imports NHibernate.Expression
Imports Castle.ActiveRecord
Imports DNNLite.DesktopModules.Comment
Partial Class DesktopModules_Article_ViewArticleList
    Inherits TempletPortalModuleBase

    Implements IActionable, DNNLite.DesktopModules.Comment.ICommentAble


    Public Function GetCommands() As System.Collections.Generic.IList(Of DNNLite.Entites.Modules.ModuleAction) Implements DNNLite.Entites.Modules.IActionable.GetCommands
        Dim result As IList(Of ModuleAction) = New List(Of ModuleAction)()

        result.Add(New ModuleAction("文章分类", "EditClass", EditUrl("EditClass")))
        result.Add(New ModuleAction("编辑文章", "Edit", EditUrl("Edit")))

        Return result
    End Function

    Protected Overrides Sub SetValues(ByVal bag As System.Collections.Generic.IDictionary(Of String, Object))
        Dim data As New ArticleData()

        '读取从url指定的分类信息
        If Not String.IsNullOrEmpty(Request("LoadArticleClass")) Then
            If Settings.ContainsKey("LoadClass") Then
                Settings("LoadClass") = Request("LoadArticleClass")
            Else
                Settings.Add("LoadClass", Request("LoadArticleClass"))
            End If
        End If

        data.Settings = Settings
        data.Module = Me

        bag.Add("data", data)
    End Sub

    Protected Overrides ReadOnly Property TemplateFile() As String
        Get
            If Settings.ContainsKey("ListTemplet") AndAlso Not String.IsNullOrEmpty(Settings("ListTemplet")) Then
                Return Settings("ListTemplet")
            Else
                Return "~/Templets/Article/内容列表.htm"
            End If
        End Get
    End Property

#Region "允许评论"

    Public Function GetCommentOption() As DNNLite.DesktopModules.Comment.CommentOption Implements DNNLite.DesktopModules.Comment.ICommentAble.GetCommentOption
        Return New CommentOption()
    End Function

    Public Function GetCommentOption(ByVal commentkey As String) As DNNLite.DesktopModules.Comment.CommentOption Implements DNNLite.DesktopModules.Comment.ICommentAble.GetCommentOption
        Dim c As String() = commentkey.Split("-")
        Dim id As Int16 = Integer.Parse(c(c.Length - 1))

        Dim sql As String = "select titleintact,ShowCommentLink from article where id=" & id.ToString()

        Dim dt As Data.DataTable = DbService.GetTable(sql)

        Dim opt As New CommentOption()
        opt.NeedComment = False

        If dt.Rows.Count = 0 Then

            Return opt
        End If

        opt.Subject = dt.Rows(0)("titleintact").ToString()
        opt.CanComment = True
        opt.NeedComment = CType(dt.Rows(0)("ShowCommentLink"), Boolean)
        opt.CommentKey = commentkey

        Return opt
    End Function

#End Region


End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -