CommunityStarterKit之Communities类及数据库中表和操作

:

namespace ASPNET.StarterKit.Communities {

    using System;

    using System.Data;

    //*********************************************************************

    //

    // CommunityInfo Class

    //CommunityInfo

    // Represents all the information about a particular community.

    //描述了一个特定(详细)Community的所有信息

    //*********************************************************************  

    public class CommunityInfo {

        private int _id;

           private string _name;

        private Guid _uniqueID;

        private string _primaryDomain;

        private string _domain;

        private string _subDomain;

        private string _smtpServer;

           private int _databaseQuota;

           private bool _isDisplayed;

        private bool _enableTopicMenu;

        //*********************************************************************

        //

        // ID Property

        //CommunityID 属性

        // The value of the identity column.

        //标识列的值.      

        //*********************************************************************

          

        public int ID {

            get {return _id;}

        }

        //*********************************************************************

        //

        // Name Property

        //CommunityName属性

        // The name of this community.

        //Community的名字

        //*********************************************************************              

           public string Name

           {

                 get {return _name;}

           }

        //*********************************************************************

        //

        // UniqueID Property

        //

        // The globally unique ID of this community.

        //Community的全局唯一标识ID

        //*********************************************************************   

        public Guid UniqueID {

            get {return _uniqueID;}

        }

        //*********************************************************************

        //

        // PrimaryDomain Property

        //主域属性

        // The domain used when sending emails and forming absolute URLs.

        //用于生成绝对URLs和发送emails的域名

        //*********************************************************************

   

        public string PrimaryDomain {

            get {return _primaryDomain;}

        }

 

 

        //*********************************************************************

        //

        // Domain Property

        //域属性

        // The domain name used for matching request for this community.

        //用于为此Community匹配的请求的域名称。         //*********************************************************************

   

        public string Domain {

            get {return _domain;}

        }

 

 

 

        //*********************************************************************

        //

        // SubDomain Property

        //

        // The sub domain matched when making requests for this community.

        //匹配此Community进行请求时的子域

        //*********************************************************************

   

        public string SubDomain {

            get {return _subDomain;}

        }

 

 

        //*********************************************************************

        //

        // SmtpServer Property

        //smpt服务

        // The email server associated with this community.

        //Email服务和Community的结合

        //*********************************************************************

   

        public string SmtpServer {

            get {return _smtpServer;}

        }

 

 

        //*********************************************************************

        //

        // DatabaseQuota Property

        //Database配额

        // The total file and image data that can be stored for this community.

        //此社区总的文件和图片数据总数

        //*********************************************************************

   

           public int DatabaseQuota

           {

                 get {return _databaseQuota;}

           }

 

 

        //*********************************************************************

        //

        // IsDisplayed Property

        //是否显示属性

        // Determines whether this community is displayed in the Communities menu.

        //决定这个Community是否显示在Communities的菜单里

        //*********************************************************************

   

           public bool IsDisplayed

           {

                 get {return _isDisplayed;}

           }

        //*********************************************************************

        //

        // EnableTopicMenu Property

        //允许主题菜单属性

        // Determines whether this community displays topics.

        //确定此Community是否显示主题

        //*********************************************************************

   

           public bool EnableTopicMenu

           {

                 get {return _enableTopicMenu;}

           }

        //*********************************************************************

        //

        // CommunityInfo Constructor

        //构造函数()

        // Retrieves community info from a datarow.

        //datarow(数据库)里得到Community信息

        //*********************************************************************

          

        public CommunityInfo(DataRow drow) {

            _id = (int)drow["community_id"];

            _uniqueID = (Guid)drow["community_uniqueID"];

            _primaryDomain = (string)drow["community_primaryDomain"];

            _domain = (string)drow["community_domain"];

            _subDomain = (string)drow["community_subDomain"];

            _smtpServer = (string)drow["community_smtpServer"];

                 _name = (string)drow["community_name"];

                 _databaseQuota = (int)drow["community_databaseQuota"];

                 _isDisplayed = (bool)drow["community_isDisplayed"];

                 _enableTopicMenu = (bool)drow["community_enableTopicMenu"];

           }

}

我们来看一下相应的数据库中的表:

Community_Communities:

Community_id int 4(primary key identity(1,1))

Community_name nvarchar 50

Community_uinqueID uniqueidenti 16

Community_PrimaryDomain nvarchar 50

Community_domain nvarchar 50

Community_subdomain nvarchar 50

Community_smtpServer nvarchar 50

Community_databaseQuota int 4

Community_databaseQuotaUsed int 4

Community_sortOrder int 4

Community_isDisplayed bit 1

Community_enableTopicMenu bit 1

数据库操作的存储过程

Community_CommunitiesAddCommunity:添加Community;

Community_CommunitiesDeleteCommunity:删除

Community_CommunitiesGetAllCommunities:读取所有可用的Communities

Community_CommunitiesMoveDown/Up:位置的更新;

Community_CommunitiesUpdateCommunity:更新

 

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值