예제 #1
0
        public int GetScheduleTravelClassId(int travelClassId)
        {
            var scheduleTravelClass = ScheduleTravelClasses.Where(x => x.TravelClassId == travelClassId).SingleOrDefault();
            int id = scheduleTravelClass == null ? 0 : scheduleTravelClass.Id;

            return(id);
        }
예제 #2
0
        public string GetPriceAndSeats(TravelClass travelClass, DateTime date)
        {
            var info = "NA";

            try
            {
                var scheduleTravelClass = ScheduleTravelClasses.Where(x => x.TravelClassId == travelClass.Id).SingleOrDefault();
                if (scheduleTravelClass != null)
                {
                    info = string.Format("NGN {0}({1} seat(s) left)", scheduleTravelClass.Price, scheduleTravelClass.GetRemainingSeats(date));
                }
            }
            catch (Exception ex)
            {
            }

            return(info);
        }
예제 #3
0
        public ScheduleTravelClass GetScheduleTravelClass(int travelClassId)
        {
            var scheduleTravelClass = ScheduleTravelClasses.Where(x => x.TravelClassId == travelClassId).SingleOrDefault();

            return(scheduleTravelClass);
        }