Пример #1
0
        public static IList FindPage(ObjectInfo state, String queryString)
        {
            // see: System/Web/Mvc/Routes/RouteTool.cs, line 211

            if (state.Pager.getCurrent() <= 0)
            {
                int page = CurrentRequest.getCurrentPage();
                state.Pager.setCurrent(page);
            }

            if (queryString != null && queryString.ToLower().StartsWith("order "))
            {
                queryString = " " + queryString;
            }

            PageCondition pc = new PageCondition();

            pc.ConditionStr = queryString;
            pc.Property     = state.Includer.SelectedProperty;
            pc.CurrentPage  = state.Pager.getCurrent();
            pc.Size         = state.Pager.getSize();
            pc.OrderStr     = state.Order;
            pc.Pager        = state.Pager;

            String sql = new SqlBuilder(state.EntityInfo).GetPageSql(pc);

            return(EntityPropertyUtil.FindList(state, sql));
        }
Пример #2
0
        private static IList findAllPrivate(ObjectInfo state)
        {
            String sql = "select * from " + state.EntityInfo.TableName;

            logger.Info(LoggerUtil.SqlPrefix + "[" + state.EntityInfo.Name + "_FindAll]" + sql);

            return(EntityPropertyUtil.FindList(state, sql));
        }