/// <summary>
        /// This function is responsible for the series of actions that will be performed when this button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            Button a = (Button)sender;

            tempStop = (BO.Stop)a.DataContext;
            try
            {
                bl.DeleteStop(tempStop.StopCode);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception", MessageBoxButton.OK, MessageBoxImage.Information);
            }

            var aa = bl.GetAllStops().ToList();

            if (au == "PASSENGER")
            {
                foreach (BO.Stop stop in aa)
                {
                    stop.Show = BO.status.REFULING;
                }
            }
            else
            {
                foreach (BO.Stop stop in aa)
                {
                    stop.Show = BO.status.READY_FOR_DRIVE;
                }
            }
            stopList.ItemsSource = aa;
        }
示例#2
0
        public static BO.Board nothing = null;//have to send a sender!!!!! and is always null

        //public static event EventHandler<BO.Board> BoardChanged;


        //private static void UpdateBoard(long number, long stopCode)
        //{
        //    BoardChanged?.Invoke(nothing, new BO.Board(number,stopCode));
        //}


        public board(BO.Stop myStop)
        {
            stop = myStop;
            InitializeComponent();
            foreach (var num in myStop.Lines)
            {
                toPrintL.Add(new BO.Board(num.Number, 555));
            }

            LineListS.DataContext = toPrintL;
            boardList.DataContext = (from line in stop.Lines
                                     let b = new BO.Board(line.Number, stop.StopCode)
                                             where b.Arrival > new TimeSpan(0)
                                             orderby b.Arrival
                                             select b).ToList();
            //board.BoardChanged += changeText;
            UpdateBoardList();



            update                            = new BackgroundWorker();
            update.DoWork                    += DoWorkLineUpdate;
            update.ProgressChanged           += Worker_ProgressChangedUpdate;
            update.RunWorkerCompleted        += Worker_RunWorkerCompletedUpdate;
            update.WorkerReportsProgress      = true;
            update.WorkerSupportsCancellation = true;
            update.RunWorkerAsync();
        }
示例#3
0
 /// <summary>
 /// Initializes the current window in all existing objects
 /// </summary>
 public StopMangaer(BO.Stop stop)
 {
     InitializeComponent();
     managingStop = new BO.Stop();
     managingStop = stop;
     bl           = BLApi.Factory.GetBL("1");
 }
 /// <summary>
 /// constractor of the window
 /// </summary>
 public StopInfo(BO.Stop infoStop)
 {
     InitializeComponent();
     stopInfo.DataContext = infoStop;
     BLApi.IBL bl;
     bl = BLApi.Factory.GetBL("1");
     LineListS.ItemsSource = /*bl.GetAllLinesByStopCode(infoStop.StopCode).ToList()*/ infoStop.Lines;
 }
        /// <summary>
        /// constractor of the window
        /// </summary>
        public AddStopToLine(BO.Stop stop)
        {
            InitializeComponent();
            managingStop = stop;

            bl = BLApi.Factory.GetBL("1");
            lines.DataContext = bl.GetAllLines();
        }
 /// <summary>
 /// Defines actions to be performed when the user enters input
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Line_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     tempStop = (BO.Stop)allStopsList.SelectedItem;
     for (int i = 1; i <= managingLine.Stops.Count() + 1; i++)
     {
         number_in_lines.Items.Add(i);
     }
 }
        /// <summary>
        /// Defines actions to be performed when a  button is pressed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void information_Click(object sender, RoutedEventArgs e)
        {
            Button a = (Button)sender;

            tempStop = (BO.Stop)a.DataContext;
            new StopInfo(tempStop).Show();
            this.Close();
        }
        /// <summary>
        /// Defines actions to be performed when a  button is pressed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Update_Click(object sender, RoutedEventArgs e)
        {
            Button a = (Button)sender;

            tempStop = (BO.Stop)a.DataContext;
            new StopMangaer(tempStop).Show();
            this.Close();
        }
        /// <summary>
        /// Defines actions to be performed when a  button is pressed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            Button a = (Button)sender;

            tempStop = (BO.Stop)a.DataContext;
            stopListInput.Remove(tempStop);
            StopListListBox.Items.Refresh();
        }
        /// <summary>
        /// This function is responsible for the series of actions that will be performed when this button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddStopToLine_Click(object sender, RoutedEventArgs e) //aaa
        {
            Button a = (Button)sender;

            tempStop = (BO.Stop)a.DataContext;
            var ab = new AddStopToLine(tempStop);

            ab.Height = 300;
            ab.Width  = 600;
            ab.Show();
        }
        /// <summary>
        /// This function is responsible for the series of actions that will be performed when this button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Location_Click(object sender, RoutedEventArgs e) //aaa
        {
            Button a = (Button)sender;

            tempStop = (BO.Stop)a.DataContext;
            var ab = new map(tempStop.Longitude, tempStop.Latitude);

            ab.Height = 300;
            ab.Width  = 600;
            ab.Show();
        }
        /// <summary>
        /// This function is responsible for the series of actions that will be performed when this button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Update_Click(object sender, RoutedEventArgs e)
        {
            Button a = (Button)sender;

            tempStop = (BO.Stop)a.DataContext;
            var ab = new StopMangaer(tempStop);

            ab.Height = 300;
            ab.Width  = 600;
            ab.Show();
        }
        /// <summary>
        /// This function is responsible for the series of actions that will be performed when this button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void information_Click(object sender, RoutedEventArgs e)
        {
            Button a = (Button)sender;

            tempStop = (BO.Stop)a.DataContext;
            var ab = new StopInfo(tempStop);

            ab.Height = 300;
            ab.Width  = 600;
            ab.Show();
        }
        public boardMy(BO.Stop myStop)
        {
            stop = myStop;
            InitializeComponent();
            List <BO.Board> toPrintL = new List <BO.Board>();

            foreach (var num in myStop.Lines)
            {
                toPrintL.Add(new BO.Board(num.Number, 555));
            }

            LineListS.DataContext = toPrintL;
        }
        private void board_click(object sender, RoutedEventArgs e) //aaa
        {
            string b = bl.GetAllUsers().ToList().First().UserName;
            Button a = (Button)sender;

            tempStop = (BO.Stop)a.DataContext;

            if (b == "Shalom")
            {
                var ba = new boardMy(tempStop);
                ba.Height = 300;
                ba.Width  = 600;
                ba.Show();
                return;
            }
            var ab = new board(tempStop);

            ab.Height = 300;
            ab.Width  = 600;
            ab.Show();
        }
 /// <summary>
 /// Defines actions to be performed when a  button is pressed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void StopList_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     BO.Stop tempStop = (BO.Stop)StopListComboBox.SelectedItem;
     stopListInput.Add(tempStop);
     StopListListBox.Items.Refresh();
 }
示例#17
0
 /// <summary>
 /// Initializes the current window in all existing objects
 /// </summary>
 public map4(ref BO.Stop stop)
 {
     InitializeComponent();
 }