示例#1
0
        public IActionResult Sessions()
        {
            var sessions = sessionsRepository.GetSessions().Select(x => sessionModelBuilder.Build(x, authTokenHelper.IsAdmin()));

            return(View(new SessionsModel
            {
                Sessions = sessions,
                AllowModify = authTokenHelper.IsAdmin()
            }));
        }
示例#2
0
        public ActionResult UserDashBoard()
        {
            ClaimsIdentity claimsIdentity;

            claimsIdentity = HttpContext.User.Identity as ClaimsIdentity;

            string currentUserName = claimsIdentity.Name;

            return(View(new UserViewModel {
                CurrentUserName = currentUserName, OnlineUsers = sessRepo.GetSessions()
            }));
        }
        public List <Invoice> GetInvoices(string parkingFacilityId)
        {
            var serviceProfile = _parkingFacilityRepository.GetServiceProfile(parkingFacilityId);

            if (serviceProfile == null)
            {
                throw new ArgumentException($"Invalid parking facility id '{parkingFacilityId}'");
            }

            var sessions = _sessionsRepository.GetSessions(parkingFacilityId);

            return(sessions.GroupBy(x => x.CustomerId).Select(x => new Invoice
            {
                ParkingFacilityId = parkingFacilityId,
                CustomerId = x.Key,
                Amount = 0
            }).ToList());
        }
        public async Task <IEnumerable <SessionModelResponse> > GetSessions()
        {
            IEnumerable <DalSessionModelResponse> sessions = await _sessionRepository.GetSessions();

            return(sessions.Select(Mapper.Map <SessionModelResponse>));
        }
 public IActionResult GetAll()
 {
     _telemetryClient.TrackEvent("AllSessionsRead");
     _telemetryClient.Flush();
     return(Ok(_repository.GetSessions()));
 }
 public List <Session> Get(string parkingFacilityId)
 {
     return(_sessionsRepository.GetSessions(parkingFacilityId));
 }