Ejemplo n.º 1
0
 public ViewTourModel(IUserCollection users, IExcursionCollection excursions, ITourCollection tours, IAgencyCollection agencies)
 {
     _userList      = users;
     _excursionList = excursions;
     _tourList      = tours;
     _agencyList    = agencies;
 }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
 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);
         }
     }
 }
Ejemplo n.º 4
0
 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));
 }
Ejemplo n.º 6
0
 public DeleteTourModel(IExcursionCollection excursions, ITourCollection tours, IAgencyCollection agencies)
 {
     _excursionList = excursions;
     _tourList      = tours;
     _agencyList    = agencies;
 }