Exemple #1
0
        public DataTable Query(HomePageSectionQueryFilter filter, out int totalCount)
        {
            PagingInfoEntity pagingEntity = new PagingInfoEntity();

            pagingEntity.SortField     = filter.PagingInfo.SortBy;
            pagingEntity.MaximumRows   = filter.PagingInfo.PageSize;
            pagingEntity.StartRowIndex = filter.PagingInfo.PageIndex * filter.PagingInfo.PageSize;

            var cmd = DataCommandManager.CreateCustomDataCommandFromConfig("Domain_GetDomainList");

            using (var sqlBuilder = new DynamicQuerySqlBuilder(cmd.CommandText, cmd, pagingEntity, "A.SysNo DESC"))
            {
                sqlBuilder.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "A.CompanyCode",
                    DbType.AnsiStringFixedLength,
                    "@CompanyCode",
                    QueryConditionOperatorType.Equal,
                    filter.CompanyCode);
                //TODO:添加ChannelID参数

                cmd.CommandText = sqlBuilder.BuildQuerySql();

                EnumColumnList enumConfig = new EnumColumnList();
                enumConfig.Add("Status", typeof(ADStatus));
                var dt = cmd.ExecuteDataTable(enumConfig);
                totalCount = Convert.ToInt32(cmd.GetParameterValue("@TotalCount"));
                return(dt);
            }
        }
        public virtual QueryResult QueryHomePageSection(HomePageSectionQueryFilter filter)
        {
            int         totalCount;
            QueryResult result = new QueryResult();

            result.Data = ObjectFactory <IHomePageSectionQueryDA> .Instance.Query(filter, out totalCount);

            result.TotalCount = totalCount;
            return(result);
        }