public async Task <IActionResult> EditProjections(int id) { if (id == null) { return(NotFound()); } ProjectionRes projection = await _projectionsRepository.GetProjectionById(new ProjectionGetDetailsReq { Id = id }); return(View(projection)); }
public async Task <IActionResult> MovieReservation(ProjectionGetDetailsReq req) { if (await _userRepository.DoesUserExists()) { ProjectionRes res = await _projectionsRespository.GetProjectionById(req); res.AvailableSeats = res.AvailableSeats.OrderBy(r => r.Name).ToList(); return(View(res)); } else { return(View("UserDoesNotExist")); } }
public async Task <IActionResult> TicketPayment(AvailableSeatGetDetailsReq req) { AvailableSeatGetDetailsRes availableSeatGetDetailsRes = await _availableSeatsRepository.GetAvailableSeatDetails(req); ProjectionGetDetailsReq projectionGetDetailsReq = new ProjectionGetDetailsReq { Id = availableSeatGetDetailsRes.ProjectionId }; ProjectionRes projectionGetDetailsRes = await _projectionsRepository.GetProjectionById(projectionGetDetailsReq); ReservationGetDetailsRes reservation = new ReservationGetDetailsRes { Seat = availableSeatGetDetailsRes, Projection = projectionGetDetailsRes }; return(View(reservation)); }
public async Task <TicketGetDetailsRes> GetTicketForIdAsync(TicketGetDetailsReq req) { TicketGetDetailsRes res = await _dbContext.Tickets .Where(t => t.Id == req.Id) .Select(t => new TicketGetDetailsRes { Id = t.Id, Price = t.Price, ProjectionId = t.ProjectionId, SeatName = t.Seat.Name, SeatId = t.SeatId }).FirstOrDefaultAsync(); ProjectionGetDetailsReq projectionReq = new ProjectionGetDetailsReq { Id = res.ProjectionId }; ProjectionRes projectionRes = await _projectionsRepository.GetProjectionById(projectionReq); res.Projection = projectionRes; return(res); }