コード例 #1
0
        /// <summary>
        /// an event to show the add station window
        /// </summary>

        private void addStation_Click(object sender, RoutedEventArgs e)
        {
            AddUpdateStation newStation = new AddUpdateStation();

            if (newStation.ShowDialog() == true)//if the user could click on ok
            {
                bl.AddStation(newStation.MyStation);
                listStations.Insert(0, newStation.MyStation);
            }
        }
コード例 #2
0
        /// <summary>
        /// an event to show the update station window
        /// </summary>

        private void update_Click(object sender, RoutedEventArgs e)
        {
            BO.Station       s          = ((Button)sender).DataContext as BO.Station;
            AddUpdateStation newStation = new AddUpdateStation(s.Code);

            if (newStation.ShowDialog() == true)//if the user fill all the ditals
            {
                bl.UpdateStation(newStation.MyStation);
                int i = listStations.IndexOf(s);
                listStations.Remove(s);
                listStations.Insert(i, newStation.MyStation);
            }
        }