// GET: Event/Details/5
        public ActionResult Details(int id)
        {
            //SessionManager.EventId = id;
            Event e = _eventRequester.Get(id);

            if (!(SessionManager.User is null))
            {
                ViewBag.UserId = SessionManager.User.Id;
            }

            ViewBag.EventId = id;
            //TempData["EventId"] = id;

            return(View(new EventWithComment()
            {
                Id = e.Id,
                Name = e.Name,
                Type = e.Type,
                Organizer = e.Organizer,
                Date = e.Date,
                Location = e.Location,
                Tickets = e.Tickets,
                Price = e.Price,
                Description = e.Description,
                CommentList = _apiRequester.GetAll <G.GetComment>("comment/event/" + id).ToList()
            }));
        }
Beispiel #2
0
        //private void OnDeleteBooking(BookingViewModel instance)  // *
        //{
        //    Items.Remove(instance);
        //}

        protected override ObservableCollection <BookingViewModel> LoadItems()
        {
            return(new ObservableCollection <BookingViewModel>(_apiRequester.GetAll <GetBooking>("booking/user/" + UserId).Select(c => new BookingViewModel(c))));
        }
        //private void OnDeleteReply(ReplyViewModel instance)  // *
        //{
        //    Items.Remove(instance);
        //}

        protected override ObservableCollection <ReplyViewModel> LoadItems()
        {
            return(new ObservableCollection <ReplyViewModel>(_apiRequester.GetAll <GetReply>("reply/comment/" + CommentId).Select(c => new ReplyViewModel(c))));
        }
        //private void OnDeleteComment(CommentViewModel instance)  // *
        //{
        //    Items.Remove(instance);
        //}

        protected override ObservableCollection <CommentViewModel> LoadItems()
        {
            return(new ObservableCollection <CommentViewModel>(_apiRequester.GetAll <GetComment>("comment/event/" + EventId).Select(c => new CommentViewModel(c))));
        }