Ejemplo n.º 1
0
        public List <PurchaseHistoryDto> GetPurchaseHistory(string userId)
        {
            List <PurchaseHistory> ph =
                _purchaseHistoryRepository.GetAll().Where(p => p.UserId == userId).ToList();

            var phdto = new List <PurchaseHistoryDto>();

            foreach (var item in ph)
            {
                TMEventSeatDto seat = _tmeventSeatService.GetTMEventSeat(item.TMEventSeatId);
                TMEventAreaDto area = _tmeventAreaService.GetTMEventArea(seat.TMEventAreaId);

                phdto.Add(new PurchaseHistoryDto
                {
                    SeatObj     = seat,
                    BookingDate = item.BookingDate,
                    AreaPrice   = area.Price,
                    TMEventObj  = _tmeventService.GetTMEvent(area.TMEventId),
                });
            }

            return(phdto);
        }
        public ActionResult Details(int id)
        {
            TMEventDto obj = _tmeventService.GetTMEvent(id);

            return(View(obj));
        }