public static StopView ToDomainView(this StopEntityView stop) { if (stop != null) { StopView stopView = new StopView { StopId = stop.StopId, City = stop.City, Name = stop.Name, Duration = stop.Duration, ArrivalTime = stop.ArrivalTime, DepartureTime = stop.DepartureTime }; List <Route> routes = new List <Route>(); for (int i = 0; i < stop.Routes.Count; i++) { Route routeView = stop.Routes[i].ToDomain(); routes.Add(routeView); } stopView.Routes = routes; return(stopView); } else { return(null); } }
internal void Stop2View_Click(object sender, EventArgs e) { if (sender == null) { this.stopViewManager2.StopViews.CheckControlAndUncheckAllOthers(null); this.Stop1View_Click(this.selectedStopViewA, e); return; } this.selectedStopViewB = sender as StopView; this.stopViewManager2.StopViews.CheckControlAndUncheckAllOthers(this.selectedStopViewB); this.Stop1View_Click(this.selectedStopViewA, e); }
public IList <StopView> GetStops() { IList <StopEntityView> stops = _stopRepository.GetAllStops(); IList <StopView> stopViews = new List <StopView>(); foreach (StopEntityView wagonEntity in stops) { StopView wagon = wagonEntity.ToDomainView(); stopViews.Add(wagon); } return(stopViews); }
public StopView GetStopView(int id) { StopView stops = _stopRepository.GetStopEntityView(id).ToDomainView(); return(stops); }