Exemple #1
0
        /// <summary>
        /// 查询权限
        /// </summary>
        /// <param name="filter">查询条件</param>
        /// <returns></returns>
        public static QueryResult <Functions> QueryFunctions(FunctionsQueryFilter filter)
        {
            QueryResult <Functions> result = new QueryResult <Functions>();

            result.ServicePageIndex = filter.ServicePageIndex;
            result.PageSize         = filter.PageSize;

            PagingInfoEntity  page = DataAccessUtil.ToPagingInfo(filter);
            CustomDataCommand cmd  = DataCommandManager.CreateCustomDataCommandFromConfig("QueryFunctions");

            using (var sqlBuilder = new DynamicQuerySqlBuilder(cmd.CommandText, cmd, page, "SysNo DESC"))
            {
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Status", DbType.Int32,
                                                             "@Status1", QueryConditionOperatorType.NotEqual, CommonStatus.Deleted);
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "SysNo", DbType.Int32,
                                                             "@SysNo", QueryConditionOperatorType.Equal, filter.SysNo);
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "FunctionName", DbType.String,
                                                             "@FunctionName", QueryConditionOperatorType.Like, filter.FunctionName);
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "FunctionKey", DbType.String,
                                                             "@FunctionKey", QueryConditionOperatorType.Like, filter.FunctionKey);
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Description", DbType.String,
                                                             "@Description", QueryConditionOperatorType.Like, filter.Description);
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Status", DbType.Int32,
                                                             "@Status", QueryConditionOperatorType.Equal, filter.Status);

                cmd.CommandText   = sqlBuilder.BuildQuerySql();
                result.ResultList = cmd.ExecuteEntityList <Functions>();
                result.TotalCount = Convert.ToInt32(cmd.GetParameterValue("@TotalCount"));

                return(result);
            }
        }
Exemple #2
0
 /// <summary>
 /// 查询用户
 /// </summary>
 /// <param name="filter">查询条件</param>
 /// <returns></returns>
 public QueryResult <Functions> QueryFunctions(FunctionsQueryFilter filter)
 {
     return(FunctionsMgtDA.QueryFunctions(filter));
 }