Esempio n. 1
0
        public ActionResult Create()
        {
            var viewmodel = new ServerAddViewModel();

            viewmodel.AvailableCategories = _serverService.GetCategories().Select(t => new SelectListItem()
            {
                Text  = t.Name,
                Value = t.Id.ToString()
            }).ToList();

            viewmodel.AvailableElements = _elementService.GetElements().Select(t => new SelectListItem()
            {
                Text  = t.DisplayName,
                Value = t.Id.ToString()
            }).ToList();

            return(View(viewmodel));
        }
Esempio n. 2
0
        public ActionResult Index(int page = 1)
        {
            var pagingInfo = new PagingInfo()
            {
                PageNumber = page
            };
            var entites   = _elementService.GetElements(pagingInfo);
            var viewmodel = entites.ToMappedPagedList <Element, ElementDetailsViewModel>(pagingInfo);

            return(View(viewmodel));
        }
Esempio n. 3
0
 public IEnumerable <Element> Get()
 {
     return(_elementService.GetElements());
 }