Exemplo n.º 1
0
        public void GetLiveTrainers()
        {
            var criteria = new SearchCriteria <TrainerDTO>();

            TrainerList = _trainerService.GetAll(criteria).OrderBy(i => i.Id).ToList();

            Trainers = new ObservableCollection <TrainerDTO>(TrainerList);
        }
Exemplo n.º 2
0
        public ViewViewComponentResult Invoke()
        {
            TrainerListViewModel trainerListViewModel = new TrainerListViewModel()
            {
                Trainers = _trainerService.GetAll(),
            };

            return(View(trainerListViewModel));
        }
Exemplo n.º 3
0
        public IActionResult Index()
        {
            TrainerListViewModel trainerListViewModel = new TrainerListViewModel()
            {
                Trainers = _trainerService.GetAll(),
            };

            return(View(trainerListViewModel));
        }
Exemplo n.º 4
0
        public IActionResult Index()
        {
            HomeViewModel homeViewModel = new HomeViewModel()
            {
                Exercises     = _exerciseService.GetAll(),
                Trainers      = _trainerService.GetAll(),
                ExerciseTypes = _exerciseTypeService.GetAll(),
                BlogPosts     = _blogPostService.GetAll().OrderBy(x => x.Time.Day).ToList(),
            };



            return(View(homeViewModel));
        }
Exemplo n.º 5
0
        public HttpResponseMessage GetListPaging(HttpRequestMessage request, int page, int pageSize,
                                                 string filter = null)
        {
            return(CreateHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;
                int totalRow;
                var model = _trainerService.GetAll(page, pageSize, out totalRow, filter);

                var modelVm = Mapper.Map <IEnumerable <Trainer>, IEnumerable <TrainerViewModel> >(model);

                var pagedSet = new PaginationSet <TrainerViewModel>
                {
                    Page = page,
                    TotalCount = totalRow,
                    TotalPages = (int)Math.Ceiling((decimal)totalRow / pageSize),
                    Items = modelVm
                };

                response = request.CreateResponse(HttpStatusCode.OK, pagedSet);

                return response;
            }));
        }
Exemplo n.º 6
0
        public async Task <IHttpActionResult> GetAll()
        {
            var rs = await _trainerService.GetAll();

            return(ApiJson(rs));
        }
 public async Task <IActionResult> GetAll(CancellationToken cancellationToken = default)
 {
     return(Ok(await _trainerService.GetAll(cancellationToken)));
 }