/// <summary>
 /// ctor of the window
 /// </summary>
 public ManagerPresentation()
 {
     InitializeComponent();
     try
     {
         bl = BLFactory.GetBL();
     }
     catch (BO.MissingData ex) //creating BO failed
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #2
0
 /// <summary>
 /// win ctor
 /// </summary>
 public Simulator()
 {
     InitializeComponent();
     try
     {
         bl = BLFactory.GetBL();
         StationsDataGrid.ItemsSource = bl.GetAllBusStations();
     }
     catch (BO.MissingData ex) //creating BO failed
     {
         MessageBox.Show(ex.Message);
     }
 }
 /// <summary>
 /// window ctor
 /// </summary>
 public Register()
 {
     InitializeComponent();
     try
     {
         bl = BLFactory.GetBL();
     }
     catch (BO.MissingData ex) //creating BO failed
     {
         MessageBox.Show(ex.Message);
     }
     NameTB.Focus();
 }
Beispiel #4
0
 /// <summary>
 /// window ctor
 /// </summary>
 public NewStationInfo()
 {
     InitializeComponent();
     try
     {
         bl = BLFactory.GetBL();
     }
     catch (BO.MissingData ex) //creating bo failed
     {
         MessageBox.Show(ex.Message);
     }
     CodeTB.Focus();
 }
Beispiel #5
0
 /// <summary>
 /// window ctor
 /// </summary>
 /// <param name="busline"></param>
 public NewTripInfo(BO.BusLine busline)
 {
     InitializeComponent();
     try
     {
         bl      = BLFactory.GetBL();
         busLine = busline;
     }
     catch (BO.MissingData ex) //creating bo failed
     {
         MessageBox.Show(ex.Message);
     }
 }
 /// <summary>
 /// window ctor
 /// </summary>
 /// <param name="bus"></param>
 public BusInfo(BO.Bus bus)
 {
     InitializeComponent();
     try
     {
         bl = BLFactory.GetBL();
     }
     catch (BO.MissingData ex) //creating BO failed
     {
         MessageBox.Show(ex.Message);
     }
     Curbus = bus;
     MainGrid.DataContext = Curbus;
 }
 /// <summary>
 /// ctor of the window that get BO.bus
 /// </summary>
 /// <param name="busLine">bus that sending from the win that call this win</param>
 public LineInfo(BusLine busLine)
 {
     InitializeComponent();
     try
     {
         bl = BLFactory.GetBL();
     }
     catch (BO.MissingData ex) // create BO failed
     {
         MessageBox.Show(ex.Message);
     }
     curBusLine          = busLine;
     AreasCB.ItemsSource = Enum.GetValues(typeof(BO.Areas));
     UpdateData();
 }
Beispiel #8
0
 /// <summary>
 /// win ctor
 /// </summary>
 /// <param name="us"></param>
 public UserInfo(BO.User us)
 {
     InitializeComponent();
     try
     {
         bl = BLFactory.GetBL();
     }
     catch (BO.MissingData ex) //creating BO failed
     {
         MessageBox.Show(ex.Message);
     }
     user = us;
     MainGrid.DataContext      = user;
     StartComboBox.DataContext = bl.GetAllBusStations();
     EndComboBox.DataContext   = bl.GetAllBusStations();
 }
        /// <summary>
        /// window ctor
        /// </summary>
        /// <param name="first">the first station</param>
        /// <param name="second">the second station</param>
        public UpdateTimeAndDistance(BO.LineStation first, BO.LineStation second)
        {
            InitializeComponent();
            try
            {
                bl = BLFactory.GetBL();
            }
            catch (BO.MissingData ex) // missing data
            {
                MessageBox.Show(ex.Message);
            }
            firstStation  = first;
            secondStation = second;

            MainGrid.DataContext = first;
            SecondSt.DataContext = second;
        }
        /// <summary>
        /// window ctor
        /// </summary>
        public NewLineInfo()
        {
            InitializeComponent();
            try
            {
                bl = BLFactory.GetBL();
            }
            catch (BO.MissingData ex) //creating bo failed
            {
                MessageBox.Show(ex.Message);
            }

            busStationsList                = new ObservableCollection <BO.Station>(bl.GetAllBusStations()); // for hidden the station that choose
            newbusStationsList             = new ObservableCollection <BO.Station>();
            StationsListBox.DataContext    = busStationsList;
            NewStationsListBox.DataContext = newbusStationsList;
            AreasCB.ItemsSource            = Enum.GetValues(typeof(BO.Areas));
        }
 public StationInfo(BO.BusStation station)
 {
     InitializeComponent();
     try
     {
         bl = BLFactory.GetBL();
     }
     catch (BO.MissingData ex)
     {
         MessageBox.Show(ex.Message);
         this.Close();
     }
     busStation                = station;
     lines                     = new ObservableCollection <BO.Line>(busStation.LinesInstation);
     MainGrid.DataContext      = busStation;
     LinesDataGrid.ItemsSource = lines;
     //WRONG!!!
     MyMap.Center        = new Location(busStation.Position.Latitude, busStation.Position.Longitude);
     UpdateBtn.IsEnabled = false;
 }
 /// <summary>
 /// window ctor
 /// </summary>
 public NewBusInfo()
 {
     InitializeComponent();
     try
     {
         bl  = BLFactory.GetBL();
         bus = new BO.Bus()
         {
             LastTreatmentDate  = DateTime.Now,
             TripSinceTreatment = 0,
             FuelRemain         = 400,
             BusStatus          = Status.Ready
         };
         date.DataContext = bus;
     }
     catch (BO.MissingData ex) //creating bo failed
     {
         MessageBox.Show(ex.Message);
     }
 }