private Ticket ReadTicket(SqlDataReader reader, TrainTrip trip) { var res = new Ticket(); res.Id = (int)reader["TicketId"]; res.Trip = trip; res.Cost = (double)reader["TicketCost"]; res.BookingTime = reader["TicketBookingTime"] == DBNull.Value ? null : (DateTime?)reader["TicketBookingTime"]; res.SeatNumber = (int)reader["TicketSeatNumber"]; res.WagonNumber = (int)reader["TicketWagonNumber"]; res.Passenger = ReadCustomer(reader); return res; }
public TripDetailsViewModel(TrainTrip trip, Ticket[] tickets) { Trip = trip; Tickets = tickets; }