public ViewResult List(int page = 1, string parentid = null)
 {
     EntityListViewModel model = new EntityListViewModel
     {
         PagingInfo = new PagingInfo {
             CurrentPage = page,
             ItemsPerPage = ItemPerPage,
             TotalItems = _repository.Complectations.Count(x => x.complectationmodelid == parentid || parentid == null)
         },
         Entities = _repository.Complectations.Where(x=>x.complectationmodelid == parentid || parentid == null)
         .OrderBy(x=>x.complectationname)
          .Skip((page - 1) * ItemPerPage)
          .Take(ItemPerPage),
         Entity = "Complectation",
         ParentId = parentid
     };
     return View(model);
 }
Esempio n. 2
0
        public ViewResult List(int page = 1)
        {
            EntityListViewModel list = new EntityListViewModel
            {
                PagingInfo = new PagingInfo
                {
                    CurrentPage = page,
                    ItemsPerPage = ItemPerPage,
                    TotalItems = _repository.Brands.Count()
                },
                Entities = _repository.Brands
                    .OrderBy(p => p.brandname)
                    .Skip((page - 1) * ItemPerPage)
                    .Take(ItemPerPage),
                Entity ="Brand"
            };

            return View(list);
        }
Esempio n. 3
0
        public ViewResult List(int page = 1, string parentid = null)
        {
            EntityListViewModel list = new EntityListViewModel
            {
                PagingInfo = new PagingInfo
                {
                    CurrentPage = page,
                    ItemsPerPage = ItemPerPage,
                    TotalItems = _repository.Models.Count(p => parentid == null || p.modelbrandid == parentid)
                },
                Entities = _repository.Models.Where(p=> parentid == null || p.modelbrandid == parentid)
                    .OrderBy(p => p.modelname)
                    .Skip((page - 1) * ItemPerPage)
                    .Take(ItemPerPage),
                Entity = "Model" ,
                ParentId = parentid
            };

            return View(list);
        }