Beispiel #1
0
        public DataTable GetRuleDataByProgid(string progid)
        {
            //SQLBuilder sQLBuilder = new SQLBuilder("CodeRuleConfig");
            LibDSContext dSContext  = new LibDSContext("CodeRuleConfig");
            var          ruleconfig = dSContext["CodeRuleConfig"];
            //string sql = sQLBuilder.GetSQL("CodeRuleConfig", null, sQLBuilder.Where("A.ProgId={0}", progid));
            string sql = dSContext.GetSQL("CodeRuleConfig", null, dSContext.Where(ruleconfig.Columns.ProgId + "={0}", progid));

            return(this.DataAccess.GetDataTable(sql));
        }
Beispiel #2
0
        ///// <summary>
        ///// 根据账户id 获取账户下的角色及权限对象。
        ///// </summary>
        ///// <param name="userid"></param>
        ///// <returns></returns>
        //public DataTable GetAuthority(string userid)
        //{
        //    //SQLBuilder sQLBuilder = new SQLBuilder("Account");
        //    LibDSContext dSContext = new LibDSContext("Account");
        //    var userRole = dSContext["UserRole"];
        //    string sql = dSContext.GetSQL("UserRole", null, dSContext.Where(userRole.Columns.UserId + "={0}", userid));
        //    return this.DataAccess.GetDataTable(sql);
        //}

        /// <summary>
        /// 根据账户id 获取账户下的角色及权限对象。
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public LibTableObj GetAuthority(string userid)
        {
            //SQLBuilder sQLBuilder = new SQLBuilder("Account");
            LibDSContext dSContext = new LibDSContext("Account");
            LibTableObj  userRole  = dSContext["UserRole"];
            //this.DataAccess.FillTableObj(userRole.Where(userRole.Columns.UserId + "={0}", userid));
            string    sql = dSContext.GetSQL("UserRole", null, dSContext.Where(userRole.Columns.UserId + "={0}", userid));
            DataTable dt  = this.DataAccess.GetDataTable(sql);

            userRole.DataTable.PrimaryKey = null;
            userRole.FillData(dt);
            return(userRole);
        }