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

📄 sectionrequest.cs

📁 ASP.NET简洁论坛源代码 这是一个简单的论坛
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NetFocus.Web.Core;

namespace NetFocus.Web.Applications.Forum
{
    public class SectionRequest : EntityRequest
    {
        public int GroupId = 0;
        public int Enabled = -1;

        public bool HasGroupId
        {
            get
            {
                return GroupId > 0;
            }
        }

        public override string GetPopulateSql()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Select top {0} {2} From tb_Entities E where E.EntityType = {1}", (PageIndex + 1) * PageSize, (int)NetFocus.Web.Applications.Forum.EntityType.Section, GetInternalSelectSql());

            if (HasGroupId)
            {
                sb.AppendFormat(" and E.IntField2 = {0}", GroupId);
            }

            if (Enabled == 0 || Enabled == 1)
            {
                sb.AppendFormat(" and E.IntField3 = {0}", Enabled);
            }

            sb.Append(base.GetOrderSql());

            return sb.ToString();
        }
        public override string GetFullPopulateSql()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Select E.EntityId From tb_Entities E where E.EntityType = {0}", (int)NetFocus.Web.Applications.Forum.EntityType.Section);

            if (HasGroupId)
            {
                sb.AppendFormat(" and E.IntField2 = {0}", GroupId);
            }

            if (Enabled == 0 || Enabled == 1)
            {
                sb.AppendFormat(" and E.IntField3 = {0}", Enabled);
            }

            return sb.ToString();
        }
    }
}

⌨️ 快捷键说明

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