Esempio n. 1
0
        public void FilterRouteBycationDate()
        {
            #region 서울 -> 정읍
            if (comboArrival.Text == "서울" && comboDeparture.Text == "정읍")
            {
                var result = from reservationtime in ReservationDao.GetAllReservationDate()
                             from route in RouteDao.GetByRouteId()
                             where reservationtime.RouteId == 1 && route.RouteId == 1 && DateTimePicker.Value.Date == reservationtime.ReservationDate
                             select new
                {
                    reservationtime.ArrivalTime,
                    reservationtime.DepartureTime,
                    reservationtime.ReservationDate,
                    route.ArrivalLocation,
                    reservationtime.TravelTime,
                    reservationtime.RouteId
                };

                routeBindingSource.DataSource = result;
            }
            #endregion
            #region 대전 -> 부산
            if (comboArrival.Text == "대전" && comboDeparture.Text == "부산")
            {
                var result = from reservationtime in ReservationDao.GetAllReservationDate()
                             from route in RouteDao.GetByRouteId()
                             where reservationtime.RouteId == 2 && route.RouteId == 2 && DateTimePicker.Value.Date == reservationtime.ReservationDate
                             select new
                {
                    reservationtime.ArrivalTime,
                    reservationtime.DepartureTime,
                    reservationtime.ReservationDate,
                    route.ArrivalLocation,
                    reservationtime.TravelTime,
                    reservationtime.RouteId
                };
                routeBindingSource.DataSource = result;
            }
            #endregion
        }