Exemplo n.º 1
0
        public ActionResult List(int page = 0)
        {
            var promotionals = _promotionalService.GetAllPromotionals(pageIndex: page, pageSize: 15);

            var model = new PromotionalListModel();

            model.Items = promotionals.Items.Select(
                p => p.MapTo <PromotionalModel>()).ToList();

            model.Count   = promotionals.TotalCount;
            model.Pages   = promotionals.TotalCount / 15;
            model.Current = page;
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult List(DataSourceRequest command, PromotionalListModel model)
        {
            var promotionals = _promotionalService.GetAllPromotionals(model.Keywords, true, model.StartDate, model.EndDate, command.Page, command.PageSize);

            var jsonData = new DataSourceResult
            {
                ExtraData = promotionals.Items.Select(c => new
                {
                    Id           = c.Id,
                    Name         = c.Name,
                    StartDate    = c.StartDate.ToString("yyyy/MM/dd"),
                    EndDate      = c.EndDate.ToString("yyyy/MM/dd"),
                    Published    = c.Published,
                    CreationTime = c.CreationTime.ToString("yyyy/MM/dd"),
                }).ToList(),
            };

            return(AbpJson(jsonData));
        }
Exemplo n.º 3
0
        public ActionResult List()
        {
            var model = new PromotionalListModel();

            return(View(model));
        }