Esempio n. 1
0
        /// <summary>
        /// Method to get list of HistoryTrip based on year and user id.
        /// </summary>
        /// <param name="year">
        /// For this year you need to get statistics.
        /// </param>
        /// <param name="userId">
        /// Statistics for user with userId.
        /// </param>
        /// <returns>
        /// Return list of HistoryTrip based on year and user id.
        /// </returns>
        public IEnumerable <HistoryTrip> GetHistoryByYear(int year, string userId)
        {
            IQueryable <HistoryTrip> historyTrips = _repositoryHistoryTrip.GetByUserId(userId)
                                                    .Where(p => p.TimeAfterDeparture.End.Value.Year == year);

            return(historyTrips);
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            var userId = _userService.GetCurrentUserId();
            IEnumerable <HistoryTrip> historyTrips = _repositoryHistoryTrip.GetByUserId(userId);

            return(View(historyTrips));
        }