public ViewTourModel(IUserCollection users, IExcursionCollection excursions, ITourCollection tours, IAgencyCollection agencies) { _userList = users; _excursionList = excursions; _tourList = tours; _agencyList = agencies; }
public AddTourModel(IExcursionCollection excursions, ITourCollection tours, IAgencyCollection agencies) { _excursionList = excursions; _tourList = tours; _agencyList = agencies; AgencySelectOptions = new SelectList(_agencyList.TravelAgencies, nameof(TravelAgency.Id), nameof(TravelAgency.Title)); ExcursionSelectOptions = new SelectList(_excursionList.Excursions, nameof(Excursion.Id), nameof(Excursion.Title)); }
public static void SynchronizeAdding(this IExcursionCollection excursionList, Tour tour) { if (tour.AgenciesId == null) { return; } foreach (Excursion excursion in excursionList.Excursions) { Excursion newExcursion = excursion; if (tour.ExcursionsId.Contains(excursion.Id)) { newExcursion.ToursId.Add(tour.Id); excursionList.Update(newExcursion); } } }
public DeleteExcursionModel(IExcursionCollection excursions, ITourCollection tours) { _excursionList = excursions; _tourList = tours; }
public AddExcursionModel(IExcursionCollection excursions, ITourCollection tours) { _excursionList = excursions; _tourList = tours; SelectOptions = new SelectList(_tourList.Tours, nameof(Tour.Id), nameof(Tour.Title)); }
public DeleteTourModel(IExcursionCollection excursions, ITourCollection tours, IAgencyCollection agencies) { _excursionList = excursions; _tourList = tours; _agencyList = agencies; }