Esempio n. 1
0
        /// <summary>
        /// 查询所有权限控制项
        /// </summary>
        /// <returns></returns>
        public List <IAuthControl> QueryAuthCtrl()
        {
            IAuthControl        actrl = entityfactory.CreateEntityInstance <IAuthControl>();
            IDvTable            dvt   = entityfactory.CreateDriveTable(actrl);
            DataSet             ds    = dvt.Select();
            List <IAuthControl> list  = this.dh.Convert <IAuthControl>(actrl.GetType(), ds);

            return(list);
        }
Esempio n. 2
0
        /// <summary>
        /// 根据权限类型名称查询权限控制项
        /// </summary>
        /// <param name="AuthType"></param>
        /// <returns></returns>
        public List <IAuthControl> QueryAuthCtrl(AuthType AuthType)
        {
            IAuthControl actrl = entityfactory.CreateEntityInstance <IAuthControl>();
            IDvTable     dvt   = entityfactory.CreateDriveTable(actrl);

            actrl.AuthCode = long.Parse(Enum.Parse(typeof(AuthType), AuthType.ToString()).ToString());
            DataSet             ds   = dvt.Select();
            List <IAuthControl> list = this.dh.Convert <IAuthControl>(actrl.GetType(), ds);

            return(list);
        }
Esempio n. 3
0
        /// <summary>
        /// 根据角色名称查询权限控制项
        /// </summary>
        /// <param name="Role"></param>
        /// <returns></returns>
        public List <IAuthControl> QueryAuthCtrl(IRole Role)
        {
            IAuthControl actrl = entityfactory.CreateEntityInstance <IAuthControl>();
            IDvTable     dvt   = entityfactory.CreateDriveTable(actrl);

            actrl.RoleCode = Role.RoleCode;
            dvt.WhereClause("RoleCode", Operator.Deng, LinkOperator.nul);
            DataSet             ds   = dvt.Select();
            List <IAuthControl> list = this.dh.Convert <IAuthControl>(actrl.GetType(), ds);

            return(list);
        }
Esempio n. 4
0
        /// <summary>
        /// 根据权限项和角色查询权限控制项
        /// </summary>
        /// <param name="AuthItem"></param>
        /// <param name="Role"></param>
        /// <returns></returns>
        public IAuthControl QueryAuthCtrl(IAuthItem AuthItem, IRole Role)
        {
            IAuthControl actrl = entityfactory.CreateEntityInstance <IAuthControl>();
            IDvTable     dvt   = entityfactory.CreateDriveTable(actrl);

            actrl.FItemCode = AuthItem.AuthItemCode.ToString();
            actrl.RoleCode  = Role.RoleCode;
            dvt.WhereClause("FItemCode", Operator.Deng, LinkOperator.and);
            dvt.WhereClause("RoleCode", Operator.Deng, LinkOperator.nul);
            DataSet ds = dvt.Select();

            actrl = this.dh.Convert <IAuthControl>(actrl.GetType(), ds, 0);
            return(actrl);
        }