public void AddMovieEvent(DTO.MovieEvent me) { using (var client = new HttpClient()) { client.BaseAddress = new Uri("http://localhost:6544/"); var response = client.PostAsJsonAsync <DTO.MovieEvent>("api/movieevents", me).Result; } }
public void CreateReservationOnlyWithMovieEvent(DTO.MovieEvent me) { DTO.Reservation reservation = new DTO.Reservation(); reservation.ReservationId = reservationIDs; reservationIDs++; reservation.MovieEvent = me; reservations.Add(reservation); chosedreservationid = reservation.ReservationId; }
public DTO.MovieEvent SelectMovieEvent(int id) { DTO.MovieEvent selectmovieevent = null; foreach (DTO.MovieEvent me in movieevents) { if (me.MovieEventId == id) { selectmovieevent = me; } } return(selectmovieevent); }
public void AddMovieEventHeader(DTO.MovieEvent me) { DTO.MovieEventHeader meh = new DTO.MovieEventHeader(); meh.Room = new DTO.RoomHeader(); meh.Movie = new DTO.Movie(); meh.MovieEventId = me.MovieEventId; meh.Movie = me.Movie; meh.Room.RoomId = me.Room.RoomId; meh.Room.RoomNumber = me.Room.RoomNumber; meh.Time = me.Time; movieeventheaders.Add(meh); }
public MockCinemaManager() { movieIDs = 0; movieeventIDs = 0; movies = new List <DTO.Movie>(); roommanager = new RoomManager(); movieevents = new List <DTO.MovieEvent>(); movieeventheaders = new List <DTO.MovieEventHeader>(); DTO.Movie m1 = new DTO.Movie() { Title = "Venom", Director = "Ruben Fleischer" }; DTO.Movie m2 = new DTO.Movie() { Title = "Az első ember", Director = "Damien Chazelle" }; DTO.Movie m3 = new DTO.Movie() { Title = "Egy kis szívesség", Director = "Paul Feig" }; AddMovie(m1); AddMovie(m2); AddMovie(m3); DTO.Room r = new DTO.Room() { RoomNumber = 5, Capacity = 20 }; DTO.Room r2 = new DTO.Room() { RoomNumber = 4, Capacity = 30 }; roommanager.CreateRoom(r); roommanager.CreateRoom(r2); DTO.MovieEvent me1 = new DTO.MovieEvent(); me1.Movie = m1; me1.Room = roommanager.SelectRoom(r.RoomId); me1.Time = new DateTime(2018, 10, 16, 14, 00, 00); DTO.MovieEvent me2 = new DTO.MovieEvent(); me2.Movie = m2; me2.Room = roommanager.SelectRoom(r.RoomId); me2.Time = new DateTime(2018, 10, 16, 18, 00, 00); DTO.MovieEvent me3 = new DTO.MovieEvent(); me3.Movie = m3; me3.Room = roommanager.SelectRoom(r2.RoomId); me3.Time = new DateTime(2018, 10, 17, 18, 00, 00); AddMovieEvent(me1); AddMovieEvent(me2); AddMovieEvent(me3); AddMovieEventHeader(movieevents.ElementAt(0)); AddMovieEventHeader(movieevents.ElementAt(1)); AddMovieEventHeader(movieevents.ElementAt(2)); }
public List <MovieEventSeat> getEnableSeats(int id) { DTO.MovieEvent movieevent = null; List <DTO.MovieEventSeat> enablelist = new List <DTO.MovieEventSeat>(); foreach (var me in movieevents) { if (me.MovieEventId == id) { movieevent = me; } } foreach (var r in new List <DTO.Reservation>()) { for (int j = 0; j < movieevent.Room.Seats.Count; j++) { if (r.Seat.SeatId == movieevent.Room.Seats.ElementAt(j).SeatId) { enablelist.Add(movieevent.Room.Seats.ElementAt(j)); } } } return(enablelist); }
public void AddMovieEvent(DTO.MovieEvent me) { me.MovieEventId = movieeventIDs; movieeventIDs++; movieevents.Add(me); }