// private readonly BO.ConsecutiveStationsBo consecutiveStationsBo; public UdaptingDt(BO.StationLineBO StationLineBO, int index1, IBL1 bl1) { InitializeComponent(); bl = bl1; StationLineBO1 = StationLineBO; index = index1; }
public AddStationTowOldLine(IBL1 bl1, int number, BO.StationLineBO stationLineBO, BO.StationLineBO stationLineBO3) { InitializeComponent(); bl = bl1; IEnumerable <BO.BusStationBO> busStationBOs = bl.ShowStation(); StationList.ItemsSource = busStationBOs; NumberLine = number; StationLineBO1 = stationLineBO; StationLineBO2 = stationLineBO3; }
public AddTimeDIS(IBL1 bl1, BO.StationLineBO stationLineBO1, BO.StationLineBO stationLineBO2, BO.StationLineBO stationLineBO3, string name) { InitializeComponent(); bl = bl1; StationLineBO1 = stationLineBO1; StationLineBO2 = stationLineBO2; StationLineBO3 = stationLineBO3; sa.Text = stationLineBO1.NameOfStation; sbe.Text = name; sc.Text = name; sd.Text = stationLineBO3.NameOfStation; }
private void Delete(object sender, RoutedEventArgs e) { try { FrameworkElement frameworkElement = sender as FrameworkElement; BO.StationLineBO stationLineBO = frameworkElement.DataContext as BO.StationLineBO; bl.DeleteStationFromLine(BusLine.BusLineID1, stationLineBO.StationNumberOnLine); _ = busLineBOs.Remove(stationLineBO); busLineBOs.Insert(stationLineBO.LocationNumberOnLine, bl.ReturnStationLine(BusLine.BusLineID1, stationLineBO.StationNumberOnLine)); } catch (BO.BOExceptionLineStation ex) { _ = MessageBox.Show(ex.Message, "Error", MessageBoxButton.OKCancel, MessageBoxImage.Error); } }
private void BusStationBOListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { StationLineBO1 = (BO.StationLineBO)busStationBOListView.SelectedItem; int index = busStationBOListView.SelectedIndex; if (index == busLineBOs.Count - 1) { _ = MessageBox.Show("Error!!! It is not possible to change a terminal or first station to a line. Create a new line", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { addStation.IsEnabled = true; addStation.Content = "הוסף תחנה לאחר תחנה: " + StationLineBO1.NameOfStation; StationLineBO2 = busLineBOs[index + 1]; } }
private void UdaptingTd(object sender, RoutedEventArgs e) { FrameworkElement frameworkElement = sender as FrameworkElement; BO.StationLineBO busStationBO = frameworkElement.DataContext as BO.StationLineBO; if (busStationBO != busLineBOs[busLineBOs.Count - 1]) { UdaptingDt udaptingDt = new UdaptingDt(busStationBO, busLineBOs[busStationBO.LocationNumberOnLine + 1].StationNumberOnLine, bl); udaptingDt.Show(); busStationBOListView.Items.Refresh(); Close(); } else { _ = MessageBox.Show("Last station has no time and distance to the next station", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void AddStation(object sender, RoutedEventArgs e) { FrameworkElement fxElt = sender as FrameworkElement; BO.BusStationBO busStationBO = fxElt.DataContext as BO.BusStationBO; BO.StationLineBO stationLineBO = new BO.StationLineBO { BusLineID2 = NumberLine, StationNumberOnLine = busStationBO.StationNumber, ChackDelete2 = true, LocationNumberOnLine = StationLineBO2.LocationNumberOnLine }; AddTimeDIS addTimeDIS = new AddTimeDIS(bl, StationLineBO1, stationLineBO, StationLineBO2, busStationBO.NameOfStation); addTimeDIS.Show(); Close(); }