Пример #1
0
        public BsJsonResult Pager(BsGridBaseRepositorySettings settings)
        {
            var msg    = string.Empty;
            var status = BsResponseStatus.Success;
            var html   = string.Empty;
            var count  = 0;

            try
            {
                var viewModel = _fakeSectionRepository.ToBsGridViewModel(settings, out count).Wrap <SectionListVm>(x => x.Grid);

                html = this.BsRenderPartialView("_SectionsGrid", viewModel);
            }
            catch (Exception ex)
            {
                msg    = ex.Message;
                status = BsResponseStatus.ServerError;
            }

            return(new BsJsonResult(new
            {
                Count = count,
                Html = html
            }, status, msg));
        }
Пример #2
0
            public override IOrderedQueryable <Section> OrderQuery(IQueryable <Section> query,
                                                                   BsGridBaseRepositorySettings gridSettings = null)
            {
                var ordered = orderedQueryBuilder.Order(query, x => x.OrderBy(y => y.Order));

                return(ordered);
            }
Пример #3
0
            public override IOrderedQueryable <Article> OrderQuery(IQueryable <Article> query,
                                                                   BsGridBaseRepositorySettings gridSettings = null)
            {
                var ordered = orderedQueryBuilder.Order(query, x => x.OrderBy(y => y.CreatedDate));

                return(ordered);
            }
Пример #4
0
        public override IOrderedQueryable <Contributor> OrderQuery(IQueryable <Contributor> query, BsGridBaseRepositorySettings gridSettings = null)
        {
            this.orderedQueryBuilder.OrderFor(x => x.Name, x => x.FirstName + " " + x.LastName);

            this.orderedQueryBuilder.OrderFor(x => x.StartDate, y => y.StartDate);

            var orderedQuery = this.orderedQueryBuilder.Order(query, x => x.OrderBy(y => y.Id), gridSettings);

            return(orderedQuery);
        }
Пример #5
0
 public BsGridModel()
 {
     this.BaseSettings = new BsGridBaseRepositorySettings();
 }
Пример #6
0
 public override IOrderedQueryable <Employee> OrderQuery(IQueryable <Employee> query, BsGridBaseRepositorySettings gridSettings = null)
 {
     return(query.OrderBy(x => x.BirthDate));
 }