コード例 #1
0
        public ActionResult ListDeletedItems(ListItemsViewModel itemsModel, int?page)
        {
            var model = itemsModel ?? new ListItemsViewModel();

            model.Items = this.itemService.GetDeletedItems(itemsModel.QueryString, page);

            return(this.View(model));
        }
コード例 #2
0
        public ActionResult List(int id)
        {
            var viewModel = new ListItemsViewModel
            {
                Checklist = _checklistDao.GetSingle(id),
                Items     = _itemDao.FetchMany(id)
            };

            return(View(viewModel));
        }
        public ActionResult TestListView()
        {
            var viewModel = new ListItemsViewModel();

            viewModel.ListItems = new List <ListItem>()
            {
                new ListItem()
                {
                    ImageUrl         = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg",
                    Title            = "Niana Seril",
                    SubTitle         = "Senior Manager",
                    EnableLikeButton = true,
                    ChatUrl          = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg"
                },


                new ListItem()
                {
                    ImageUrl    = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg",
                    Title       = "My ChanelName",
                    SubTitle    = "Team Name",
                    DeepLinkUrl = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg"
                },


                new ListItem()
                {
                    ImageUrl         = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg",
                    Title            = "Antonio Clausen",
                    SubTitle         = "Sales Manager",
                    ChatUrl          = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg",
                    EnableLikeButton = false,
                },


                new ListItem()
                {
                    ImageUrl         = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg",
                    Title            = "Omar Mast",
                    SubTitle         = "Solution Specialist",
                    EnableLikeButton = true,
                    ChatUrl          = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg"
                },


                new ListItem()
                {
                    ImageUrl    = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg",
                    Title       = "Nelson Morales",
                    SubTitle    = "Chief Business Operator",
                    DeepLinkUrl = "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg"
                },
            };
            return(View(viewModel));
        }
コード例 #4
0
        public async Task <IActionResult> ListItems()
        {
            List <Item> items = await Context.Items.ToListAsync();

            var viewModel = new ListItemsViewModel()
            {
                Items = items
            };

            return(View(viewModel));
        }
コード例 #5
0
        public async Task <IActionResult> ListItems(string listTitle)
        {
            var model = new ListItemsViewModel();

            using (var context = await createSiteContext())
            {
                // Retrieving lists of the target web
                var items = (from i in context.Web.Lists.GetByTitle(listTitle).Items.QueryProperties(i => i.Id, i => i.Title)
                             select i);

                model.ListTitle = listTitle;
                model.Items     = new List <ListItemViewModel>(from i in items.ToList()
                                                               select
                                                               new ListItemViewModel
                {
                    Id    = i.Id,
                    Title = i.Title
                });
            }

            return(View("ListItems", model));
        }
コード例 #6
0
        public ActionResult Index(int?page, string search, int?categoryId, int?subCategoryId)
        {
            if (page == null || page < 1)
            {
                page = 1;
            }

            ListItemsViewModel model = new ListItemsViewModel
            {
                CurrentPage    = page.Value,
                EntriesPerPage = ItemsPerPage
            };

            if (categoryId != null &&
                this.categoryService.Exists(categoryId.Value) &&
                this.categoryService.HasItems(categoryId.Value))
            {
                model.CategoryId   = categoryId;
                model.TotalEntries = this.itemService.TotalByCategory(categoryId.Value);
                model.Items        = this.itemService.ByCategory(page.Value, ItemsPerPage, categoryId.Value);
            }
            else if (subCategoryId != null &&
                     this.subCategoryService.Exists(subCategoryId.Value) &&
                     this.subCategoryService.HasItems(subCategoryId.Value))
            {
                model.SubCategoryId = subCategoryId;
                model.TotalEntries  = this.itemService.TotalBySubCategory(subCategoryId.Value);
                model.Items         = this.itemService.BySubCategory(page.Value, ItemsPerPage, subCategoryId.Value);
            }
            else
            {
                model.TotalEntries = this.itemService.Total(search);
                model.Search       = search;
                model.Items        = this.itemService.All(page.Value, ItemsPerPage, search);
            }

            return(View(model));
        }
コード例 #7
0
ファイル: NewsController.cs プロジェクト: SharpDevSa/Mix.Web
        public virtual ActionResult Index(int page)
        {
            var pageValue = page - 1;
            var vm        = new ListItemsViewModel <News>
            {
                Items = GetNewsPage(pageValue).ToList(),
                Pager = new PagerViewModel
                {
                    PageSize    = PageSize,
                    Total       = GetEntities <News>().Count(x => x.Visibility),
                    Page        = pageValue,
                    GenerateUrl = p => Url.Action(MVC.News.Index(p))
                }
            };

            SetLocalizationRedirects();

            if (!vm.Items.Any())
            {
                return(HttpNotFound());
            }

            return(View(vm));
        }
コード例 #8
0
        public ListViewItemsPage()
        {
            InitializeComponent();

            BindingContext = viewModel = new ListItemsViewModel();
        }