Exemple #1
0
        /// <summary>
        /// 根据指定的权限项编码查询权限项对象
        /// </summary>
        /// <param name="AuthItemCode"></param>
        /// <returns></returns>
        public virtual IAuthItem QueryAuthItem(string AuthItemCode)
        {
            IAuthItem item = this.entityfactory.CreateEntityInstance <IAuthItem>();

            item.AuthItemCode = AuthItemCode;
            IDvTable dvt = this.entityfactory.CreateDriveTable(item);

            dvt.WhereClause("AuthItemCode", Operator.Deng, LinkOperator.nul);
            DataSet    ds  = dvt.Select();
            DataHelper dte = new DataHelper();

            return(dte.Convert <IAuthItem>(item.GetType(), ds, 0));;
        }
Exemple #2
0
        /// <summary>
        /// 根据角色查询权限项
        /// 角色关联权限控制项 权限控制项关联权限项
        /// </summary>
        /// <param name="Role"></param>
        /// <returns></returns>
        public List <IAuthItem> QueryAuthItem(IRole Role)
        {
            IAuthItem    item  = this.entityfactory.CreateEntityInstance <IAuthItem>();
            IAuthControl actrl = entityfactory.CreateEntityInstance <IAuthControl>();

            actrl.RoleCode = Role.RoleCode;
            IDvTable dvt = entityfactory.CreateDriveTable(item);

            dvt.Join.Entitys.Add(actrl);
            dvt.WhereClause(actrl, "RoleCode", Operator.Deng, LinkOperator.nul);
            DataSet          ds   = dvt.Select();
            List <IAuthItem> list = this.dh.Convert <IAuthItem>(item.GetType(), ds);

            return(list);
        }