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

📄 section.cs

📁 ASP.NET简洁论坛源代码 这是一个简单的论坛
💻 CS
字号:
//该源码下载自www.51aspx.com(51aspx.com)
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using NetFocus.Web.Core;

namespace NetFocus.Web.Applications.Forum
{
    public class Section : Entity
    {
        public Section()
        {
            this.EntityType = (int)NetFocus.Web.Applications.Forum.EntityType.Section;
        }

        private string subject = null;
        private int totalArticles = 0;
        private int groupId = 0;
        private int enabled = 0;
        private string adminUserIds = null;
        private string adminUserNames = null;

        [ExtendedField(FieldIdent.VarChar1, SqlDbType.VarChar)]
        public string Subject
        {
            get
            {
                return subject;
            }
            set
            {
                subject = value;
            }
        }
        [ExtendedField(FieldIdent.IntField1, SqlDbType.Int)]
        public int TotalThreads
        {
            get
            {
                return totalArticles;
            }
            set
            {
                totalArticles = value;
            }
        }
        [ExtendedField(FieldIdent.IntField2, SqlDbType.Int)]
        public int GroupId
        {
            get
            {
                return groupId;
            }
            set
            {
                groupId = value;
            }
        }
        [ExtendedField(FieldIdent.IntField3, SqlDbType.Int)]
        public int Enabled
        {
            get
            {
                return enabled;
            }
            set
            {
                enabled = value;
            }
        }
        [ExtendedField(FieldIdent.VarChar2, SqlDbType.VarChar)]
        public string AdminUserIds
        {
            get
            {
                return adminUserIds;
            }
            set
            {
                adminUserIds = value;
            }
        }
        [ExtendedField(FieldIdent.VarChar6, SqlDbType.VarChar)]
        public string AdminUserNames
        {
            get
            {
                return adminUserNames;
            }
            set
            {
                adminUserNames = value;
            }
        }

        public List<RoleUser> AdminRoleUserList
        {
            get 
            {
                if (!string.IsNullOrEmpty(adminUserIds) && !string.IsNullOrEmpty(adminUserNames))
                {
                    string[] userIdItems = adminUserIds.Split(new string[] { ",", ";" }, StringSplitOptions.None);
                    string[] userNameItems = adminUserNames.Split(new string[] { ",", ";" }, StringSplitOptions.None);
                    if (userIdItems.Length == userNameItems.Length)
                    {
                        List<RoleUser> roleUsers = new List<RoleUser>();
                        RoleUser roleUser = null;
                        int userId = 0;
                        foreach (string userIdString in userIdItems)
                        {
                            userId = int.Parse(userIdString);
                            if (userId > 0)
                            {
                                foreach (string userName in userNameItems)
                                {
                                    if (!string.IsNullOrEmpty(userName))
                                    {
                                        roleUser = new RoleUser();
                                        roleUser.UserId = userId;
                                        roleUser.UserName = userName;
                                        roleUsers.Add(roleUser);
                                    }
                                }
                            }
                        }
                        return roleUsers;
                    }
                }
                return null;
            }
        }
    }
}

⌨️ 快捷键说明

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