using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KstCMS.BLL.SiteBLL
{
    public class AdminRole:BaseBLL
    {
        private KstCMS.DAL.IRole IRole;
        public AdminRole()
        {
            if (DBType == "1") //OLE数据库访问层
                IRole = new KstCMS.DAL.OleDB.AdminRole();
            //else //SQL数据库访问层
        }

        public int Add(KstCMS.Model.SiteModel.AdminRole Model)
        {
            return IRole.Add(Model);
        }

        public void Delete(int RoleId)
        {
            IRole.Delete(RoleId);
        }

        public void ReName(int RoleId,string NewName)
        {
            string[] FieldValue = new string[] { NewName };
            IRole.Update(FieldValue, RoleId, "RoleName");
        }

        public void SetAuth(int RoleId, string AuthStr)
        {
            string[] FieldValue = new string[] { AuthStr };
            IRole.Update(FieldValue, RoleId, "RunCode");
        }

        public System.Data.DataSet GetList(params string[] FieldNames)
        {
            return IRole.GetList(FieldNames);
        }

        public KstCMS.Model.SiteModel.AdminRole GetModel(int RoleId)
        {
            return IRole.GetMode(RoleId);
        }

    }
}
