public int GetScheduleTravelClassId(int travelClassId) { var scheduleTravelClass = ScheduleTravelClasses.Where(x => x.TravelClassId == travelClassId).SingleOrDefault(); int id = scheduleTravelClass == null ? 0 : scheduleTravelClass.Id; return(id); }
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); }
public ScheduleTravelClass GetScheduleTravelClass(int travelClassId) { var scheduleTravelClass = ScheduleTravelClasses.Where(x => x.TravelClassId == travelClassId).SingleOrDefault(); return(scheduleTravelClass); }